fix: fix an issue where the compactor causes previously deleted data to reappear#2278
Open
yangchun0821 wants to merge 4 commits into
Open
Conversation
afe6ba7 to
b1429b4
Compare
shiva-istari
requested changes
Jun 23, 2026
shiva-istari
left a comment
Contributor
There was a problem hiding this comment.
Hi @yangchun0821
Thanks for the PR and the description!
The current TestLevelTargets sub-tests only assert which baseLevel is chosen they don't verify what actually happens to the data. Could you add tests that set up the full compaction scenario and assert the
deleted key stays gone? These tests should fail on main (old code routes tombstone to wrong level, key reappears) and pass on this branch (fix routes tombstone correctly, key stays gone).
Author
|
@shiva-istari |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
During Level 0 compaction, the engine may skip intermediate levels and compact Level 0 tables directly to the bottommost level. This can leave stale data in the skipped intermediate levels. As a result, previously deleted keys may reappear from the user's perspective after compaction completes.
Checklist