Skip to content

Allow planned reparenting to work without master/avoid master flags#4139

Merged
sougou merged 3 commits intovitessio:masterfrom
tinyspeck:planned_reparenting_tweaks
Sep 1, 2018
Merged

Allow planned reparenting to work without master/avoid master flags#4139
sougou merged 3 commits intovitessio:masterfrom
tinyspeck:planned_reparenting_tweaks

Conversation

@rafael
Copy link
Copy Markdown
Member

@rafael rafael commented Aug 15, 2018

Description.

It came to our attention that planned reparenting requires avoid_master flag in order to work. There are several checks along the stack that validate this, so I'm assuming there is a reason behind this. Could we relax this requirement? I think as long as chooseMaster ignores current master, there shouldn't be any need in enforcing this requirement.

Opening this PR to start discussion around this. The following has POC of this change. If we think this is something we should do, I can polish it and add more tests.

cc: @demmer, @sougou, @zmagg

Rafael Chacon added 2 commits August 15, 2018 16:27
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
if avoidMasterTabletAlias == nil {
return nil, fmt.Errorf("tablet to avoid for reparent is not provided, cannot choose new master")
}
// if avoidMasterTabletAlias == nil {
Copy link
Copy Markdown
Contributor

@zmagg zmagg Aug 15, 2018

Choose a reason for hiding this comment

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

It seems to me that if this is nil, we need to set avoidMasterTabletAlias = shardInfo.MasterAlias , as chooseNewMaster requires that we have something passed in as that field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I agree with @zmagg. The simplest way would be to leave the existing logic in plannedReparentShardLocket as is, and perform this assignment before all the checks.

And then we can delete this check here.

@rafael rafael changed the title WIP: Allow planned reparenting to work without master/avoid master flags Allow planned reparenting to work without master/avoid master flags Aug 31, 2018
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
@rafael rafael force-pushed the planned_reparenting_tweaks branch from d14771d to 8ed53d3 Compare August 31, 2018 21:15
@rafael rafael requested a review from sougou August 31, 2018 21:15
@sougou sougou merged commit bac6cc7 into vitessio:master Sep 1, 2018
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.

3 participants