ATTACH PARTITION

Registers a physical partition on the specified leaf with the master aggregator.

ATTACH PARTITION partition_id ON 'leaf_host':leaf_port

Notes

  • partition_id has the form db_name:partition_ordinal.
  • The specified leaf must already contain the physical partition. If the partition is registered as a replica partition, the replication master for the partition will be set to the master partition for the target partition id.
  • The newly attached partition will be registered as a replica partition if and only if there is already a master partition for the target partition id, and if the physical partition on the specified leaf is in one of the following database states: REPLICATING or REPLICATION_PAUSED.
  • Otherwise the newly attached partition will be registered as a master partition. However, even if the partition is registered as a master, any replica partitions for the same partition id will not be automatically set to replicate from the new master.
  • This command must be run on the master aggregator node (see Node Requirements for MemSQL Commands ).
  • If the physical partition has diverged from the partition master, setting its replication master to the partition master will cause the physical partition to enter and UNRECOVERABLE state.

Example

memsql> ATTACH PARTITION memsql_demo:63 ON 'ip-10-0-3-82.ec2.internal':3306;
Query OK, 1 row affected (2.42 sec)