Allow planned reparenting to work without master/avoid master flags#4139
Merged
sougou merged 3 commits intovitessio:masterfrom Sep 1, 2018
Merged
Allow planned reparenting to work without master/avoid master flags#4139sougou merged 3 commits intovitessio:masterfrom
sougou merged 3 commits intovitessio:masterfrom
Conversation
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>
zmagg
reviewed
Aug 15, 2018
go/vt/wrangler/reparent.go
Outdated
| if avoidMasterTabletAlias == nil { | ||
| return nil, fmt.Errorf("tablet to avoid for reparent is not provided, cannot choose new master") | ||
| } | ||
| // if avoidMasterTabletAlias == nil { |
Contributor
There was a problem hiding this comment.
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.
Contributor
There was a problem hiding this comment.
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.
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
d14771d to
8ed53d3
Compare
sougou
approved these changes
Sep 1, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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