-
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
Replication: Have the DB flavor process waiting for a pos #14745
Conversation
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
|
0527c5e
to
5e445fd
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
5e445fd
to
6aff9d0
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
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.
LGTM!
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.
Better isolation this way so that's good!
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.
Looks good. Thank you for this fix!
…4745) Signed-off-by: Matt Lord <mattalord@gmail.com>
Description
The different database flavors use different SQL functions in order to perform the generic "wait for the replica to reach this position" functionality — and each function has different semantics for what it returns and what those return values mean.
We have previously only asked the flavor interface to provide the command/query (which leveraged the flavor's specific SQL function) to use and then executed the provided query and processed the results at a higher level such as the
mysqlctl
package — where the specifics of the flavor implementation's SQL function were not known. Prior to moving to the newerWAIT_UNTIL_SQL_THREAD_AFTER_GTIDS()
SQL function for GTID based MySQL replication in #14612, the differences were not significant enough that they caused known problems using this method.However, the return values on timeout from WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS and WAIT_FOR_EXECUTED_GTID_SET are not the same. The old one returns -1, whereas the new one returns 1. This was causing us to assume that WaitForSourcePos was successful when in fact it had timed out, leading to #14738.
When we tried to fix this in #14739, it proved problematic to try and process the results outside of the flavor implementation given the semantic differences. This PR moves the handling/processing of the
WaitForPos
functionality down into the flavor interface (as much of the other functionality is, e.g.status
), and eliminates the need to make any assumptions about return values in the calling function.Related Issue(s)
WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS
#14611Checklist
EDIT Dec 11, 2023: Folded in context from previous PR #14739 so that this PR has the full story.