Split, merge and move ranges

Split a range by hand, merge it with its neighbour or move it to another core.

Split a range by hand, merge it with its neighbour or move it to another core. The cluster already does it on its own by size and by load; these commands serve for specific cases, such as preparing a bulk load.

Requirements

  • Access to teseladb admin on a node of the cluster.
  • The range identifier, which teseladb admin ranges shows.

Split

Shell
teseladb admin range split <range_id>
teseladb admin range split <range_id> --at '{"_id": 1000}'

Without --at, the range is cut where a split by size would cut it. With --at, it is cut right before the key you give.

Merge with the right neighbour

Shell
teseladb admin range merge <range_id>

Move to another core

teseladb admin range relocate <range_id> --core 3

Check

Run teseladb admin ranges again. After a split you will see one range more than before, and after a merge, one fewer; after moving a range, its replica shows up on the new core.

Common problems

  • range split without --at fails on a node with no replica of the range; ask one that has it or give --at.
  • range relocate is refused if the range is already on that core or busy with another change.

See also