-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
There was a problem hiding this 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.
go/vt/vtctl/vtctl.go
Outdated
@@ -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":{}}`}, |
There was a problem hiding this comment.
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?
if *workflow == "" { | ||
return fmt.Errorf("a workflow name must be specified") | ||
} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for reuse :)
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
a4b64e1
to
7178576
Compare
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.