-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Merge support in WBWIMemTable
#13410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| assert(seq_inc == memtable_update_count + wbwi_count); | ||
| assert(wbwi_count > 0); | ||
| assert(last_sequence != kMaxSequenceNumber); | ||
| SequenceNumber lb = last_sequence + 1 - wbwi_count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change here is to fix a bug where with two_write_queues, the assertion ub == last_sequence may not be true. The reason is that last_sequence is the last allocated sequence number. Between versions_->LastSequence() and last_sequence, there are sequence numbers allocated for this write, and potentially sequence numbers allocated for other writes through the second write queue that write to WAL only.
[Edited] I saw an assertion failure with assert(ub == last_sequence); in a local stress test run. I'm not sure why but if it happens again it should be caught by the assertions here too. The change here makes aims to make seqno assignment clearer.
|
@cbi42 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @cbi42 thanks for the PR!
Thanks for the review! |
Summary: added merge support for WBWIMemTable. Most of the preparation work is done in facebook#13387 and facebook#13400. The main code change to support merge is in wbwi_memtable.cc to support reading the Merge value type. The rest of the changes are mostly comment change and tests. Pull Request resolved: facebook#13410 Test Plan: - new unit test - ran `python3 ./tools/db_crashtest.py --txn blackbox --txn_write_policy=0 --commit_bypass_memtable_one_in=100 --test_batches_snapshots=0 --use_merge=1` for several runs. Reviewed By: jowlyzhang Differential Revision: D69885868 Pulled By: cbi42 fbshipit-source-id: b127d95a3027dc35910f6e5d65f3409ba27e2b6b
Summary: added merge support for WBWIMemTable. Most of the preparation work is done in #13387 and #13400. The main code change to support merge is in wbwi_memtable.cc to support reading the Merge value type. The rest of the changes are mostly comment change and tests.
Test plan:
python3 ./tools/db_crashtest.py --txn blackbox --txn_write_policy=0 --commit_bypass_memtable_one_in=100 --test_batches_snapshots=0 --use_merge=1for several runs.