-
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: convertBoolToSemiSyncAction method to account for all semi sync actions #13075
Fix: convertBoolToSemiSyncAction method to account for all semi sync actions #13075
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
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.
Everything else LGTM!
} | ||
} else { | ||
if semiSync { | ||
return SemiSyncActionNone, errors.New("semi-sync plugins are not loaded.") |
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.
We should make this into a vterrors.VitessError
instead. That package has a lot of error definitions for Vitess errors not originating from MySQL. We should add one more there. The reason we do this is because we get the correct grpc code if we use those errors.
We should create something like this -
VT09013 = errorWithoutState("VT09013", vtrpcpb.Code_FAILED_PRECONDITION, "semi-sync plugins are not loaded", "Durability policy wants Vitess to use semi-sync, but the MySQL instances don't have the semi-sync plugin loaded")
and use that instead.
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.
Oooo good suggestion! I like it.
f872c96
to
977b7ab
Compare
…ctions Signed-off-by: William Lu <william.lu@shopify.com>
Signed-off-by: William Lu <william@tamedfox.ca>
977b7ab
to
7405874
Compare
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.
Love it!
Fix: convertBoolToSemiSyncAction method to account for all semi sync actions Signed-off-by: Brendan Dougherty <brendan.dougherty@shopify.com>
Fix: convertBoolToSemiSyncAction method to account for all semi sync actions Signed-off-by: Brendan Dougherty <brendan.dougherty@shopify.com>
We have a similar setup (semi sync is disabled, plugins are not loaded), and this bug prevents us from using |
…actions (vitessio#13075) * Fix convertBoolToSemiSyncAction method to account for all semi sync actions Signed-off-by: William Lu <william.lu@shopify.com> Signed-off-by: William Lu <william@tamedfox.ca>
…actions (vitessio#13075) * Fix convertBoolToSemiSyncAction method to account for all semi sync actions Signed-off-by: William Lu <william.lu@shopify.com> * Add VitessError VT09013 Signed-off-by: William Lu <william@tamedfox.ca> --------- Signed-off-by: William Lu <william.lu@shopify.com> Signed-off-by: William Lu <william@tamedfox.ca> Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
…actions (vitessio#13075) * Fix convertBoolToSemiSyncAction method to account for all semi sync actions Signed-off-by: William Lu <william.lu@shopify.com> Signed-off-by: William Lu <william@tamedfox.ca> Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Re-opening my PR under my own account, as I no longer have access to the Shopify/Vitess repo after being impacted by their layoffs.
This PR also fixes the two failing checks in the original PR.
Description
Fixes a bug where ChangeTabletType would fail on clusters that don't have rpl_semi_sync_master and rpl_semi_sync_slave plugins loaded. Does so by refactoring the convertBoolToSemiSyncAction method to return SemiSyncActionNone if the plugin is not loaded. To do this, we query the underlying mysql to check if the rpl_semi_sync_% variables are present.
This bug is only present from v15 onwards, so a backport might be in order to fix v15.
Related Issue(s)
Fixes #12869
Checklist
Deployment Notes