-
Notifications
You must be signed in to change notification settings - Fork 22
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
Use ExecutedGtidSet and RetrievedGtidSet when determining the primary #474
Conversation
43800f8
to
e9fbdc7
Compare
f37231f
to
872db1a
Compare
…the primary Signed-off-by: d-kuro <kurosawa7620@gmail.com>
872db1a
to
c986a40
Compare
Signed-off-by: d-kuro <kurosawa7620@gmail.com>
if err != nil { | ||
return err | ||
} | ||
if currentPrimaryIndex == cluster.Status.CurrentPrimaryIndex { |
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.
The value of currentPrimaryIndex
is out of date here.
Could you update currentPrimaryIndex
after line 104?
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.
Thank you for the review. I fixed the issue as it was not correctly evaluating. Thank you again.
Signed-off-by: d-kuro <kurosawa7620@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
refs: #370
Use Executed_Gtid_Set and Retrieved_Gtid_Set when determining the primary.
Previously, only Retrieved_Gtid_Set was used to select the primary.
However, there are cases where Retrieved_Gtid_Set is empty immediately after replication starts if there are no new transactions.
Therefore, change to also use ExecutedGtidSet for finding primary.
Steps