Skip to content

iterator: reset bounds and reseek ordinary iterators - #863

Closed
jwc1love wants to merge 3 commits into
tikv:masterfrom
jwc1love:iterator/reset-bounds-and-seek
Closed

jwc1love wants to merge 3 commits into
tikv:masterfrom
jwc1love:iterator/reset-bounds-and-seek

Conversation

@jwc1love

Copy link
Copy Markdown

Enable iterator reuse across bounded scan ranges for tikv/tikv#4239. DBIterator::reset_bounds_and_seek replaces owned bounds and performs a hard forward or reverse seek while retaining the iterator snapshot and other read options. It returns None without mutation for unsupported configurations and Some(false) for a supported empty result.

Titan, tailing, and missing/empty-bound configurations reject reset before mutation. The caller must continue to honor the column-family comparator and prefix constraints; the TiKV integration rejects prefix-seek reuse. No native ABI or RocksDB submodule change is required.

Validation: 7 new reset tests and 7 existing iterator tests passed, compiled from the original test source through a focused normal-Cargo target in the TiKV workspace. Coverage includes both directions, EOF and empty ranges, snapshot retention, owned bound storage, column families, L0 SST generations with tombstones, and compaction into L1 before revisiting ranges. Formatting checks passed. The complete wrapper suite and platform matrix have not been run.

Draft for API/native-bound review and full CI. The dependent TiKV change retains safe fresh-scanner fallback and has separate MVCC/coprocessor/region tests.

Keep owned bound slices stable when resetting an ordinary RocksDB iterator. Refuse tailing, Titan, and originally unbounded iterators without changing them.

Signed-off-by: jwc1love <jwc20050401@gmail.com>
Cover forward and reverse resets, empty ranges, EOF, owned bounds, column families, snapshot visibility, point/range tombstones, and unsupported tailing/Titan cases.

Signed-off-by: jwc1love <jwc20050401@gmail.com>
Assert SSTs moved from L0 to L1 and compare repeated forward/reverse reseeks against fresh iterators, including returns to earlier ranges.

Signed-off-by: jwc1love <jwc20050401@gmail.com>
@ti-chi-bot ti-chi-bot Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has signed the dco. labels Oct 15, 2026
@ti-chi-bot

ti-chi-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign niedhui for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot ti-chi-bot Bot added contribution This PR is from a community contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Oct 15, 2026
@ti-chi-bot

ti-chi-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

Hi @jwc1love. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot Bot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Oct 15, 2026
@ti-chi-bot

ti-chi-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

Welcome @jwc1love!

It looks like this is your first PR to tikv/rust-rocksdb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to tikv/rust-rocksdb. 😃

@ti-chi-bot ti-chi-bot Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 15, 2026
@jwc1love jwc1love closed this Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant