CLUSTER...OTSRANGE(3valkey)

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

πŸ’– CLUSTER ADDSLOTSRANGE β€” the 3valkey girlies know πŸ’–

okay bestie, pull up a chair, because this one is genuinely iconic and also kinda niche. it lives in the 3valkey manual section, so if you ever see CLUSTER...OTSRANGE(3valkey) floating around in a header, that's literally just this page being shy about its full name. πŸŽ€


✨ NAME ✨

cluster-addslotsrange β€” Assigns new hash slot ranges to a node. no cap, that's the whole job. πŸ‘‘


✨ SYNOPSIS ✨

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

✨ DESCRIPTION ✨

okay so CLUSTER ADDSLOTSRANGE is the sister command to valkey-cluster-addslots(7) / CLUSTER ADDSLOTS β€” they're both out here handing hash slots to nodes. same goal, different font. 🫢

the glow-up is in the how:

  • CLUSTER ADDSLOTS wants a list of slots to assign to the node.
  • CLUSTER ADDSLOTSRANGE wants a list of slot ranges β€” specified by a start slot and an end slot β€” to assign to the node.

so instead of typing every single slot like a peasant, you just say "from here to there" and she ✨understands✨. it's giving efficiency, honestly.


✨ REPLY ✨

valkey-protocol(7) Simple string reply: OK if the command was successful. otherwise? an error gets returned. 😭 so if you see OK, slay. if you see an error, we investigate.


✨ COMPLEXITY ✨

O(N) where N is the total number of slots between the start slot and end slot arguments. big ranges = more work, obviously. it scales with how much you asked for. πŸ¦‹


✨ ACL CATEGORIES ✨

  • @admin
  • @dangerous
  • @slow
⚠️ bestie notice the @dangerous tag. this is not a little cute command you sprinkle around for fun. it touches cluster topology. be intentional. πŸ’€

✨ HISTORY ✨

  • Available since: 7.0.0 πŸŽ‚ (so it's a newer baby, not an ancient relic)

πŸ“ Example πŸ“

say you wanna assign slots 1 2 3 4 5 to the node. the CLUSTER ADDSLOTS way looks like this:

> CLUSTER ADDSLOTS 1 2 3 4 5
OK

and the exact same operation, but with CLUSTER ADDSLOTSRANGE:

> CLUSTER ADDSLOTSRANGE 1 5
OK

see?? 1 5 instead of 1 2 3 4 5. shorter, cleaner, main character energy. πŸ’… same result, less typing, periodt.

🧚 Usage in Valkey Cluster 🧚

heads up: this command only works in cluster mode. and it's genuinely useful for these Valkey Cluster operations:

  1. To create a new cluster, CLUSTER ADDSLOTSRANGE is used to initially set up primary nodes splitting the available hash slots among them. 🌈
  2. In order to fix a broken cluster where certain slots are unassigned. 🩹 (the rescue arc, we love to see it)

✨ SEE ALSO ✨

asking(3valkey), cluster(3valkey), cluster-addslots(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-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 lil' entry is from the Valkey Command Manual, version 9.0.0, dated 2025-10-21. go forth and assign those ranges responsibly. mwah πŸ’–βœ¨

πŸ“¦ where this page comes from