-
Notifications
You must be signed in to change notification settings - Fork 2.4k
EmergencyReparentShard: skip zero-position candidates in errant GTID detection
#20831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
timvaillancourt
merged 8 commits into
vitessio:main
from
timvaillancourt:ers-empty-primary-errant-gtids
Aug 18, 2026
+512
−37
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f226553
EmergencyReparentShard: skip zero-position candidates in errant GTID …
timvaillancourt b8a6b51
`EmergencyReparentShard`: drop zero-position candidates before comput…
timvaillancourt 8af8950
`EmergencyReparentShard`: fail closed when GTID state was wiped on th…
timvaillancourt 56a00cc
`EmergencyReparentShard`: require topology agreement before treating …
timvaillancourt d589308
`EmergencyReparentShard`: only tolerate a missing reparent journal ta…
timvaillancourt 93de7f5
`EmergencyReparentShard`: drop the fail-closed release summary entry
timvaillancourt 6f9489c
`EmergencyReparentShard`: only tolerate a missing reparent journal ta…
timvaillancourt 5fce21d
`EmergencyReparentShard`: fix `gatherReparentJournalInfo` func name typo
timvaillancourt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the normal ERS path, this reruns errant-GTID detection only over the post-wait
validCandidates; the precedingfailedEvidenceloop preserves only non-zero GTID positions. If an all-zero-position tablet has_vt.reparent_journalrows but fails the relay-log wait while another zero-position peer succeeds, the failed tablet is deleted beforefindErrantGTIDsreads journals, so the survivor can be treated as a never-initialized shard and promoted even though reachable journal history proves a prior promotion. The new fail-closed rule needs to read/count zero-position failed waiters too, or fail closed before dropping them.AGENTS.md reference: go/vt/vtctl/reparentutil/AGENTS.md:L3-L5
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is real but very unlikely, so we're leaving it as-is. For a zero-position tablet to be a failed waiter, every candidate must be zero-position, and the never-initialized shortcut then only fires when the survivors' journals are empty and the shard record has no primary alias or term. Whatever promotion wrote the dropped tablet's journal rows also wrote the shard record, so reaching a promotion here additionally requires the topology to have been wiped or rebuilt. A tablet that fails its relay log wait is also indistinguishable from one that died seconds before ERS started, which would never have been a candidate at all: ERS can only weigh evidence from tablets that respond
On
mainthis scenario promotes unconditionally, since the all-zero shortcut fires before the journals or the topology are consulted, so this PR strictly narrows the hole rather than introducing it