Repository navigation
fix: let started commits finish after the retry timeout - #11378
Closed
lance-gatefixer[bot] wants to merge 2 commits into
Closed
lance-gatefixer[bot] wants to merge 2 commits into
lance-gatefixer[bot] wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Preserve the commit timeout fix in the shared table runtime and adapt the dataset regression tests to the generic retry executor.
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Awaiting a started commit's outcome fixes the false contention result described in #11374 while preserving the retry budget for execution and backoff. The shared-runtime port preserves this behavior for update, delete, and merge-insert.
vaibhavdabas16
added a commit
to vaibhavdabas16/lance
that referenced
this pull request
Nov 24, 2026
execute_with_retry wrapped each retried commit in the retry deadline. If the deadline fired after the manifest was written, the commit was dropped and the caller got TooMuchWriteContention for a write that had landed, so retrying a non-idempotent update applied it twice. Check the deadline before starting a commit instead, and let a started commit finish. Execution and backoff keep the deadline. The regression test is adapted from lance-format#11378's paused-clock test. Fixes lance-format#11374
Xuanwo
pushed a commit
that referenced
this pull request
Nov 24, 2026
Fixes #11374. `execute_with_retry` wrapped every commit after the first in the remaining `retry_timeout` (`maybe_timeout`). If the deadline fired after the new manifest had been stored but before the commit returned, the future was dropped. The caller then got `TooMuchWriteContention` for a write that had already landed. Retrying a non-idempotent update (`n = n + 1`) applied it twice. This takes the first fix suggested in the issue, in `lance-table-runtime/src/commit/retry.rs`, where #11449 moved the function: - The deadline is checked before an attempt's commit starts, never around it. A started commit runs to completion and its real result is returned. - The commit stays bounded by its own retry limits in `commit_transaction`, which already verify an ambiguous outcome. - `execute_impl` and the backoff sleep keep their deadline, since cancelling them has no committed side effects. - The `retry_timeout` docs on `UpdateBuilder`, `DeleteBuilder` and `MergeInsertBuilder` now say a started commit finishes. **Test:** `test_retry_timeout_respects_commit_boundary` is adapted from #11378's paused-clock test. It uses real manifest publication and covers two cases: - `after_commit`: the retry publishes a delete, then returns after the deadline. It is reported as a success and the version is visible. - `during_execution`: the retry stalls in execution past the deadline, gets `TooMuchWriteContention`, and nothing is committed. **Checks run locally:** - `cargo test -p lance-table-runtime --lib -- retry`: 11 passed. - `cargo test -p lance --lib -- write::retry merge_insert::tests::concurrency retry_timeout`: 34 passed. - `cargo fmt` passes. - I didn't run clippy for the `lance` crate locally because of build resources on my machine.
Member
|
Closing in favor of #11379, which merged the same fix and adapted the test from this PR. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a non-rebasable conflict,
execute_with_retrywrapped the commit future inmaybe_timeout. Expiring the retry deadline could drop that future after its manifest was published and reportTooMuchWriteContention, causing callers to retry a successful write.Check the retry budget before starting a retry's commit, then await its actual outcome. Execution and backoff retain their timeouts. Started commits may finish after
retry_timeout; the update, delete, and merge-insert builder docs now explain this behavior.The regression injects one conflict, commits a deletion across two fragments, and delays the response beyond the deadline. It reproduces the false failure on the original code and passes with the fix. A companion case checks that slow execution still times out before committing.
Validation:
cargo test -p lance --lib dataset::write::retry::tests— 2 passed.cargo test -p lance --lib -- test_update_concurrency test_update_same_row_concurrency test_delete_concurrency test_concurrent_delete_with_retries test_merge_insert_concurrency test_commit_retry_timeout_interrupts_conflict_backoff— 14 passed.cargo fmt --allcargo clippy --all --tests --benches -- -D warningsFixes #11374
Change walkthrough
flowchart TD A["Execute retry with timeout"] --> B{"Retry deadline expired?"} B -->|Yes| C["Return timeout"] B -->|No| D["Await commit outcome"] D -->|Success| E["Return success"] D -->|Retryable conflict| F["Check budget and backoff"] F --> AThe shared runtime lets a started commit finish after the retry budget expires.
Read: Retry deadline and commit boundary → Delayed commit regression.
Snapshot: 37f6299