rocksdb/file
anand76 fb05b5a652 Force a new manifest file if append to current one fails (#6331)
Summary:
Fix for issue https://github.com/facebook/rocksdb/issues/6316

When an append/sync of the manifest file fails due to an IO error such
as NoSpace, we don't always put the DB in read-only mode. This is true
for flush and compactions, as well as foreground operatons such as column family
add/drop, CompactFiles etc. Subsequent changes to the DB will be
recorded in the same manifest file, which would have a corrupted record
in the middle due to the previous failure. On next DB::Open(), it will
fail to process the full manifest and data will be lost.

To fix this, we reset VersionSet::descriptor_log_ on append/sync
failure, which will force a new manifest file to be written on the next
append.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6331

Test Plan: Add new unit tests in error_handler_test.cc

Differential Revision: D19632951

Pulled By: anand1976

fbshipit-source-id: 68d527cb6e59a94cbbbf9f5a17a7f464381d51e3
2020-01-30 10:56:29 -08:00
..
delete_scheduler_test.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
delete_scheduler.cc Fix use-after-free and double-deleting files in BackgroundCallPurge() (#6193) 2019-12-17 20:08:56 -08:00
delete_scheduler.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
file_prefetch_buffer.cc Prevent file prefetch when mmap is enabled. (#6206) 2019-12-18 11:01:29 -08:00
file_prefetch_buffer.h Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
file_util.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
file_util.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
filename.cc Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
filename.h Persistent globally unique DB ID in manifest (#5725) 2019-09-03 08:52:24 -07:00
random_access_file_reader.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
random_access_file_reader.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
read_write_util.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
read_write_util.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
readahead_raf.cc Dedup IsFileSectorAligned() to fix unity build. (#5812) 2019-09-16 20:42:07 -07:00
readahead_raf.h Divide file_reader_writer.h and .cc (#5803) 2019-09-16 10:33:51 -07:00
sequence_file_reader.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
sequence_file_reader.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
sst_file_manager_impl.cc Force a new manifest file if append to current one fails (#6331) 2020-01-30 10:56:29 -08:00
sst_file_manager_impl.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
writable_file_writer.cc Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00
writable_file_writer.h Introduce a new storage specific Env API (#5761) 2019-12-13 14:48:41 -08:00