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.
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
feat: db compaction cmd #4329
feat: db compaction cmd #4329
Changes from 17 commits
ba49f9f
67b76dc
bdaeafc
b573d24
2e8f48c
9a604b0
73c9841
2ef1a71
b9f308f
f8adc4b
906d9ac
703d768
7a07112
87500b0
af57050
89c4d8e
4f8414a
733b8fc
d2a737e
bdaf9b7
3c856f2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
should this defer not come before the NewRecovery call?
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.
You can use the new
slices.SortFunc()
instead.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.
you need to make sure
end
is always set to a used slot otherwise you end up with suboptimal truncation:imagine
after the first move at
start = 7; end = 9
, the loop terminates atstart = 8; end = 8
instead ofend = 7
i suggest:
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.
We still need to listen for this context cancellation if you are thinking of doing a clean cancellation of this command.
If we dont the wait will just wait till all the routines are done. Not sure if this is expected. If yes we should clearly mention in the doc that users should not cancel the command.
Instead of this, I think it might be better to have the validate as a separate command. Users can run it before/after or anytime they feel there is some issue. Also we can add some good messages regarding the inconsistencies so maybe we can take some actions.
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.
the main purpose of the validation is to test the compaction feature and it will be off by default.
i will make the fixes for better ctx handling
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.
What I meant is validation could be useful as a command in itself. To identify if there are inconsistencies in the localstore. So in this case users can run it separately if ever needed.
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.
you ignoring the errors then you should not use errgroup but waitgroup