-
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
[reparentutil / wrangler] Extract PlannedReparentShard logic from wrangler to PlannedReparenter struct #7501
Conversation
… PRS This will eventually replace the equivalent logic in wrangler, which can then delegate into this module, along with `VtctldServer` when we add PRS to that API. Signed-off-by: Andrew Mason <amason@slack-corp.com>
This allows conveniently setting up a shard with multiple tablets claiming to be MASTER, with the shard be correctly configured to have _a_ serving master. Previously, those were mutually-exclusive setups with `AddTablets`. Signed-off-by: Andrew Mason <amason@slack-corp.com>
1395f55
to
7d53d36
Compare
I can review this from a Go perspective but, as with #7464, I defer to experts on the Vitess-y parts. @deepthi, @setassociative, and/or @rohit-nayak-ps would you be able to give this one a look too? |
Test failure is coming from a PRS endtoend test, but looks like a port reservation issue. Going to kick it again and also try to repro locally
|
7d53d36
to
7ee9c7a
Compare
1016d29
to
02040df
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.
This change seems straightforward and looks good to me! (Apart from the failing test, which... seems unrelated? Ugh.) I do suggest waiting for another +1 from one of the other reviewers, though. :)
Truly a heroic amount of faking + testing. 🏆 Seriously good work.
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.
Very nice refactor. This is so much more readable than what we had before. 💯
) | ||
} | ||
|
||
// prelightChecks checks some invariants that pr.reparentShardLocked() depends |
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.
typo: preflightChecks
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.
"prelight" 😂
nice catch, should be fixed, and i've cleaned up the commit history as well now
- add preflightChecks tests - add test cases for `performPartialPromotionRecovery` - remove unused arg, add test cases for `performPotentialPromotion` - add missing call to waitgroup add - add test cases for `reparentTablets` - add tests for graceful promotion - add the rest of the PlannedReparenter tests Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
02040df
to
f6913d4
Compare
Description
This PR extracts the PRS logic from
./go/vt/wrangler
to a dedicatedPlannedReparenter
struct in./go/vt/vtctl/reparentutil
, to be shared between the legacy and new vtctl APIs in my next PR, similar to what I did for ERS in #7464.Some notes on commits
All the commits that begin with "wip" are just adding tests, and it's how I committed changes as I went, so it may be useful to step through that way, but before merging I'd like to squash all of those — and just those ones — into a single, "Add all the tests" commit.
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: