Sets hash slots as unbound for a node.
CLUSTER
DELSLOTS
slot
[slot…]
In Valkey Cluster, each node keeps track of which primary is serving a particular hash slot.
The CLUSTER DELSLOTS
command asks a particular Valkey
Cluster node to forget which primary is serving the hash slots specified
as arguments.
In the context of a node that has received a
CLUSTER DELSLOTS
command and has consequently removed the
associations for the passed hash slots, we say those hash slots are
unbound. Note that the existence of unbound hash slots occurs
naturally when a node has not been configured to handle them (something
that can be done with the CLUSTER ADDSLOTS
command) and if
it has not received any information about who owns those hash slots
(something that it can learn from heartbeat or update messages).
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. Moreover, if a heartbeat or update message is received with a configuration epoch greater than the node’s own, the association is re-established.
However, note that:
Simple string
reply: OK
if the command was successful. Otherwise an
error is returned.
O(N) where N is the total number of hash slot arguments
@admin @dangerous @slow
The following command removes the association for slots 5000 and 5001 from the node receiving the command:
> CLUSTER DELSLOTS 5000 5001
OK
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.
ASKING, CLUSTER, CLUSTER ADDSLOTS, CLUSTER ADDSLOTSRANGE, CLUSTER BUMPEPOCH, CLUSTER COUNT-FAILURE-REPORTS, CLUSTER COUNTKEYSINSLOT, CLUSTER DELSLOTSRANGE, CLUSTER FAILOVER, CLUSTER FLUSHSLOTS, CLUSTER FORGET, CLUSTER GETKEYSINSLOT, CLUSTER HELP, CLUSTER INFO, CLUSTER KEYSLOT, CLUSTER LINKS, CLUSTER MEET, 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, READONLY, READWRITE.