Open timvaillancourt opened 1 day ago
Hello reviewers! :wave: Please follow this checklist when reviewing this Pull Request.
release notes (needs details)
label if users need to know about this change.-
), and have a clear help text.Jobs
should be named in order to mark it as required
.required
, the maintainer team must be notified._vt
tables and RPCs need to be backward compatible.vtctl
command output order should be stable and awk
-able.Attention: Patch coverage is 53.84615%
with 6 lines
in your changes missing coverage. Please review.
Project coverage is 69.43%. Comparing base (
2e2b223
) to head (c0abfdc
). Report is 2 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
go/cmd/vtctldclient/command/reparents.go | 14.28% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
You'll want to add support for this in the client command, no? Here: go/cmd/vtctldclient/command/reparents.go
You'll want to add support for this in the client command, no? Here: go/cmd/vtctldclient/command/reparents.go
@mattlord oh thanks, yes I'll add support for the CLI binary ππ
Added:
tvaillancourt@tvailla-ltmxctu vitess % ./bin/vtctldclient EmergencyReparentShard --help 2>&1 | grep expected-primary
--expected-primary string Alias of a tablet that must be the current primary in order for the reparent to be processed.
π
Description
This PR allows a
EmergencyReparentShard
request to contain the alias of the primary we expect to be the current primary for the action to succeed. If this alias is incorrect or stale, the reparent fails with an error indicating there is a failed precondition/mismatch.This is useful to prevent races between external automation that runs
EmergencyReparentShard
and Vitess (vtorc
andvtctld
), which may reparent a shard in the time external automation is creating/processing it's own reparent request. With this support added, automation with a stale view of the world will encounter an error instead of triggering another reparentIn the future, Vitess could use this field internally to be more explicit but because everything uses shard locks, it should never encounter a mismatch
Related Issue(s)
Resolves https://github.com/vitessio/vitess/issues/16430
Checklist
Deployment Notes