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

Don't freeze with no serving shards if reversing vreplication fails d… #4449

Merged
merged 2 commits into from
Jan 4, 2019

Conversation

dweitzman
Copy link
Member

…uring MigrateServedTypes

Signed-off-by: David Weitzman [email protected]

!!! Haven't tested this at all yet, but wanted to send something out so it doesn't get lost !!!

@dweitzman dweitzman requested a review from sougou as a code owner December 13, 2018 00:15
@@ -553,6 +552,13 @@ func (wr *Wrangler) masterMigrateServedType(ctx context.Context, keyspace string
// Always setup reverse replication. We'll start it later if reverseReplication was specified.
// This will allow someone to reverse the replication later if they change their mind.
if err := wr.setupReverseReplication(ctx, sourceShards, destinationShards); err != nil {
// It's safe to unfreeze if reverse replication setup fails.
wr.cancelMasterMigrateServedTypes(ctx, sourceShards)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's one more corner case to handle here: if setupReverseReplication partially succeeded, it's possible that it would have setup source shards for the reverse. If so, there will be no easy way to tell which way the replication is going, because both sides will have source shards.

If you look in findSourceDest, the presence a frozen flag is used as the tie breaker to disambiguate.

This means that we have to 'remove the source shards from the source shards' (so confusing) before unfreezing. I think we can do this inside the cancelMasterMigrateServedTypes function. It currently calls updateShardRecords. I recommend expanding that out within the function and additionally setting si.SourceShards to nil.

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, I think

…uring MigrateServedTypes

Signed-off-by: David Weitzman <[email protected]>
…reverse replication enabled

Signed-off-by: David Weitzman <[email protected]>
@dweitzman dweitzman force-pushed the fix_reverse_failure branch from 7adb4dc to 96e7c5d Compare January 4, 2019 18:50
@sougou sougou merged commit c5c2c02 into vitessio:master Jan 4, 2019
@dweitzman dweitzman deleted the fix_reverse_failure branch January 7, 2019 00:50
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