Add semi-sync monitor to unblock primaries blocked on semi-sync ACKs#17763
Merged
GuptaManan100 merged 28 commits intovitessio:mainfrom Feb 24, 2025
Merged
Add semi-sync monitor to unblock primaries blocked on semi-sync ACKs#17763GuptaManan100 merged 28 commits intovitessio:mainfrom
GuptaManan100 merged 28 commits intovitessio:mainfrom
Conversation
Signed-off-by: Manan Gupta <manan@planetscale.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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17763 +/- ##
==========================================
+ Coverage 67.41% 67.47% +0.06%
==========================================
Files 1592 1593 +1
Lines 258024 258498 +474
==========================================
+ Hits 173948 174430 +482
+ Misses 84076 84068 -8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Manan Gupta <manan@planetscale.com>
mattlord
reviewed
Feb 13, 2025
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…writes Signed-off-by: Manan Gupta <manan@planetscale.com>
…c is blocked on the primary Signed-off-by: Manan Gupta <manan@planetscale.com>
…d for too long and a add a few logs Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…ger to only start it when required Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
mattlord
reviewed
Feb 19, 2025
Member
mattlord
left a comment
There was a problem hiding this comment.
This is looking good! Just had some questions/comments. Let me know what you think.
deepthi
reviewed
Feb 19, 2025
deepthi
reviewed
Feb 19, 2025
deepthi
reviewed
Feb 19, 2025
deepthi
reviewed
Feb 19, 2025
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
mattlord
approved these changes
Feb 20, 2025
Member
mattlord
left a comment
There was a problem hiding this comment.
LGTM! I only had one minor suggestion. Nice work on this, @GuptaManan100 !
Signed-off-by: Manan Gupta <manan@planetscale.com>
Contributor
Author
|
Done, I've made that change too! 💕 |
deepthi
approved these changes
Feb 21, 2025
…nds value Signed-off-by: Manan Gupta <manan@planetscale.com>
5 tasks
This was referenced Nov 7, 2025
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 introduces a new component to the vttablet binary to monitor the semi-sync status of primary vttablets. We've observed cases where a brief network disruption can cause the primary to get stuck indefinitely waiting for semi-sync ACKs. In rare scenarios, this can block reparent operations and render the primary unresponsive. More information can be found in the issues #17709 and #17749.
To address this, the new component continuously monitors the semi-sync status. If the primary becomes stuck on semi-sync ACKs, it generates writes to unblock it. If this fails, VTOrc is notified of the issue and initiates an emergency reparent operation.
A metric for the number of outstanding writes from the semi-sync monitor has also been added. Unfortunately, it's not easy to reproduce the problem in an end-to-end test since it requires setting port forward rules (on Mac) or iptable changes (on Linux), both of which require sudo access. So I've added a test but that test doesn't run on CI. It can only be run locally and the password for the root user has to entered when prompted for it.
The semi-sync monitor is used such that the users who aren't running semi-sync, will not see the monitor open at all. It will only run when semi-sync on the primary is turned on.
Related Issue(s)
Checklist
Deployment Notes