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

vreplication: Reshard command #5491

Merged
merged 10 commits into from Dec 4, 2019
Merged

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Dec 1, 2019

Implement the vtctl Reshard command.

This command replaces all previous SplitClone workflows. After issuing this command and replication has caught up, you can migrate traffic with MigrateReads and MigrateWrites.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
CreateShard starts off all unsharded shards as serving. It
breaks if you create shards -80, 80-, and then 0
(with the intention to reshard to 0).

It was previously allowed because we allowed the old style of custom
sharding where you could create shards 0, 1, 2, etc.
But we don't support that any more.

The new rule sets master as serving only if the keyranges don't
overlap. This is applied for unsharded keyspaces also.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou requested review from deepthi and rafael December 1, 2019 03:15
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
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.

Looks good except for the one question.

@@ -307,6 +307,9 @@ var commands = []commandGroup{
{"ValidateKeyspace", commandValidateKeyspace,
"[-ping-tablets] <keyspace name>",
"Validates that all nodes reachable from the specified keyspace are consistent."},
{"Reshard", commandReshard,
"[-skip_schema_copy] <keyspace.workflow> <source_shards> <target_shards>",
"Start a Resharding process. Example: Reshard ks.workflow001 '0' '-80,80-'"},
{"SplitClone", commandSplitClone,
Copy link
Member

Choose a reason for hiding this comment

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

are you not removing this command in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's better not to remove anything legacy right now. I'm thinking we should wait a couple of releases before removing these.

@sougou sougou merged commit 417a207 into vitessio:master Dec 4, 2019
@sougou sougou deleted the ss-vrepl-reshard branch December 4, 2019 02:07
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.

None yet

2 participants