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? |
dba1f94 to
5aac0a2
Compare
|
Follow-up to the gatekeeper's non-blocking risk note (missing request-count coverage): added
This confirms the gatekeeper's numbers exactly (one-version lag: 6 speculative HEADs vs 4 with fixed batch-of-2) and bounds the trade-off: each batch caps at 64, so catch-up is O(log K) batches plus one terminal empty batch. Two benign behaviors surfaced and documented in the test (neither is a bug): the precise-hint baseline probes 2 successors where batch-of-1 would probe 1 — the intended round-trip/speculation trade — and the first missing version is HEAD-ed twice (once speculatively beside the tip, once leading the terminal empty batch), inherent to creation-anchored batches. No growth-policy change was made; the counts are now pinned, so any future adjustment (e.g. stopping growth after a partially filled batch) has a baseline to diff against. Validation: |
122b881 to
0ac131e
Compare
A batch that does not fill — partially or at all — has already probed past the tip, and versions are created gap-free: the misses above the highest hit rule out anything beyond. Stop there instead of growing on and ending the scan with a terminal empty batch that re-probes the gap. Successor HEADs per hint lag, pinned by cold_scan_successor_head_requests_by_hint_lag: | hint lag | was | now | |---|---|---| | precise | 2 | 2 | | 1 version | 6 | 2 | | 10 versions | 30 | 14 | | 100 versions | 190 | 126 | A one-version lag now costs the same 2 HEADs as a precise hint, and the duplicated first miss is gone — the narrow adjustment the gatekeeper flagged on lance-format#7929. A claim racing a live writer may adopt a tip one batch staler than before; the existing CAS retry absorbs that.
Count the successor HEADs a cold refresh_latest issues at each hint lag through a tallying ProxyObjectStore policy, so the adaptive batch growth trade-off (fewer round trips vs more speculative HEADs) is documented by executable assertions instead of prose: - precise hint: one empty batch of 2 -> 2 HEADs - one-version lag: 2 + empty 4 -> 6 HEADs (a fixed batch of 2 costs 4) - ten-version lag: 2 + 4 + 8 + empty 16 -> 30 HEADs - hundred-version lag: 2 + 4 + 8 + 16 + 32 + 64 + capped empty 64 -> 190 Measurement only; the growth policy itself is unchanged.
A batch that does not fill — partially or at all — has already probed past the tip, and versions are created gap-free: the misses above the highest hit rule out anything beyond. Stop there instead of growing on and ending the scan with a terminal empty batch that re-probes the gap. Successor HEADs per hint lag, pinned by cold_scan_successor_head_requests_by_hint_lag: | hint lag | was | now | |---|---|---| | precise | 2 | 2 | | 1 version | 6 | 2 | | 10 versions | 30 | 14 | | 100 versions | 190 | 126 | A one-version lag now costs the same 2 HEADs as a precise hint, and the duplicated first miss is gone — the narrow adjustment the gatekeeper flagged on lance-format#7929. A claim racing a live writer may adopt a tip one batch staler than before; the existing CAS retry absorbs that.
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Ending a cold scan on the first partially filled batch preserves gap-free manifest discovery while removing the terminal empty batch and duplicated first miss. The request-count cases pin 2, 2, 14, and 126 successor HEADs for precise, 1-, 10-, and 100-version hint lags, with concurrency capped at 64; stale mutation attempts remain protected by the existing version CAS/retry path.
Compared with fixed-size scanning, the adaptive policy keeps substantially fewer catch-up rounds while bounding speculation. The compatibility shims and the cold-path separation established by #8640 remain intact.
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.