rocksdb/db/db_impl
Levi Tamasi cc4c9e80e4 Fix the sorting of KeyContexts for batched MultiGet (#8633)
Summary:
`CompareKeyContext::operator()` on the trunk has a bug: when comparing
column family IDs, `lhs` is used for both sides of the comparison. This
results in the `KeyContext`s getting sorted solely based on key, which
in turn means that keys with the same column family do not necessarily
form a single range in the sorted list. This violates an assumption of the
batched `MultiGet` logic, leading to the same column family
showing up multiple times in the list of `MultiGetColumnFamilyData`.
The end result is the code attempting to check out the thread-local
`SuperVersion` for the same CF multiple times, causing an
assertion violation in debug builds and memory corruption/crash in
release builds.

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

Test Plan: `make check`

Reviewed By: riversand963

Differential Revision: D30169182

Pulled By: ltamasi

fbshipit-source-id: a47710652df7e95b14b40fb710924c11a8478023
2021-09-08 12:25:27 -07:00
..
db_impl_compaction_flush.cc Do not full scan obsolete files on compaction busy (#7739) 2020-12-15 13:51:10 -08:00
db_impl_debug.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
db_impl_experimental.cc Replace reinterpret_cast with static_cast_with_check (#7067) 2020-07-02 19:25:41 -07:00
db_impl_files.cc Write min_log_number_to_keep to MANIFEST during atomic flush under 2 phase commit (#7570) 2020-12-03 19:22:24 -08:00
db_impl_open.cc Add further tests to ASSERT_STATUS_CHECKED (2) (#7698) 2020-12-09 21:21:16 -08:00
db_impl_readonly.cc Add blob support to DBIter (#7731) 2020-12-04 21:29:38 -08:00
db_impl_readonly.h RocksJava - Add errorIfLogFileExists parameter to RocksDB.openReadOnly (#7046) 2020-09-17 15:41:25 -07:00
db_impl_secondary.cc Add blob support to DBIter (#7731) 2020-12-04 21:29:38 -08:00
db_impl_secondary.h RocksJava - Add errorIfLogFileExists parameter to RocksDB.openReadOnly (#7046) 2020-09-17 15:41:25 -07:00
db_impl_write.cc Track WAL obsoletion when updating empty CF's log number (#7781) 2020-12-18 21:34:36 -08:00
db_impl.cc Fix the sorting of KeyContexts for batched MultiGet (#8633) 2021-09-08 12:25:27 -07:00
db_impl.h Add initial blob support to batched MultiGet (#7766) 2020-12-14 13:48:22 -08:00
db_secondary_test.cc Fix assertion failure in bg flush (#7362) 2020-12-02 09:31:14 -08:00