-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unbounded disk growth when lots of additions and deletions of keys #1158
Comments
@jarifibrahim @manishrjain Sanity check, if I have MaxVersions=1, Flatten the LSM into one level and then stream out the keys. I can safely ignore the ones that are tombstoned because there will only be one version of the key in the LSM correct? EDIT: Okay, no I think the above logic is incorrect. The Flatten will move all the versions into the same level, but not deduplicate them. AFAIK, the only way to remove the keys is a logical DB rewrite |
@connorgorman How about using the stream framework to stream out the keys. You can ignore all versions after the first one. That should give you unique versions. You can set the key to list function in stream framework to just use the first version it receives. Lines 58 to 67 in 1b0c074
Flatten wouldn't remove the old keys because it only brings all the tables to the same level. Compaction, however, will remove those keys eventually. Lines 559 to 584 in 1b0c074
|
Hey @connorgorman, we've made some changes in #1166 which would drop invalid keys sooner now. Please try it out. I'm closing this issue because I don't think there's anything to be done here. Feel free to reopen. |
What version of Go are you using (
go version
)?What version of Badger are you using?
1.6 with backports
Does this issue reproduce with the latest master?
AFAIK, no change has fixed this
What are the hardware specifications of the machine (RAM, OS, Disk)?
Not applicable for this question
What did you do?
Wrote millions of keys and values and then deleted all of them
What did you expect to see?
I would expect there to be some way to remove tombstoned keys that are no longer referenced (especially when the MaxVersions =1 ). I know that this is challenging online due to the way that compaction works, but is there a way to delete the keys if I Flatten the LSM tree offline? I thought that Backup/Restore may fix the issue, but that was unsuccessful as well
What did you see instead?
Unbounded disk and SST growth based on the number of unique keys written
The text was updated successfully, but these errors were encountered: