Skip to content

fix(tae): stop WAL append retries on replay cancellation - #33032

Closed
MatrixAdventurer wants to merge 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:agent/lw-wal-append-cancel-20261121
Closed

MatrixAdventurer wants to merge 2 commits into
matrixorigin:mainfrom
MatrixAdventurer:agent/lw-wal-append-cancel-20261121

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes

Fixes #32912

What this PR does / why we need it

wrappedClient.Append previously ignored cancellation while sleeping between failed LogService append attempts. TN WAL replay cancellation could therefore continue retrying until the configured retry budget expired.

This change checks the parent context before each attempt and after failures, and replaces the unconditional retry sleep with a context-aware timer. Successful appends still win if cancellation races with a successful backend return.

Testing

  • Regression-first evidence is recorded on [Bug]: TN WAL replay skip Append ignores canceled context during retry backoff #32912: the cancellation test failed before the production change, reporting four attempts and 1.4s of simulated elapsed time.
  • go test -race ./pkg/vm/engine/tae/logstore/driver/logservicedriver -run '^TestAppend(CancellationDuringBackoff|RetriesWithLiveParent)$' -count=20
  • Independent review repeated the focused race tests 100 times.
  • go test -race ./pkg/vm/engine/tae/logstore/driver/logservicedriver -count=1
  • git diff --check

Independent review on latest main a5140aa: APPROVE, no blocking findings.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is closed, so it cannot be queued. Reopen it to get the box back.

This branch was successfully deployed

No deployments
ci — 79115e62 Deployed Nov 21, 2026 by MatrixAdventurer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TN WAL replay skip Append ignores canceled context during retry backoff

3 participants