facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
27.9k stars 6.21k forks source link

Fix MultiGet dropping memtable kv checksum corruption #12842

Open cbi42 opened 1 week ago

cbi42 commented 1 week ago

Corruption status returned by GetFromTable() could be overwritten here: https://github.com/facebook/rocksdb/blob/b6c3495a7183f01901d3be01dc68f7e40a1a2e9b/db/version_set.cc#L2614

This PR fixes this issue by setting *(s->found_final_value) = true; in SaveValue. Also makes the handling of the return value of GetFromTable() more robust and added asserts in a couple places.

Test plan: Updated an existing unit test to cover MultiGet. It fails the assertion here before this PR: https://github.com/facebook/rocksdb/blob/b6c3495a7183f01901d3be01dc68f7e40a1a2e9b/db/version_set.cc#L2601

facebook-github-bot commented 6 days ago

@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.