-
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
PlannedReparentShard: Allow retrying PRS to the existing master. #5226
PlannedReparentShard: Allow retrying PRS to the existing master. #5226
Conversation
c7abdb0
to
ff59dfd
Compare
This is an incremental first step toward making PRS more useful for repairing situations when replication across a shard is not fully consistent. The main thing this enables is retrying the step of reconfiguring all replicas (including the old master) to point to the new master. Signed-off-by: Anthony Yeh <[email protected]>
Signed-off-by: Anthony Yeh <[email protected]>
63449eb
to
d879a21
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.
LGTM except for a doc fix.
go/vt/wrangler/reparent.go
Outdated
wr.logger.Infof("updating shard record with new master %v", masterElectTabletAlias) | ||
if _, err := wr.ts.UpdateShardFields(ctx, keyspace, shard, func(si *topo.ShardInfo) error { | ||
si.MasterAlias = masterElectTabletAlias | ||
return nil | ||
}); err != nil { | ||
wgSlaves.Wait() | ||
wgReplicas.Wait() | ||
return fmt.Errorf("failed to update shard master record: %v", err) | ||
} | ||
|
||
// Wait for the slaves to complete. |
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.
slaves -> replicas
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.
Done.
Signed-off-by: Anthony Yeh <[email protected]>
This is an incremental first step toward making PRS more useful for repairing situations when replication across a shard is not fully consistent.
The main thing this enables is retrying the step of reconfiguring all replicas (including the old master) to point to the new master.
Signed-off-by: Anthony Yeh [email protected]