[rust] Add KvBatchScanner for full PK-table bucket scans#633
Conversation
9522a0f to
c421353
Compare
|
Rebased on top of updated #632. Verified against real Java Fluss 0.9.1-incubating and 1.0-SNAPSHOT-dev — all 4 new |
c421353 to
70c6746
Compare
|
Fixed compilation of C++ and Elixir bindings:
Also applied All branches rebased onto latest main. |
74e5861 to
a270bd9
Compare
- Replace raw SERVER_TAG_TEMPORARY_OFFLINE const with ServerTag::TemporaryOffline - Add readable parameter to get_lake_snapshot call Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass `None` for the new `comment` parameter to keep round-2 reviewer-fix commits self-contained on each PR branch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
After round 2's ClusterHealthStatus enum change, the variant is already validated by try_from_i32 on deserialisation, making the `>= 0` check redundant. Removing it also fixes a fluss_v1-feature-only compile error (comparing enum with integer). The remaining `.expect()` still proves the call succeeded. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Introduce a stateful, unbounded KV-table scanner using the ScanKv API (1061). The first next_batch() opens the server-side cursor; subsequent calls iterate; dropping the scanner sends a best-effort close. - client/table/kv_batch_scanner.rs: KvBatchScanner with per-bucket state machine (Pending -> Active -> Done), best-effort close on Drop, and retry-with-backoff on retriable server errors (leader-election races, TooManyScanners, etc.) — not just TooManyScanners. - client/table/scanner.rs: TableScan::create_kv_batch_scanner() with PK/bucket validation. - config.rs: scanner_kv_fetch_max_bytes (default 4MB, matching Java). - rpc/fluss_api_error.rs: new error codes 66-69 (ScannerExpiredException, UnknownScannerIdException, InvalidScanRequestException, TooManyScanners) with correct retriable classification. - batch_scanner.rs: expose KV decode helpers (pub(super)) for reuse. - tests: 4 KV integration tests; tolerate UnsupportedVersion so they also pass (no-op) against 0.9.x servers that lack ScanKv.
- C++ binding: add scanner_kv_fetch_max_bytes field to FfiConfig and header - Elixir binding: add match arms for 4 new FlussError variants (ScannerExpiredException, UnknownScannerIdException, InvalidScanRequestException, TooManyScanners) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
a270bd9 to
3ad8322
Compare
|
Also rebased #633 onto main — stack is clean. |
|
@gnuhpc Thank you, can you please move this PR to fluss repo under fluss-rust folder? |
What
Introduces a stateful, unbounded KV-table scanner using the ScanKv API (1061). The first
next_batch()opens the server-side cursor; subsequent calls iterate; dropping the scanner sends a best-effort close.client/table/kv_batch_scanner.rs:KvBatchScannerwith a per-bucket state machine (Pending → Active → Done), best-effort close onDrop, and retry-with-backoff on any retriable server error (leader-election races on a freshly created bucket, transientTooManyScanners, …) — not justTooManyScanners.client/table/scanner.rs:TableScan::create_kv_batch_scanner()with PK / bucket-range validation.config.rs:scanner_kv_fetch_max_bytes(default 4 MB, matching JavaCLIENT_SCANNER_KV_FETCH_MAX_BYTES).rpc/fluss_api_error.rs: new error codes 66–69 (ScannerExpiredException,UnknownScannerIdException,InvalidScanRequestException,TooManyScanners) with correct retriable classification.client/table/batch_scanner.rs: expose the KV decode helpers (pub(super)) for reuse by the new scanner.tests/integration/batch_scanner.rs: 4 KV integration tests; they tolerateUnsupportedVersionso they also pass (as no-ops) against 0.9.x servers that lack ScanKv.Verification
Built +
cargo clippyclean;cargo fmtclean. Integration suite against a real Fluss 1.x cluster: 70/72 pass. The only 2 failures are the SASL negative auth tests (test_sasl_connect_with_wrong_password,test_sasl_connect_with_unknown_user) — these fail because the test docker image does not enforce SASL auth (verified: valid/wrong/unknown credentials all connect). The Rust client's SASL handshake is correct (sendsAuthenticateRequest, retriesRetriableAuthenticateException, propagates non-retriable); Fluss's own reference testSaslAuthenticationITCasewith identical config does reject bad credentials. So this is a test-image/server packaging issue, not an SDK defect.Stack
Part 6/6 (final), stacked on #632 → … → #628. All target
main.🤖 Generated with Claude Code