Skip to content

[rust] Support KvScan in Rust client - #4201

Open
naivedogger wants to merge 2 commits into
apache:mainfrom
naivedogger:feature/rust-client-kv-scan
Open

[rust] Support KvScan in Rust client#4201
naivedogger wants to merge 2 commits into
apache:mainfrom
naivedogger:feature/rust-client-kv-scan

Conversation

@naivedogger

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3294

This PR adds KvScan support to the Rust client, bringing it in line with the existing server-side and Java client semantics. It allows users to scan the merged current state of a primary-key table, instead of consuming its changelog.

Brief change log

  • Add bucket-level and whole-table KV scanners for reading the current state of primary-key tables.
  • Implement the ScanKv lifecycle, including continuation requests, timeout-safe polling, resource cleanup, and error handling.
  • Support partitioned tables, schema evolution, client-side projection, and configurable fetch size.
  • Add unit tests, integration tests, and Rust client documentation.

Tests

API and Format

This PR adds the following public Rust APIs:

  • TableScan::create_bucket_kv_scanner
  • TableScan::create_kv_scanner
  • KvBatchScanner
  • KvSnapshotScanner
  • KvBatchReadOutcome
  • Config::scanner_kv_fetch_max_bytes

No storage format or RPC protocol changes are introduced. The implementation uses the existing ScanKv RPC and KV value record format.

Documentation

Updated the Rust API reference and primary-key table guide with full KV scan configuration, semantics, limitations, and examples.

…dling

- Add KvBatchScanner with ScanKv RPC continuation protocol for paginated
  full-bucket scans with snapshot isolation
- Add scanner error handling for TooManyScanners, NotLeaderOrFollower,
  ScannerExpired and UnknownScannerId with retry/backoff
- Add config options for KV scan batch size
- Add FlussApiError variants for scanner-related errors
- Update C++ and Elixir bindings to reflect new APIs
- Add integration tests for batch scanner scenarios
@naivedogger
naivedogger force-pushed the feature/rust-client-kv-scan branch from 3dd52cd to f653fab Compare September 3, 2026 02:08
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.

[Rust] Extend the Rust Client to support KvScan

1 participant