rocksdb/utilities/blob_db
Levi Tamasi db536ee045 Propagate errors from UpdateBoundaries (#9851)
Summary:
In `FileMetaData`, we keep track of the lowest-numbered blob file
referenced by the SST file in question for the purposes of BlobDB's
garbage collection in the `oldest_blob_file_number` field, which is
updated in `UpdateBoundaries`. However, with the current code,
`BlobIndex` decoding errors (or invalid blob file numbers) are swallowed
in this method. The patch changes this by propagating these errors
and failing the corresponding flush/compaction. (Note that since blob
references are generated by the BlobDB code and also parsed by
`CompactionIterator`, in reality this can only happen in the case of
memory corruption.)

This change necessitated updating some unit tests that involved
fake/corrupt `BlobIndex` objects. Some of these just used a dummy string like
`"blob_index"` as a placeholder; these were replaced with real `BlobIndex`es.
Some were relying on the earlier behavior to simulate corruption; these
were replaced with `SyncPoint`-based test code that corrupts a valid
blob reference at read time.

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

Test Plan: `make check`

Reviewed By: riversand963

Differential Revision: D35683671

Pulled By: ltamasi

fbshipit-source-id: f7387af9945c48e4d5c4cd864f1ba425c7ad51f6
2022-04-15 20:25:48 -07:00
..
blob_compaction_filter.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
blob_compaction_filter.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
blob_db_gc_stats.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00
blob_db_impl_filesnapshot.cc Fix FileStorageInfo fields from GetLiveFilesMetaData (#9769) 2022-03-29 14:36:35 -07:00
blob_db_impl.cc Add rate limiter priority to ReadOptions (#9424) 2022-02-16 23:18:14 -08:00
blob_db_impl.h Revise APIs related to user-defined timestamp (#8946) 2022-02-01 22:19:01 -08:00
blob_db_iterator.h Use SystemClock* instead of std::shared_ptr<SystemClock> in lower level routines (#8033) 2021-03-15 04:34:11 -07:00
blob_db_listener.h Make EventListener into a Customizable Class (#8473) 2021-07-27 07:47:02 -07:00
blob_db_test.cc Propagate errors from UpdateBoundaries (#9851) 2022-04-15 20:25:48 -07:00
blob_db.cc Cleanup includes in dbformat.h (#8930) 2021-09-29 04:04:40 -07:00
blob_db.h Revise APIs related to user-defined timestamp (#8946) 2022-02-01 22:19:01 -08:00
blob_dump_tool.cc Add rate limiter priority to ReadOptions (#9424) 2022-02-16 23:18:14 -08:00
blob_dump_tool.h Move blob_log_{format,reader,writer}.{cc,h} to db/blob/ (#6960) 2020-06-09 15:16:05 -07:00
blob_file.cc Add rate limiter priority to ReadOptions (#9424) 2022-02-16 23:18:14 -08:00
blob_file.h Remove Legacy and Custom FileWrapper classes from header files (#7851) 2021-01-28 22:10:32 -08:00