rocksdb/file
Zhichao Cao b3585a11b4 Ingest SST files with checksum information (#6891)
Summary:
Application can ingest SST files with file checksum information, such that during ingestion, DB is able to check data integrity and identify of the SST file. The PR introduces generate_and_verify_file_checksum to IngestExternalFileOption to control if the ingested checksum information should be verified with the generated checksum.

    1. If generate_and_verify_file_checksum options is *FALSE*: *1)* if DB does not enable SST file checksum, the checksum information ingested will be ignored; *2)* if DB enables the SST file checksum and the checksum function name matches the checksum function name in DB, we trust the ingested checksum, store it in Manifest. If the checksum function name does not match, we treat that as an error and fail the IngestExternalFile() call.
    2. If generate_and_verify_file_checksum options is *TRUE*: *1)* if DB does not enable SST file checksum, the checksum information ingested will be ignored; *2)* if DB enable the SST file checksum, we will use the checksum generator from DB to calculate the checksum for each ingested SST files after they are copied or moved. Then, compare the checksum results with the ingested checksum information: _A)_ if the checksum function name does not match, _verification always report true_ and we store the DB generated checksum information in Manifest. _B)_ if the checksum function name mach, and checksum match, ingestion continues and stores the checksum information in the Manifest. Otherwise, terminate file ingestion and report file corruption.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6891

Test Plan: added unit test, pass make asan_check

Reviewed By: pdillinger

Differential Revision: D21935988

Pulled By: zhichao-cao

fbshipit-source-id: 7b55f486632db467e76d72602218d0658aa7f6ed
2020-06-11 14:27:36 -07:00
..
delete_scheduler_test.cc Add logs and stats in DeleteScheduler (#6927) 2020-06-05 09:43:04 -07:00
delete_scheduler.cc Add logs and stats in DeleteScheduler (#6927) 2020-06-05 09:43:04 -07:00
delete_scheduler.h Add logs and stats in DeleteScheduler (#6927) 2020-06-05 09:43:04 -07:00
file_prefetch_buffer.cc Reduce dependency on gtest dependency in release code (#6907) 2020-06-02 12:11:24 -07:00
file_prefetch_buffer.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
file_util.cc Ingest SST files with checksum information (#6891) 2020-06-11 14:27:36 -07:00
file_util.h Ingest SST files with checksum information (#6891) 2020-06-11 14:27:36 -07:00
filename.cc Find/purge obsolete blob files (#6807) 2020-05-07 09:32:51 -07:00
filename.h Find/purge obsolete blob files (#6807) 2020-05-07 09:32:51 -07:00
random_access_file_reader_test.cc Some fixes for gcc 4.8 and add to Travis (#6915) 2020-06-03 11:39:25 -07:00
random_access_file_reader.cc sst_dump to reduce number of file reads (#6836) 2020-05-12 18:23:33 -07:00
random_access_file_reader.h Misc things for ASSERT_STATUS_CHECKED, also gcc 4.8.5 (#6871) 2020-05-23 06:53:37 -07:00
read_write_util.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
read_write_util.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
readahead_raf.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
readahead_raf.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
sequence_file_reader.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
sequence_file_reader.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
sst_file_manager_impl.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
sst_file_manager_impl.h Add logs and stats in DeleteScheduler (#6927) 2020-06-05 09:43:04 -07:00
writable_file_writer.cc Remove unnecessary inclusion of version_edit.h in env (#6952) 2020-06-07 21:56:55 -07:00
writable_file_writer.h Clean up some code related to file checksums (#6861) 2020-05-21 08:12:51 -07:00