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

Set default value of NumVersionsToKeep to 0 #1300

Closed
wants to merge 1 commit into from

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Apr 14, 2020

Issue #1228 showed that badger doesn't clean SST files even if all the keys are deleted. This is the expected behavior if NumVersionsToKeep is set to 1 but for the users this is counter-intuitive. When a key is deleted, it should be removed from the system. This PR fixes it.


This change is Reviewable

@ou05020
Copy link
Contributor

ou05020 commented Apr 14, 2020

@jarifibrahim Doesn't this enable infinite versions? lastValidVersion will never be true because numVersions will never be less than 1 when compared to NumVersionsToKeep. Without lastValidVersion=true the skipKey will never get set, allowing all versions of a key to get written.

https://github.com/dgraph-io/badger/blob/master/levels.go#L579-L580

@jarifibrahim
Copy link
Contributor Author

@ou05020 Yes. You are correct. I was looking at only the deleted entries and forgot how this would affect the valid entries. Thank you so much for looking at it :)

Closing this PR.

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