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

(cherry-pick) (release/v2.2007): fix(dropPrefix): check properly if the key is present in a table #1622

Closed
wants to merge 1 commit into from

Conversation

NamanJain8
Copy link
Contributor

@NamanJain8 NamanJain8 commented Dec 17, 2020

There may be a case when the table contains [0x0000,...., 0xffff]. If we are searching for k=0x0011, we should not directly infer that k is present. It may not be present. This leads to the triggering of compaction at the time of DropPrefix which is quite expensive.

This PR fixes the issue by confirming that case by searching inside the table for the prefix.


This change is Reviewable

Copy link
Contributor

@jarifibrahim jarifibrahim left a comment

Choose a reason for hiding this comment

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

Please add some tests

levels.go Outdated Show resolved Hide resolved
levels.go Show resolved Hide resolved
@NamanJain8 NamanJain8 changed the title fix(dropPrefix): check properly if the key is present in a table [DO NOT MERGE] (release/v2.2007): fix(dropPrefix): check properly if the key is present in a table Dec 21, 2020
There may be a case when the table contains [0x0000,...., 0xffff]. If we are searching for k=0x0011, we should not directly infer that k is present. It may not be present. This leads to the triggering of compaction at the time of DropPrefix which is quite expensive.

This PR fixes the issue by confirming that case by searching inside the table for the prefix.

(cherry picked from commit afaf022)
@NamanJain8 NamanJain8 force-pushed the naman/drop-prefix-fix branch from efad954 to 958056b Compare January 6, 2021 16:23
@NamanJain8 NamanJain8 changed the title [DO NOT MERGE] (release/v2.2007): fix(dropPrefix): check properly if the key is present in a table (cherry-pick) (release/v2.2007): fix(dropPrefix): check properly if the key is present in a table Jan 6, 2021
@NamanJain8
Copy link
Contributor Author

Closing this as this is not required in v2.2007. If needed we can cherry-pick it back.

@NamanJain8 NamanJain8 closed this Jan 7, 2021
@NamanJain8 NamanJain8 deleted the naman/drop-prefix-fix branch January 7, 2021 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants