cluster-set-config-epoch.3valkey - Man Page
Sets the configuration epoch for a new node.
Synopsis
CLUSTER SET-CONFIG-EPOCH
config-epoch
Description
This command sets a specific config epoch in a fresh node. It only works when:
- The nodes table of the node is empty.
- The node current config epoch is zero.
These prerequisites are needed since usually, manually altering the configuration epoch of a node is unsafe, we want to be sure that the node with the higher configuration epoch value (that is the last that failed over) wins over other nodes in claiming the hash slots ownership.
However there is an exception to this rule, and it is when a new cluster is created from scratch. Valkey Cluster config epoch collision resolution algorithm can deal with new nodes all configured with the same configuration at startup, but this process is slow and should be the exception, only to make sure that whatever happens, two more nodes eventually always move away from the state of having the same configuration epoch.
So, using CLUSTER SET-CONFIG-EPOCH
, when a new cluster is created, we can assign a different progressive configuration epoch to each node before joining the cluster together.
Reply
valkey-protocol(7) Simple string reply: OK
if the command was successful. Otherwise an error is returned.
Complexity
O(1)
Acl Categories
@admin @dangerous @slow
History
- Available since: 3.0.0
See Also
asking(3valkey), cluster(3valkey), cluster-addslots(3valkey), cluster-addslotsrange(3valkey), cluster-bumpepoch(3valkey), cluster-count-failure-reports(3valkey), cluster-countkeysinslot(3valkey), cluster-delslots(3valkey), cluster-delslotsrange(3valkey), cluster-failover(3valkey), cluster-flushslots(3valkey), cluster-forget(3valkey), cluster-getkeysinslot(3valkey), cluster-help(3valkey), cluster-info(3valkey), cluster-keyslot(3valkey), cluster-links(3valkey), cluster-meet(3valkey), cluster-myid(3valkey), cluster-myshardid(3valkey), cluster-nodes(3valkey), cluster-replicas(3valkey), cluster-replicate(3valkey), cluster-reset(3valkey), cluster-saveconfig(3valkey), cluster-setslot(3valkey), cluster-shards(3valkey), cluster-slots(3valkey), readonly(3valkey), readwrite(3valkey)