CLUSTER FLUSHSLOTS
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).
Return value
Section titled “Return value”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.
Examples
Section titled “Examples”127.0.0.1:6379> CLUSTER FLUSHSLOTSOK127.0.0.1:6379> CLUSTER INFOcluster_enabled:1cluster_state:failcluster_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.Compatibility
Section titled “Compatibility”As in Redis 7 and Valkey 8, CLUSTER FLUSHSLOTS is refused while the node
holds keys.
See also
Section titled “See also”CLUSTER DELSLOTS, CLUSTER RESET, CLUSTER ADDSLOTS
In a cluster: Scaling a cluster
Was this page helpful?
Thanks for the feedback.