-
Notifications
You must be signed in to change notification settings - Fork 402
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: Avoid leveled compaction crash when recovering from manifest #63
fix: Avoid leveled compaction crash when recovering from manifest #63
Conversation
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.
Thanks for the pull request and the fix! However, I really want the apply_compaction_result function keeps everything sorted, so that if we use that function, we always get a consistent state. I would rather opt in a design that apply_compaction_result
takes a parameter in_recovery
that controls whether to sort or not.
Or we can include the start/end key in the manifest, which is what most storage engines are doing. |
@skyzh Which option do you prefer? I'm happy to implement either. Looks to me that adding a |
Sounds good, let's have a recovery flag :) Take your time if you want to work on that, and feel free to ping me when you need review or help. |
- Don't sort the SSTs inside `apply_compaction_result` if in recovery
@skyzh Would you like to take another look? Thanks! |
Sorry it took a while and I'll probably take a look this weekend. This involves API changes and I might need to revisit the tutorial to ensure everything is consistent :) |
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.
Thanks for the fix!
Fixes #62
Below is what the test failure looks like on old version of the code:
apply_compaction_result
intotrigger_compaction