-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix errant GTID detection in VTOrc to also work with a replica not connected to any primary #17267
Merged
Conversation
This file contains 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
Signed-off-by: Manan Gupta <[email protected]>
…re the replica is not connected to any primary Signed-off-by: Manan Gupta <[email protected]>
GuptaManan100
added
Type: Bug
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
Component: VTorc
Vitess Orchestrator integration
labels
Nov 21, 2024
GuptaManan100
requested review from
deepthi,
shlomi-noach and
timvaillancourt
as code owners
November 21, 2024 06:35
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
|
vitess-bot
bot
added
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
NeedsWebsiteDocsUpdate
What it says
labels
Nov 21, 2024
GuptaManan100
removed
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsWebsiteDocsUpdate
What it says
NeedsIssue
A linked issue is missing for this Pull Request
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
labels
Nov 21, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17267 +/- ##
==========================================
+ Coverage 67.37% 67.39% +0.02%
==========================================
Files 1573 1573
Lines 253110 253126 +16
==========================================
+ Hits 170535 170598 +63
+ Misses 82575 82528 -47 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
deepthi
approved these changes
Nov 24, 2024
shlomi-noach
approved these changes
Nov 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: VTorc
Vitess Orchestrator integration
Type: Bug
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
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
As pointed out in #17254, there is a case where VTOrc is unable to detect errant GTIDs on a tablet that got demoted.
The underlying cause of the problem was that VTOrc was not running errant GTID detection for tablets that weren't connected to any primary. Previously it would fix the replication on the tablet first and then run errant GTID detection eventually to figure out if it had errant GTIDs. However, ever since we made the vttablets also run errant GTID detection on reparent (#16833), VTOrc is unsuccessful in reparenting the tablet with errant GTIDs since the vttablets fail with an error.
The fix is to augment VTOrc to run errant GTID detection with the primary tablet that it would reparent the replica to. There is only one special case that we need to handle which is that of the new primary's information not being advanced enough. Since VTOrc gathers information in a polling fashion, it is possible that the shard record in its data store points to the new primary, but the data collected from the new primary is older than when the promotion happened. If we use this information for errant GTID detection, we will end up marking the wrong GTIDs as errant. This situation is, however, easy to detect. We do so by checking if the primary's record has a source of its own or not. If it doesn't then the information has to have been gathered after it was promoted.
Related Issue(s)
Checklist
Deployment Notes