Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

CLUSTER FLUSHSLOTS

Last updated
CLUSTER FLUSHSLOTS
Group
Cluster
Complexity
O(1)
Arity
2 (exactly, counting the command name)
HotKV Cloud
Not available
On-Premise
no license needed

CLUSTER FLUSHSLOTS removes every hash slot the receiving node owns from its slot table, and ends any slot import or migration it had open. The change is saved to nodes.conf. The slots are then unassigned in this node’s view; the other nodes are not told. It is mainly a repair and test tool, for example before giving a node a fresh set of slots with CLUSTER ADDSLOTS.

The node must hold no keys: with keys it replies ERR DB must be empty to perform CLUSTER FLUSHSLOTS. and changes nothing. Empty it first (for example with FLUSHALL).

Simple string OK in RESP2 and RESP3. Errors: ERR DB must be empty to perform CLUSTER FLUSHSLOTS. when the node holds keys, and, with cluster mode off, ERR This instance has cluster support disabled.

127.0.0.1:6379> CLUSTER FLUSHSLOTS
OK
127.0.0.1:6379> CLUSTER INFO
cluster_enabled:1
cluster_state:fail
cluster_slots_assigned:0
...

A node that holds a key refuses it:

127.0.0.1:7000> CLUSTER FLUSHSLOTS
(error) ERR DB must be empty to perform CLUSTER FLUSHSLOTS.

As in Redis 7 and Valkey 8, CLUSTER FLUSHSLOTS is refused while the node holds keys.

CLUSTER DELSLOTS, CLUSTER RESET, CLUSTER ADDSLOTS

In a cluster: Scaling a cluster