rocksdb/env
anand76 7d7f14480e Always truncate the latest WAL file on DB Open (#8122)
Summary:
Currently, we only truncate the latest alive WAL files when the DB is opened. If the latest WAL file is empty or was flushed during Open, its not truncated since the file will be deleted later on in the Open path. However, before deletion, a new WAL file is created, and if the process crash loops between the new WAL file creation and deletion of the old WAL file, the preallocated space will keep accumulating and eventually use up all disk space. To prevent this, always truncate the latest WAL file, even if its empty or the data was flushed.

Tests:
Add unit tests to db_wal_test

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8122

Reviewed By: riversand963

Differential Revision: D27366132

Pulled By: anand1976

fbshipit-source-id: f923cc03ef033ccb32b140d36c6a63a8152f0e8e
2021-03-28 10:00:08 -07:00
..
composite_env_wrapper.h Remove Legacy and Custom FileWrapper classes from header files (#7851) 2021-01-28 22:10:32 -08:00
composite_env.cc Add new Append API with DataVerificationInfo to Env WritableFile (#8071) 2021-03-19 11:44:13 -07:00
env_basic_test.cc Improvements to Env::GetChildren (#7819) 2021-01-09 09:44:34 -08:00
env_chroot.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
env_chroot.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
env_encryption_ctr.h Changes to EncryptedEnv public API (#7279) 2020-09-15 17:14:10 -07:00
env_encryption.cc Make ChRootEnv, EncryptedEnv, and TimedEnv into FileSystems (#7968) 2021-03-15 19:50:11 -07:00
env_hdfs.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
env_posix.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
env_test.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
env.cc Remove Legacy and Custom FileWrapper classes from header files (#7851) 2021-01-28 22:10:32 -08:00
file_system_tracer.cc Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
file_system_tracer.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
file_system.cc Create a CustomEnv class; Add WinFileSystem; Make LegacyFileSystemWrapper private (#7703) 2021-01-06 10:49:32 -08:00
fs_posix.cc Avoid checking errno on success call (#8119) 2021-03-26 18:46:38 -07:00
io_posix_test.cc Status check enforcement for io_posix_test and options_settable_test (#6857) 2020-05-19 19:22:28 -07:00
io_posix.cc Always truncate the latest WAL file on DB Open (#8122) 2021-03-28 10:00:08 -07:00
io_posix.h Add AppendWithVerify and PositionedAppendWithVerify to Env and FileSystem (#7419) 2020-09-23 19:02:26 -07:00
mock_env_test.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
mock_env.cc Always truncate the latest WAL file on DB Open (#8122) 2021-03-28 10:00:08 -07:00
mock_env.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00