CLUSTER GETSLOTMIGRATIONS · Valkey

CLUSTER GETSLOTMIGRATIONS

Gets the status of ongoing and recently finished slot import and export operations.

Usage

CLUSTER GETSLOTMIGRATIONS

Description

CLUSTER GETSLOTMIGRATIONS returns an array of information about in-progress and recently completed atomic slot migrations.

Each job previously started by CLUSTER MIGRATESLOTS creates a single entry. The number of visible slot migration entries depends on the configured cluster-slot-migration-log-max-len. After the limit is reached, the oldest inactive entry is removed. Note that active slot migrations will always be visible through CLUSTER GETSLOTMIGRATIONS, even if there are more entries than the configured limit.

Information about the slot migration operations is stored in-memory and is not persisted across restarts. Slot migration entries are visible on the primary node of both the target and source shard and the replica nodes of the target shard.

The following information is reported for each slot migration entry:

Complexity

O(N), where N is the number of active slot import and export jobs.

ACL Categories

@admin @dangerous @slow

Examples

Response in RESP 2

127.0.0.1:30001> CLUSTER GETSLOTMIGRATIONS
1)  1) "name"
    2) "5371b28997de6fd0bbe813ad8ebdfdf2faadb308"
    3) "operation"
    4) "EXPORT"
    5) "slot_ranges"
    6) "0-10"
    7) "target_node"
    8) "4b4f12fdfb58d5e30fef7b9ad3f1651dacbbaba9"
    9) "source_node"
   10) "93941e777e17fcbc92d4398cc957ffea888f472b"
   11) "create_time"
   12) (integer) 1754870400
   13) "last_update_time"
   14) (integer) 1754870400
   15) "last_ack_time"
   16) (integer) 1754870400
   17) "state"
   18) "success"
   19) "message"
   20) ""
   21) "cow_size"
   22) (integer) 0

Response in RESP 3

127.0.0.1:30001> CLUSTER GETSLOTMIGRATIONS
1)  1# "name" => "5371b28997de6fd0bbe813ad8ebdfdf2faadb308"
    2# "operation" => "EXPORT"
    3# "slot_ranges" => "0-10"
    4# "target_node" => "4b4f12fdfb58d5e30fef7b9ad3f1651dacbbaba9"
    5# "source_node" => "93941e777e17fcbc92d4398cc957ffea888f472b"
    6# "create_time" => (integer) 1754870400
    7# "last_update_time" => (integer) 1754870400
    8# "last_ack_time" => (integer) 1754870400
    9# "state" => "success"
   10# "message" => ""
   11# "cow_size" => (integer) 0

History

See also

ASKING, CLUSTER, CLUSTER ADDSLOTS, CLUSTER ADDSLOTSRANGE, CLUSTER BUMPEPOCH, CLUSTER CANCELSLOTMIGRATIONS, CLUSTER COUNT-FAILURE-REPORTS, CLUSTER COUNTKEYSINSLOT, CLUSTER DELSLOTS, CLUSTER DELSLOTSRANGE, CLUSTER FAILOVER, CLUSTER FLUSHSLOTS, CLUSTER FORGET, CLUSTER GETKEYSINSLOT, CLUSTER HELP, CLUSTER INFO, CLUSTER KEYSLOT, CLUSTER LINKS, CLUSTER MEET, CLUSTER MIGRATESLOTS, CLUSTER MYID, CLUSTER MYSHARDID, CLUSTER NODES, CLUSTER REPLICAS, CLUSTER REPLICATE, CLUSTER RESET, CLUSTER SAVECONFIG, CLUSTER SET-CONFIG-EPOCH, CLUSTER SETSLOT, CLUSTER SHARDS, CLUSTER SLOT-STATS, CLUSTER SLOTS, CLUSTER SYNCSLOTS, READONLY, READWRITE.