CLUSTER-DELSLOTS(3valkey)
β¨ CLUSTER-DELSLOTS β¨
okay bestie, so we're in the valkey command manual and today's main character is cluster-delslots π
πΈ NAME πΈ
cluster-delslots β sets hash slots as unbound for a node. yes fr, it justβ¦ makes a node forget who owns a slot π«Ά
π¦ SYNOPSIS π¦
CLUSTER DELSLOTS slot [slot...]
π DESCRIPTION π
so in Valkey Cluster, every node keeps track of which primary is serving a particular hash slot. that's the whole vibe π
CLUSTER DELSLOTS asks a particular Valkey Cluster node to forget which primary is serving the hash slots you passed as arguments. just straight up amnesia, iconic honestly π
when a node has received a CLUSTER DELSLOTS command and has consequently removed the associations for the passed hash slots, we say those hash slots are unbound. and like, unbound hash slots are a totally natural thing to happen when a node hasn't been configured to handle them (something you can do with the valkey-cluster-addslots(7) CLUSTER ADDSLOTS command) and if it hasn't received any info about who owns those hash slots (something it can learn from heartbeat or update messages). it's giving "idk her" energy π
if a node with unbound hash slots receives a heartbeat packet from another node that claims to be the owner of some of those hash slots, the association is established instantly. no waiting, no drama, just slay β¨ and moreover, if a heartbeat or update message is received with a configuration epoch greater than the node's own, the association is re-established. boom, back together π₯°
BUT. however. bestie listen up, note that:
- The command only works if all the specified slots are already associated with some node.
- The command fails if the same slot is specified multiple times. (pick a lane pls π)
- As a side effect of the command execution, the node may go into down state because not all hash slots are covered. that's the risk, that's the cost, that's the girlboss tragedy π
π REPLY π
valkey-protocol(7) Simple string reply: OK if the command was successful. otherwise an error is returned. so basically: either OK or it's not okay π
π₯ COMPLEXITY π₯
O(N) where N is the total number of hash slot arguments. linear, clean, no surprises β¨
π ACL CATEGORIES π
@admin @dangerous @slow
dangerous?? slow?? yeah bestie this one's got lore. handle with care πΈ
π HISTORY π
- Available since:
3.0.0β an elder, a classic, a legend π
π Example π
the following command removes the association for slots 5000 and 5001 from the node receiving the command:
> CLUSTER DELSLOTS 5000 5001
OK
ate that. no crumbs. π
π§ Usage in Valkey Cluster π§
this command only works in cluster mode and may be useful for debugging and in order to manually orchestrate a cluster configuration when a new cluster is created. it is currently not used by valkey-cli, and mainly exists for API completeness. so like, it's there for the sake of being there. we respect it for that π«‘
π 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-delslotsrange(3valkey)cluster-failover(3valkey)cluster-flushslots(3valkey)cluster-forget(3valkey)cluster-getkeysinslot(3valkey)cluster-getslotmigrations(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)
and that's the whole page bestie!! β¨π this one's from Valkey 9.0.0, dated 2025-10-21, and it lives in the CLUSTER-DELSLOTS(3valkey) corner of the manual. go unbound some slots, but likeβ¦ responsibly ππ¦π
π¦ 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