Reshard a keyspace to achieve horizontal scaling

Experimental #

This documentation is for a new (v2) set of vtctld commands. See RFC for more details.

Command #

Reshard <options> <action> <workflow identifier>

Description #

Reshard is used to create and manage workflows to horizontally shard an existing keyspace. The source keyspace can be unsharded or sharded.

Parameters #

action #

Reshard is an “umbrella” command. The action sub-command defines the operation on the workflow.

options #

Each action has additional options/parameters that can be used to modify its behavior.

actions are common to both MoveTables and Reshard v2 workflows. Only the create action has different parameters, all other actions have common options and similar semantics. These actions are documented separately.

workflow identifier #

All workflows are identified by targetKeyspace.workflow where targetKeyspace is the name of the keyspace to which the tables are being moved. workflow is a name you assign to the Reshard workflow to identify it.

The most basic Reshard Workflow lifecycle #

  1. Initiate the migration using Create
    Reshard -source_shards=<source_shards> -target_shards=<target_shards> Create <keyspace.workflow>
  2. Monitor the workflow using Show or Progress
    Reshard Show <keyspace.workflow> or
    Reshard Progress <keyspace.workflow>
  3. Confirm that data has been copied over correctly using VDiff
  4. Cutover to the target keyspace with SwitchTraffic
    Reshard SwitchTraffic <keyspace.workflow>
  5. Cleanup vreplication artifacts and source shards with Complete
    Reshard Complete <keyspace.workflow>