Route writes to target keyspace in a vreplication workflow
Starting with Vitess 11.0 you should use the SwitchTraffic VReplication v2 commands
SwitchWrites -- [--timeout=30s] [--cancel] [--reverse] [--reverse_replication=false] --tablet_types=primary [--dry-run] <keyspace.workflow>
SwitchWrites is used to switch writes for tables in a MoveTables workflow or for entire keyspace in the Reshard workflow away from the primary in the source keyspace to the primary in the target keyspace
Specifies the maximum time to wait, in seconds, for vreplication to catch up on primary migrations. The migration will be cancelled on a timeout.
SwitchWrites first stops writes on the source primary and waits for the replication to the target to catchup with the point where the writes were stopped. If the wait time is longer than filtered_replication_wait_time the command will error out. For setups with high write qps you may need to increase this value.
If a previous SwitchWrites returned with an error you can restart it by running the command again (after fixing the issue that caused the failure) or the SwitchWrites can be canceled using this parameter. Only the SwitchWrites is cancelled: the workflow is set to Running so that replication continues.
Reverse a previous SwitchWrites serve from source
SwitchWrites, by default, starts a reverse replication stream with the current target as the source, replicating back to the original source. This enables a quick and simple rollback. This reverse workflow name is that of the original workflow concatenated with \_reverse.
Tablet types to switch traffic for. For writes that will only be primary tablets. Note: For tablet type rdonly you must [SwitchReads](../switchreads) before you can SwitchWrites
You can do a dry run where no actual action is taken but the command logs all the actions that would be taken by SwitchWrites.
Name of target keyspace and the associated workflow to SwitchWrites for.