-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: SS Pruning Support #17726
feat: SS Pruning Support #17726
Conversation
@alexanderbez your pull request is missing a changelog! |
// Prune attempts to prune all versions up to and including the provided | ||
// version argument. The operation should be idempotent. An error should be | ||
// returned upon failure. | ||
Prune(version uint64) error |
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.
I'd like to pass the pruning option to the dedicated db, instead of the exposed endpoint.
- avoid the conflicts with sync
- it would be easy to apply pruning at the dedicated backend, (background running)
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 problem with making it entirely be the SS engine's responsibility, is when do you prune? The SS interface is just a CRUD API -- there's no notion of "committing".
So when the RootStore commits, how/when does the backing SS store know what/when to prune? You'd need to either do it:
- On every
Put
andBatch.Write
call- Note, doing it on
Batch.Write
would be essentially analogous to doing it on commitment, but the abstraction seems pretty messy to me personally.
- Note, doing it on
- Or, have some sort of external goroutine process in the SS impl that periodically checks and prunes.
So there's tradeoffs to each, but to me having the RootStore simply call Prune
on the SS backend seems the cleanest.
Thoughts @tac0turtle or @kocubinski?
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.
tbh, I have no exact idea how the sync flow looks like but the original store has snapshot and pruning managers and do some duplicated checks like version conflicting. so I'd like to pass this logic to the dedicated backend and maybe can manage it in background routine or whatever the dedicated backend wants
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.
That introduces additional complexity and goroutine management, but I can add that to the design doc and we'll discuss next meeting.
Description
Closes: #17279
Implement pruning support for SS backends. The idea is that when an SS is provided to a
RootStore
, theRootStore
will callPrune
on the SS backend when appropriate.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change