-
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 PRS from being blocked because of misbehaving clients #15339
Fix PRS from being blocked because of misbehaving clients #15339
Conversation
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15339 +/- ##
==========================================
- Coverage 67.41% 65.42% -2.00%
==========================================
Files 1560 1562 +2
Lines 192752 193660 +908
==========================================
- Hits 129952 126701 -3251
- Misses 62800 66959 +4159 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
…prs-stuck Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
…prs-stuck Signed-off-by: Manan Gupta <[email protected]>
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.
overall looks good. Just unsure about setting the shutdown grace period
value to a low default.
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.
Release notes need editing. Rest LGTM
Signed-off-by: Manan Gupta <[email protected]>
Description
This PR fixes the problem described in #14760. If a client stops reading messages from a stream query, we can't really prevent vtgates from continuing to be blocked.
What we can do is unblock vttablets from getting stuck at demote primary calls if shutdown grace period has been specified.
The order of operations in vttablets are as follows when we call DemotePrimary -
In this PR, we are reworking this flow and making it so that we don't wait for the requests to be empty if we have killed all the queries against MySQL. This will unblock DemotePrimary and it is safe to do, because MySQL is guaranteed to be not running any queries.
This PR is a rework of #14761 with additional tests and refactoring to make the code more readable.
The default for the flag
shutdown_grace_period
has also been changed. The flag was introduced first in #2301 and has defaulted to 0 always. Changing the default allows Vitess clusters that start with default values to not block PRS on client errors.Related Issue(s)
Checklist
Deployment Notes