Skip to content
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

Fix range tombstone covering short-circuit logic #4698

Closed

Conversation

abhimadan
Copy link
Contributor

Summary: Since a range tombstone seen at one level will cover all keys
in the range at lower levels, there was a short-circuiting check in Get
that reported a key was not found at most one file after the range
tombstone was discovered. However, this was incorrect for merge
operands, since a deletion might only cover some merge operands,
which implies that the key should be found. This PR fixes this logic in
the Version portion of Get, and removes the logic from the MemTable
portion of Get, since the perforamnce benefit provided there is minimal.

Test Plan: TEST_TMPDIR=/dev/shm python tools/db_crashtest.py
blackbox --simple --delrangepercent=1 --delpercent=4
--write_buffer_size=1048576 --max_bytes_for_level_base=4194304
--target_file_size_base=1048576 --value_size_mult=33
--max_background_compactions=12 --max_key=10000000 --interval=30

Summary: Since a range tombstone seen at one level will cover all keys
in the range at lower levels, there was a short-circuiting check in Get
that reported a key was not found at most one file after the range
tombstone was discovered. However, this was incorrect for merge
operands, since a deletion might only cover some merge operands,
which implies that the key should be found. This PR fixes this logic in
the Version portion of Get, and removes the logic from the MemTable
portion of Get, since the perforamnce benefit provided there is minimal.

Test Plan: TEST_TMPDIR=/dev/shm python tools/db_crashtest.py
blackbox --simple --delrangepercent=1 --delpercent=4
--write_buffer_size=1048576 --max_bytes_for_level_base=4194304
--target_file_size_base=1048576 --value_size_mult=33
--max_background_compactions=12 --max_key=10000000 --interval=30
Copy link
Contributor

@ajkr ajkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks

@ajkr
Copy link
Contributor

ajkr commented Nov 20, 2018

can you update "HISTORY.md" bug fix section? We should backport this to 5.18 too after you land it.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhimadan is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhimadan is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhimadan is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@abhimadan abhimadan deleted the fix-cover-seq-shortcircuit branch November 20, 2018 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants