Skip to content
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 PRS in Vtorc for electing new primary #9409

Merged
merged 16 commits into from
Jan 6, 2022

Conversation

GuptaManan100
Copy link
Member

Description

This PR changes the implementation of electNewPrimary to use PlannedReparentShard instead of having its own codepath. It also changes some checks in PlannedReparentShard to allow calling it with no new primary specified even for initialisation. No new end to end test has been added for this since there is already extensive coverage in the vtorc's tests which rely on electNewPrimary (PlannedReparentShard) to initialise the cluster.

Related Issue(s)

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

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>
…tion is needed to not spawn incorrect failovers

Signed-off-by: Manan Gupta <manan@planetscale.com>
@GuptaManan100 GuptaManan100 added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: VTorc Vitess Orchestrator integration release notes labels Dec 17, 2021
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
…thout specifying a new primary

Signed-off-by: Manan Gupta <manan@planetscale.com>
…replication status

Signed-off-by: Manan Gupta <manan@planetscale.com>
…derlying contains interface doesn't

Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
@GuptaManan100
Copy link
Member Author

GuptaManan100 commented Dec 17, 2021

The implementation of the AtLeast method on Position has also been fixed after I found the bug via a unit test that I was adding that compared a nil position with a non-nil one. In this case, we should say that the non-nil position is at least as advanced as the nil one. On further investigation it turned out that the underlying function call to Contains does not handle nil case correctly as changed in 031e3a3. So nils have to be handled at a level above that function call.

Signed-off-by: Manan Gupta <manan@planetscale.com>
go/mysql/replication_position.go Outdated Show resolved Hide resolved
go/vt/orchestrator/inst/analysis_dao.go Show resolved Hide resolved
go/vt/vtctl/reparentutil/util.go Show resolved Hide resolved
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
@GuptaManan100 GuptaManan100 requested a review from deepthi January 6, 2022 00:26
@GuptaManan100 GuptaManan100 merged commit df2fb80 into vitessio:main Jan 6, 2022
@GuptaManan100 GuptaManan100 deleted the elect-new-primary-prs branch January 6, 2022 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VTorc Vitess Orchestrator integration Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants