rocksdb/table/block_based
Peter Dillinger 433d7e4594 Improve error messages for SST footer and size errors (#11009)
Summary:
Previously, you could get a format_version error if SST file size was too small in manifest, or a weird "too short" error if too big in manifest. Now we ensure:
* Magic number error is reported first if we attempt to open an SST file and the footer is completely bad.
* Footer errors are reported with affected file.
* If manifest file size doesn't match actual, then the error includes expected and actual sizes (if an error is reported; in some cases we allow the file to be too big)

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

Test Plan:
unit tests added, some manual

Previously, the code for "file too short" in footer processing was only covered by some tests attempting to verify SST checksums on non-SST files (fixed).

Reviewed By: siying

Differential Revision: D41656272

Pulled By: pdillinger

fbshipit-source-id: 3da32702eb5aaedbea0e5e74742ad57edd7ad3df
2022-12-09 10:03:47 -08:00
..
binary_search_index_reader.cc
binary_search_index_reader.h
block.cc
block.h
block_based_table_builder.cc Don't attempt to use SecondaryCache on block_cache_compressed (#10944) 2022-11-11 17:35:53 -08:00
block_based_table_builder.h
block_based_table_factory.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_based_table_factory.h
block_based_table_iterator.cc
block_based_table_iterator.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_based_table_reader.cc Improve error messages for SST footer and size errors (#11009) 2022-12-09 10:03:47 -08:00
block_based_table_reader.h
block_based_table_reader_impl.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_based_table_reader_sync_and_async.h
block_based_table_reader_test.cc
block_builder.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_builder.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
block_like_traits.h Don't attempt to use SecondaryCache on block_cache_compressed (#10944) 2022-11-11 17:35:53 -08:00
block_prefetcher.cc
block_prefetcher.h
block_prefix_index.cc
block_prefix_index.h
block_test.cc
block_type.h
cachable_entry.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
data_block_footer.cc
data_block_footer.h
data_block_hash_index.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
data_block_hash_index.h
data_block_hash_index_test.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
filter_block.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
filter_block_reader_common.cc Don't attempt to use SecondaryCache on block_cache_compressed (#10944) 2022-11-11 17:35:53 -08:00
filter_block_reader_common.h
filter_policy.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
filter_policy_internal.h
flush_block_policy.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
flush_block_policy.h
full_filter_block.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
full_filter_block.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
full_filter_block_test.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
hash_index_reader.cc
hash_index_reader.h
index_builder.cc
index_builder.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
index_reader_common.cc
index_reader_common.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
mock_block_based_table.h
parsed_full_filter_block.cc
parsed_full_filter_block.h
partitioned_filter_block.cc
partitioned_filter_block.h
partitioned_filter_block_test.cc Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
partitioned_index_iterator.cc
partitioned_index_iterator.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00
partitioned_index_reader.cc
partitioned_index_reader.h
reader_common.cc
reader_common.h
uncompression_dict_reader.cc
uncompression_dict_reader.h Format files under table/ by clang-format (#10852) 2022-10-25 11:50:38 -07:00