CLUSTER...OTSRANGE(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ NAME ✨

cluster-delslotsrange β€” bestie, this one sets hash slot ranges as unbound for a node πŸ’…


🌸 SYNOPSIS 🌸

CLUSTER DELSLOTSRANGE start-slot end-slot [start-slot end-slot ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so CLUSTER DELSLOTSRANGE is literally the twin sister of the valkey-cluster-delslots(7) CLUSTER DELSLOTS command β€” they both remove hash slots from the node. same goal, different vibe ✨

the difference? CLUSTER DELSLOTS takes a whole list of hash slots to yeet off the node, one by one. CLUSTER DELSLOTSRANGE takes a list of slot ranges (each one specified by a start slot and an end slot) and removes those instead. ranges > individual slots, no cap 🫢


πŸ’Œ REPLY πŸ’Œ

valkey-protocol(7) Simple string reply: OK if the command was successful, periodt πŸ’–

otherwise? an error gets returned. not the slay we wanted 😭


πŸŽ€ COMPLEXITY πŸŽ€

O(N) where N is the total number of the slots between the start slot and end slot arguments. so the bigger your ranges, the more work it's doing. iykyk ✨


πŸ‘‘ ACL CATEGORIES πŸ‘‘

@admin @dangerous @slow

bestie, @dangerous is right there in the list. this is not a casual little command, okay? πŸ‘€

🌈 HISTORY 🌈

  • ✨ Available since: 7.0.0

πŸ“ Example πŸ“

say you wanna remove slots 1 2 3 4 5 from the node. the CLUSTER DELSLOTS way is giving:

> CLUSTER DELSLOTS 1 2 3 4 5
OK

and the same operation, but with the following CLUSTER DELSLOTSRANGE command, is giving:

> CLUSTER DELSLOTSRANGE 1 5
OK

same result, way less typing. we love efficiency πŸ’…

However β€” and this is the important part, don't skip it β€” note that:

  1. The command only works if all the specified slots are already associated with the node. no shortcuts, no halfsies πŸ™ˆ
  2. The command fails if the same slot is specified multiple times. don't do that 🚫
  3. As a side effect of the command execution, the node may go into down state because not all hash slots are covered. yeah. that. be careful 😭

🧚 Usage in Valkey Cluster 🧚

this command only works in cluster mode, and it 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 it's the quiet iconic one that's just there for the sake of being complete, and honestly? respect πŸ‘‘


πŸ’œ 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-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, you ate it πŸ’…βœ¨

this little masterpiece is from the Valkey Command Manual, version 9.0.0, dated 2025-10-21 πŸŽ€ go forth and unbound those slots responsibly, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from