CLUSTER SET-CONFIG-EPOCH
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.
Return value
Section titled “Return value”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 |
Examples
Section titled “Examples”127.0.0.1:6379> CLUSTER SET-CONFIG-EPOCH 1OK127.0.0.1:6379> CLUSTER SET-CONFIG-EPOCH 2(error) ERR Node config epoch is already non-zeroCompatibility
Section titled “Compatibility”Same rules and error strings as Redis 7 and Valkey 8.
See also
Section titled “See also”CLUSTER BUMPEPOCH, CLUSTER ADDSLOTS, CLUSTER INFO
In a cluster: Cluster troubleshooting
Was this page helpful?
Thanks for the feedback.