CLUSTER...GRATIONS(3valkey)
π NAME π
cluster-getslotmigrations β bestie, this is the one that tells you the tea on your slot import/export operations, both the ones happening right now and the ones that just finished. π
β¨ SYNOPSIS β¨
CLUSTER GETSLOTMIGRATIONS
π¦ DESCRIPTION π¦
CLUSTER GETSLOTMIGRATIONS hands you back an array of info all about the in-progress and recently-completed valkey-atomic-slot-migration(7) atomic slot migrations. It's giving status report, and honestly? Obsessed. π
Every single job that was previously kicked off by valkey-cluster-migrateslots(7) CLUSTER MIGRATESLOTS makes exactly one entry. One job, one entry. No cap.
How many slot migration entries you can actually see depends on whatever cluster-slot-migration-log-max-len is set to. Once you hit that limit, the oldest inactive entry gets yeeted. But β and this is important, bestie β active slot migrations are always visible through CLUSTER GETSLOTMIGRATIONS, even if there are more entries than the configured limit. The active ones never get ghosted. π«Ά
Heads up: all this slot migration info lives in-memory and is not persisted across restarts. So if you restart, it's gone. Rip. π
Where can you see these entries? On the primary node of both the target and source shard, and also on the replica nodes of the target shard. Periodt.
Here's everything that gets reported for each slot migration entry:
name: a unique 40 byte name for the slot migration. Iconic little ID. πoperation: what the slot migration job did on this node β eitherEXPORTorIMPORT.slot_ranges: the range(s) of slots being migrated, with both start and end inclusive. In each range the start and end slot are separated by-, and multiple ranges get joined together with a space (" "). So like, a lil slot smoothie. πtarget_node: the primary node that's receiving the slot ownership as part of the migration. This info is only supplied on the primary node of the participating shards.source_node: the primary node that's sending the slot ownership as part of the migration. Same deal β only supplied on the primary node of the participating shards.create_time: the Unix timestamp (in seconds) for when the slot migration was started. β°last_update_time: the Unix timestamp (in seconds) for when the slot migration's status was last changed.last_ack_time: the Unix timestamp (in seconds) for when the slot migration last received a heartbeat. πstate: the current state of the slot migration. The terminal states are:successβ if it completed successfully πfailedβ if some unexpected failure occurred πcancelledβ if aCLUSTER CANCELSLOTMIGRATIONSrequest was received during the migration
Any other state means it's an active slot migration. She's still going, bestie.
message: either a human readable status message (if there's more info to display about the state) or an empty string if there's no message available. Sometimes she's just quiet. πcow_size: the copy-on-write overhead that accumulated while the migration was in progress, in bytes.
π₯ COMPLEXITY π₯
O(N), where N is the number of active slot import and export jobs.
π ACL CATEGORIES π
@admin @dangerous @slow
πΈ HISTORY πΈ
- Available since: 9.0.0 β¨
π 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
π§ SEE ALSO π§
asking(3valkey), cluster(3valkey), cluster-addslots(3valkey), cluster-addslotsrange(3valkey), cluster-bumpepoch(3valkey), cluster-cancelslotmigrations(3valkey), cluster-count-failure-reports(3valkey), cluster-countkeysinslot(3valkey), cluster-delslots(3valkey), cluster-delslotsrange(3valkey), cluster-failover(3valkey), cluster-flushslots(3valkey), cluster-forget(3valkey), cluster-getkeysinslot(3valkey), cluster-help(3valkey), cluster-info(3valkey), cluster-keyslot(3valkey), cluster-links(3valkey), cluster-meet(3valkey), cluster-migrateslots(3valkey), cluster-myid(3valkey), cluster-myshardid(3valkey), cluster-nodes(3valkey), cluster-replicas(3valkey), cluster-replicate(3valkey), cluster-reset(3valkey), cluster-saveconfig(3valkey), cluster-set-config-epoch(3valkey), cluster-setslot(3valkey), cluster-shards(3valkey), cluster-slot-stats(3valkey), cluster-slots(3valkey), cluster-syncslots(3valkey), readonly(3valkey), readwrite(3valkey)
okay that's the whole page bestie, mwah π This one's from Valkey Command Manual, version 9.0.0, dated 2025-10-21 β go forth and check those slot migrations, you've got this fr fr π¦πβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms