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

feat: SS Pruning Support #17726

Merged
merged 12 commits into from
Sep 26, 2023
Merged

feat: SS Pruning Support #17726

merged 12 commits into from
Sep 26, 2023

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Sep 13, 2023

Description

Closes: #17279

Implement pruning support for SS backends. The idea is that when an SS is provided to a RootStore, the RootStore will call Prune 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...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@alexanderbez alexanderbez marked this pull request as ready for review September 19, 2023 19:25
@alexanderbez alexanderbez requested a review from a team as a code owner September 19, 2023 19:25
@github-actions
Copy link
Contributor

@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
Copy link
Contributor

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)

Copy link
Contributor Author

@alexanderbez alexanderbez Sep 25, 2023

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 and Batch.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.
  • 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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

@alexanderbez alexanderbez merged commit d67e2a6 into feature/store-v2 Sep 26, 2023
46 of 49 checks passed
@alexanderbez alexanderbez deleted the bez/17279-ss-pruning branch September 26, 2023 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants