Skip to content

fix: don't cancel a started commit when retry_timeout expires - #11379

Merged
Xuanwo merged 1 commit into
lance-format:mainfrom
vaibhavdabas16:fix/11374-retry-timeout-commit
Nov 24, 2026
Merged

Xuanwo merged 1 commit into
lance-format:mainfrom
vaibhavdabas16:fix/11374-retry-timeout-commit

Conversation

@vaibhavdabas16

@vaibhavdabas16 vaibhavdabas16 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the bug Something isn't working label Nov 23, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 23, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@vaibhavdabas16
vaibhavdabas16 force-pushed the fix/11374-retry-timeout-commit branch from 278e16a to 4938020 Compare November 24, 2026 22:15
@vaibhavdabas16

Copy link
Copy Markdown
Contributor Author

Thanks @Xuanwo. I rebased onto main and moved the fix to rust/lance-table-runtime/src/commit/retry.rs (4938020).

For the test, I adapted the paused-clock test from #11378 (credited in the commit). test_retry_timeout_respects_commit_boundary now covers both cases with real manifest publication:

  • A commit that lands and then returns after the deadline is reported as a success.
  • An attempt still executing past the deadline gets TooMuchWriteContention and commits nothing.

I also updated the retry_timeout docs on the update, delete and merge_insert builders to say a started commit finishes.

@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 24, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 24, 2026
@Xuanwo
Xuanwo merged commit d22526d into lance-format:main Nov 24, 2026
47 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: update / delete / merge_insert can raise TooMuchWriteContention after their commit has landed (retry_timeout cancels the commit future)

2 participants