e2e: fix race in TestFailingReplication#19547
Merged
timvaillancourt merged 1 commit intovitessio:mainfrom Mar 3, 2026
Merged
Conversation
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
nickvanw
approved these changes
Mar 3, 2026
mhamza15
approved these changes
Mar 3, 2026
vitess-bot bot
added a commit
that referenced
this pull request
Mar 3, 2026
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
timvaillancourt
pushed a commit
that referenced
this pull request
Mar 3, 2026
…19548) Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
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.
Description
This PR fixes a race condition in the
vtbackupe2e test that causesTestFailingReplication(and other tests usingprepareCluster()) to hang in CI.The problem
prepareCluster()callsrestore(), which returns as soon as the vttablet HTTP endpoint responds. ButRestoreDatacontinues running in the background holding theactionSema— a weight-1 semaphore. The next call,SetWritable, also needs theactionSema, so it blocks waiting for the restore to finish.This race has always existed on all branches, but became a consistent failure on
mainandrelease-23.0because MySQL 8.4 restores take longer than MySQL 8.0, widening the race window enough thatSetWritablefires beforeRestoreDatacompletes. In CI this causes a 19+ minute hang followed by a timeout.The fix
Adds a
waitForRestoreComplete()helper betweenrestore()andSetWritablethat polls the tablet type via/debug/vars, waiting for thereplica → restore → replicatransition that signalsRestoreDatahas finished and released the semaphore.Related Issue(s)
Checklist
Deployment Notes
AI Disclosure
Fix found by Claude while debugging flakiness on PR #19472