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

vrepl: vtctld Migrate command #5653

Merged
merged 4 commits into from
Jan 8, 2020
Merged

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Jan 3, 2020

We reuse the Materialize command to build the command to migrate tables from one keyspace to another. This works from any keyspace to any keyspace, and the MigrateReads and MigrateWrite commands can be used to migrate traffic.

@sougou sougou requested a review from deepthi January 3, 2020 20:53
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 a couple of nits.

@@ -311,6 +311,9 @@ var commands = []commandGroup{
{"Reshard", commandReshard,
"[-skip_schema_copy] <keyspace.workflow> <source_shards> <target_shards>",
"Start a Resharding process. Example: Reshard ks.workflow001 '0' '-80,80-'"},
{"Migrate", commandMigrate,
"[-cell=<cell>] [-tablet_types=<tablet_types>] -workflow=<workflow> <source_keyspace> <target_keyspace> <table_specs>",
`Start a table(s) migration, table_specs is a list of tables or the tables section of the vschema for the target keyspace. Example: '{"t1":{}, "t2":{}}`},
Copy link
Member

Choose a reason for hiding this comment

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

Can you give a more complex example in the help text?

Comment on lines +1824 to +1823
if *workflow == "" {
return fmt.Errorf("a workflow name must be specified")
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: I would check this first, before checking the args.

CreateDdl: "copy",
})
}
return wr.Materialize(ctx, ms)
Copy link
Member

Choose a reason for hiding this comment

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

+1 for reuse :)

sougou added 4 commits January 7, 2020 16:19
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
@sougou sougou merged commit 6d44678 into vitessio:master Jan 8, 2020
@sougou sougou deleted the ss-vrepl-migrate branch January 8, 2020 01:09
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