Repository navigation
fix: don't cancel a started commit when retry_timeout expires - #11379
Conversation
Xuanwo
left a comment
There was a problem hiding this comment.
Thanks @vaibhavdabas16 — based on a source review only, the runtime fix looks right.
#11449 moved execute_with_retry to rust/lance-table-runtime/src/commit/retry.rs, so please rebase and port the change there.
For test coverage, we can also reuse #11378's paused-clock test with real manifest publication to verify both that a landed version is recognized despite a delayed return and that the execution-time timeout triggers as expected.
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
278e16a to
4938020
Compare
|
Thanks @Xuanwo. I rebased onto main and moved the fix to For the test, I adapted the paused-clock test from #11378 (credited in the commit).
I also updated the |
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Following the author’s update, the fix is now in the shared runtime, and the real-manifest regression verifies both late commit success and execution timeout. Checking the deadline before commit addresses #11374 without discarding a committed write’s result. A started commit may finish after retry_timeout, as the builder docs now state.
This overlaps the same fix in open #11378; please coordinate landing one of the two.
Fixes #11374.
execute_with_retrywrapped every commit after the first in the remainingretry_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 gotTooMuchWriteContentionfor 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:commit_transaction, which already verify an ambiguous outcome.execute_impland the backoff sleep keep their deadline, since cancelling them has no committed side effects.retry_timeoutdocs onUpdateBuilder,DeleteBuilderandMergeInsertBuildernow say a started commit finishes.Test:
test_retry_timeout_respects_commit_boundaryis 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, getsTooMuchWriteContention, 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 fmtpasses.lancecrate locally because of build resources on my machine.