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

[indexer-alt] Fix comments in pruner to #20740

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lxfind
Copy link
Contributor

@lxfind lxfind commented Dec 26, 2024

Description

Clarified in the doc comment for prune that to should be exclusive instead of inclusive.
Also updated the prune loop to make it clearer.

Test plan

We probably want to write some tests.

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

Copy link

vercel bot commented Dec 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 27, 2024 1:09am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 27, 2024 1:09am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 27, 2024 1:09am
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Dec 27, 2024 1:09am

@lxfind lxfind requested review from amnn and wlmyng December 26, 2024 23:10
@lxfind lxfind temporarily deployed to sui-typescript-aws-kms-test-env December 26, 2024 23:10 — with GitHub Actions Inactive
@lxfind lxfind requested a review from emmazzz December 26, 2024 23:10
Copy link
Contributor

@wlmyng wlmyng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this really is a bug that needs fixing though

When pruning, we operate on [from, to), and then update watermark.pruner_hi = to, so the next chunk starts exactly where we left off. We also have a wait period in the earlier lines (2) so that we don't prune until straggling reads have largely finished

and the half-open intervals help avoid potential off-by-one errors and other confusion around pruning and read boundaries

We could instead adjust the doc comment on prune() in the Handler trait to reflect that to should be exclusive

@lxfind
Copy link
Contributor Author

lxfind commented Dec 27, 2024

Sounds good. Updated comments instead.

@lxfind lxfind changed the title [indexer-alt] Fix a bug in pruner to [indexer-alt] Fix comments in pruner to Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants