CLUSTER-...IG-EPOCH(3valkey)
β¨ CLUSTER SET-CONFIG-EPOCH β¨
okay bestie, so this one lives in the Valkey Command Manual β it's cluster-set-config-epoch, and yes the manual page calls it CLUSTER-...IG-EPOCH(3valkey) because apparently even manpage headers got a lil chaotic π
anyway, come sit, we're learning about configuration epochs π
πΈ NAME πΈ
cluster-set-config-epoch β sets the configuration epoch for a new node. periodt.
π¦ SYNOPSIS π¦
CLUSTER SET-CONFIG-EPOCH config-epoch
π DESCRIPTION π
So here's the tea π β this command sets a specific config epoch on a fresh node. It is not just out here doing whatever, though. It only works when:
- The nodes table of the node is empty.
- The node's current config epoch is zero.
bestie these prerequisites are NOT optional, they're literally the whole vibe check π«Ά
Why so strict? Because normally, manually altering a node's configuration epoch is unsafe π. Like, no cap, it's a bad idea. What we're trying to protect is the rule that the node with the higher configuration epoch value β the one that's the last that failed over β wins over the other nodes when it comes to claiming hash slots ownership. That's the whole point of the number going up, it's giving main character energy in the slot-claiming arena π
BUT β and this is the exception, so listen up π₯ β it's different when a new cluster is created from scratch. The Valkey Cluster config epoch collision resolution algorithm can deal with new nodes all configured with the same configuration at startup, but honestly? That process is slow, and it should be the exception. It exists basically just to make sure that whatever happens, two or more nodes eventually always move away from the state of having the same configuration epoch. So it's a safety net, not the plan. π§
Which brings us to us β¨ 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. Iconic. Clean. Slay. π
π REPLY π
valkey-protocol(7) Simple string reply: OK if the command was successful. Otherwise an error is returned. so basically it either ate or it didn't π
β COMPLEXITY β
O(1) β constant time, we love a low-effort queen π
π ACL CATEGORIES π
@admin @dangerous @slow
not me being @dangerous π yeah bestie, respect the badge, this one's got teeth.
π HISTORY π
- Available since:
3.0.0
π« SEE ALSO π«
asking(3valkey), cluster(3valkey), cluster-addslots(3valkey), cluster-addslotsrange(3valkey), cluster-bumpepoch(3valkey), cluster-cancelslotmigrations(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-getslotmigrations(3valkey), cluster-help(3valkey), cluster-info(3valkey), cluster-keyslot(3valkey), cluster-links(3valkey), cluster-meet(3valkey), cluster-migrateslots(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-slot-stats(3valkey), cluster-slots(3valkey), cluster-syncslots(3valkey), readonly(3valkey), readwrite(3valkey)
and that's the whole page, bestie π«Ά this lil beauty is from version 9.0.0, dated 2025-10-21, and it's filed under CLUSTER-...IG-EPOCH(3valkey). go forth and set those epochs responsibly, ily πβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms