rocksdb/file
Zhichao Cao a904c62d28 Using existing crc32c checksum in checksum handoff for Manifest and WAL (#8412)
Summary:
In PR https://github.com/facebook/rocksdb/issues/7523 , checksum handoff is introduced in RocksDB for WAL, Manifest, and SST files. When user enable checksum handoff for a certain type of file, before the data is written to the lower layer storage system, we calculate the checksum (crc32c) of each piece of data and pass the checksum down with the data, such that data verification can be down by the lower layer storage system if it has the capability. However, it cannot cover the whole lifetime of the data in the memory and also it potentially introduces extra checksum calculation overhead.

In this PR, we introduce a new interface in WritableFileWriter::Append, which allows the caller be able to pass the data and the checksum (crc32c) together. In this way, WritableFileWriter can directly use the pass-in checksum (crc32c) to generate the checksum of data being passed down to the storage system. It saves the calculation overhead and achieves higher protection coverage. When a new checksum is added with the data, we use Crc32cCombine https://github.com/facebook/rocksdb/issues/8305 to combine the existing checksum and the new checksum. To avoid the segmenting of data by rate-limiter before it is stored, rate-limiter is called enough times to accumulate enough credits for a certain write. This design only support Manifest and WAL which use log_writer in the current stage.

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

Test Plan: make check, add new testing cases.

Reviewed By: anand1976

Differential Revision: D29151545

Pulled By: zhichao-cao

fbshipit-source-id: 75e2278c5126cfd58393c67b1efd18dcc7a30772
2021-06-25 00:47:17 -07:00
..
delete_scheduler_test.cc Use SST file manager to track blob files as well (#8037) 2021-03-17 20:44:49 -07:00
delete_scheduler.cc Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
delete_scheduler.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
file_prefetch_buffer.cc Improve BlockPrefetcher to prefetch only for sequential scans (#7394) 2021-04-28 12:53:46 -07:00
file_prefetch_buffer.h Improve BlockPrefetcher to prefetch only for sequential scans (#7394) 2021-04-28 12:53:46 -07:00
file_util.cc Fix typo: replace readadhead with readahead (#7953) 2021-02-18 14:31:20 -08:00
file_util.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
filename.cc Refactor kill point (#8241) 2021-05-05 15:50:29 -07:00
filename.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
line_file_reader.cc Refactor: add LineFileReader and Status::MustCheck (#8026) 2021-03-09 20:12:38 -08:00
line_file_reader.h Refactor: add LineFileReader and Status::MustCheck (#8026) 2021-03-09 20:12:38 -08:00
prefetch_test.cc Improve BlockPrefetcher to prefetch only for sequential scans (#7394) 2021-04-28 12:53:46 -07:00
random_access_file_reader_test.cc use the pointer directly (#8095) 2021-03-26 21:31:16 -07:00
random_access_file_reader.cc Replace Status with IOStatus for block fetcher IO function (#8130) 2021-04-01 10:07:55 -07:00
random_access_file_reader.h Replace Status with IOStatus for block fetcher IO function (#8130) 2021-04-01 10:07:55 -07:00
read_write_util.cc Refactor kill point (#8241) 2021-05-05 15:50:29 -07:00
read_write_util.h Refactor: add LineFileReader and Status::MustCheck (#8026) 2021-03-09 20:12:38 -08:00
readahead_raf.cc Make StringEnv, StringSink, StringSource use FS classes (#7786) 2021-01-04 16:01:01 -08:00
readahead_raf.h Make StringEnv, StringSink, StringSource use FS classes (#7786) 2021-01-04 16:01:01 -08:00
sequence_file_reader.cc Remove Legacy and Custom FileWrapper classes from header files (#7851) 2021-01-28 22:10:32 -08:00
sequence_file_reader.h Remove Legacy and Custom FileWrapper classes from header files (#7851) 2021-01-28 22:10:32 -08:00
sst_file_manager_impl.cc Use SST file manager to track blob files as well (#8037) 2021-03-17 20:44:49 -07:00
sst_file_manager_impl.h Use SST file manager to track blob files as well (#8037) 2021-03-17 20:44:49 -07:00
writable_file_writer.cc Using existing crc32c checksum in checksum handoff for Manifest and WAL (#8412) 2021-06-25 00:47:17 -07:00
writable_file_writer.h Using existing crc32c checksum in checksum handoff for Manifest and WAL (#8412) 2021-06-25 00:47:17 -07:00