]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Improve error messages for SST footer and size errors (#11009)
authorPeter Dillinger <peterd@fb.com>
Fri, 9 Dec 2022 18:03:47 +0000 (10:03 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 9 Dec 2022 18:03:47 +0000 (10:03 -0800)
commit433d7e4594fd4d14f81e0f4a09be826328fe6ffa
tree00a98e65cc1e5da7e3f5b686262337535ff10304
parent6648dec0a3eee0a329af8342038ce099baa55122
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
db/corruption_test.cc
include/rocksdb/status.h
table/adaptive/adaptive_table_factory.cc
table/block_based/block_based_table_reader.cc
table/block_fetcher_test.cc
table/format.cc
table/format.h
table/meta_blocks.cc
table/sst_file_dumper.cc
table/table_test.cc
util/status.cc