CLUSTER-...IG-EPOCH(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ 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:

  1. The nodes table of the node is empty.
  2. 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