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 SET-CONFIG-EPOCH

Last updated
CLUSTER SET-CONFIG-EPOCH config-epoch
Group
Cluster
Complexity
O(1)
Arity
3 (exactly, counting the command name)
HotKV Cloud
Not available
On-Premise
no license needed

CLUSTER SET-CONFIG-EPOCH gives a fresh node a configuration epoch. When you create a cluster, each primary should start with a different epoch, so no two primaries ever claim the same slots with the same epoch. redis-cli --cluster create assigns the slots, then a distinct epoch to each primary with this command, and only then makes the nodes meet.

It works only on a node that knows no other node and whose epoch is still 0. If the value is greater than the node’s current epoch, that is raised too.

Simple string OK in RESP2 and RESP3, or one of these errors:

Case Error
Not an integer ERR value is not an integer or out of range
A negative value ERR Invalid config epoch specified: <epoch>
The node knows other nodes ERR The user can assign a config epoch only when the node does not know any other node.
The node’s epoch is not 0 ERR Node config epoch is already non-zero
Cluster mode is off ERR This instance has cluster support disabled
127.0.0.1:6379> CLUSTER SET-CONFIG-EPOCH 1
OK
127.0.0.1:6379> CLUSTER SET-CONFIG-EPOCH 2
(error) ERR Node config epoch is already non-zero

Same rules and error strings as Redis 7 and Valkey 8.

CLUSTER BUMPEPOCH, CLUSTER ADDSLOTS, CLUSTER INFO

In a cluster: Cluster troubleshooting