feat(mem-wal): adapt manifest scan concurrency - #7929
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change rejects zero ChangesManifest scan validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Note
Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.
🟡 Other comments (2)
rust/lance/src/dataset/mem_wal/write.rs-6130-6149 (1)
6130-6149: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winAssert that rejected open leaves no manifest or epoch side effects.
The PR objective requires validation before claiming the shard, but this test only checks the returned error. A future regression that claims an epoch before validating would still pass. Reuse the store after the failed open and assert that
read_latest()returnsNone.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rust/lance/src/dataset/mem_wal/write.rs` around lines 6130 - 6149, Extend test_open_rejects_zero_manifest_scan_batch_size to reuse the store after the rejected ShardWriter::open and assert that read_latest() returns None, verifying validation leaves no manifest or epoch side effects while preserving the existing error assertions.rust/lance/src/dataset/mem_wal/manifest.rs-697-699 (1)
697-699: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAssert that the stale hint was actually persisted.
write_version_hintis best-effort and returns no error, so this call can fail silently; the test would still pass because zero is rejected regardless of the hint. Verify the fixture before constructing the zero-batch reader.Suggested test assertion
manifest_store.write_version_hint(1).await; +assert_eq!(manifest_store.read_version_hint().await, Some(1));🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rust/lance/src/dataset/mem_wal/manifest.rs` around lines 697 - 699, Update the test around ShardManifestStore::write_version_hint to verify that version hint 1 was persisted before constructing the zero-batch reader. Read or inspect the manifest store’s persisted hint using the existing fixture/assertion mechanism, and assert it equals 1 so the test cannot pass solely because the zero-batch reader rejects zero.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust/lance/src/dataset/mem_wal/write.rs`:
- Around line 134-139: Complete the documentation for the public field
manifest_scan_batch_size and its builder method with a synchronized example
using ShardWriterConfig::new(...) followed by
with_manifest_scan_batch_size(...), keeping the example aligned with the actual
signatures. Add cross-links between the field and method, and preserve the
documented greater-than-zero constraint.
---
Other comments:
In `@rust/lance/src/dataset/mem_wal/manifest.rs`:
- Around line 697-699: Update the test around
ShardManifestStore::write_version_hint to verify that version hint 1 was
persisted before constructing the zero-batch reader. Read or inspect the
manifest store’s persisted hint using the existing fixture/assertion mechanism,
and assert it equals 1 so the test cannot pass solely because the zero-batch
reader rejects zero.
In `@rust/lance/src/dataset/mem_wal/write.rs`:
- Around line 6130-6149: Extend test_open_rejects_zero_manifest_scan_batch_size
to reuse the store after the rejected ShardWriter::open and assert that
read_latest() returns None, verifying validation leaves no manifest or epoch
side effects while preserving the existing error assertions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: QUIET
Plan: Pro Plus
Run ID: 65160c7f-2148-41f5-81ba-6346f6051df5
📒 Files selected for processing (2)
rust/lance/src/dataset/mem_wal/manifest.rsrust/lance/src/dataset/mem_wal/write.rs
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
d4391fc to
00f53d5
Compare
hamersaw
left a comment
There was a problem hiding this comment.
I think rather than validating the configuration on this, we should remove it all together. Users are not going to update this because it's such a nuanced configuration option. Instead, we should update the batch size to be exponential with lower and upper bounds, for example the first check is 2, then 4, then 8, then 16 (maybe up to 64?). This way we get the best performance possible.
|
That makes sense. I will remove One compatibility detail: this removes a public |
07c46a2 to
e9e770f
Compare
3bceb71 to
8380833
Compare
8380833 to
19d2283
Compare
|
@hamersaw I rebased this PR onto the latest Local validation completed successfully:
Could you please take another look and approve if this now addresses your requested changes? |
4073a4b to
ae6753e
Compare
|
Rebased onto latest main and resolved the conflict with #8640: the store keeps the @hamersaw your CHANGES_REQUESTED direction — drop the user-facing knob, grow internally 2→64 — is what this PR now implements. Could you take another look? |
|
The remaining CI failures here are tracked in #8789 — systematic main-level test failures (not caused by this PR). Will retrigger once main's own CI recovers. |
|
@Xuanwo could you help review this when you have a moment? This implements exactly what the CHANGES_REQUESTED asked for — drop the user-facing batch-size knob and grow the manifest scan internally (2→64 adaptive). It's rebased onto current main: conflicts with #8640 resolved (the adaptive policy now applies to the remaining cold-scan/claim paths), deprecations dated to 12.0.0, and the only CI failures are the tracked fleet flakes from #8789. hamersaw hasn't responded since 2026-07-27 despite re-requests, so a fresh review would be much appreciated. |
d8fcb73 to
dba1f94
Compare
There was a problem hiding this comment.
The internal policy removes the zero-batch stale-manifest path while preserving the gap-free/CAS position contract from #8640 and retaining the Rust, Python, and Java compatibility shims.
Cold scans with a stale hint trade fewer sequential round trips for more speculative HEADs: a one-version lag performs six successor HEADs instead of four with a fixed batch of two. The 64-concurrent-request cap bounds each batch, but no request-count/latency benchmark covers this trade-off. Follow-up request-count coverage could determine whether growth should stop after a partially filled batch.
Summary
Fixes #7928.
Test Plan
cargo test -p lance dataset::mem_wal::manifest::tests --lib -- --nocapturecargo check -p lance --tests --benchescargo clippy --all --tests --benches -- -D warningscargo test -p lance --doc ShardManifestStorecargo clippy --tests --manifest-path java/lance-jni/Cargo.toml -- -D warningscd java && ./mvnw spotless:checkcd java && ./mvnw testcd python && uv run make buildcd python && uv run make lintRelationship to #8640
#8640 eliminated hot-path manifest scans by serving position from the writing store. This PR optimizes what remains: the cold-scan paths (stale-hint catch-up and claim), where the adaptive 2→64 batch growth cuts catch-up round trips from O(K/2) to O(log K)+O(K/64). Precise-hint reads issue the same requests as before.