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

PlannedReparentShard: Allow retrying PRS to the existing master. #5226

Merged

Conversation

enisoc
Copy link
Member

@enisoc enisoc commented Sep 25, 2019

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]

@enisoc enisoc requested a review from deepthi September 25, 2019 21:41
@enisoc enisoc requested a review from sougou as a code owner September 25, 2019 21:41
@enisoc enisoc force-pushed the retryable-planned-reparent-shard branch from c7abdb0 to ff59dfd Compare September 25, 2019 23:05
@enisoc enisoc changed the base branch from master to reparent-refactor September 26, 2019 17:40
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]>
@enisoc enisoc force-pushed the retryable-planned-reparent-shard branch from 63449eb to d879a21 Compare September 26, 2019 22:23
Copy link
Member

@deepthi deepthi left a 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.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slaves -> replicas

Copy link
Member Author

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]>
@enisoc enisoc merged commit 9850079 into vitessio:reparent-refactor Sep 26, 2019
@enisoc enisoc deleted the retryable-planned-reparent-shard branch September 26, 2019 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants