CLUSTER-RESET(3valkey)

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

✨ CLUSTER-RESET ✨

okay bestie so this is the cluster-reset page from the Valkey Command Manual and it's genuinely one of those commands that's like… a lil dramatic πŸ’…. it resets a node. that's the whole vibe.


🌸 NAME 🌸

cluster-reset β€” resets a node. yes that's it, that's the whole name, she's simple and she's powerful 🫢


✨ SYNOPSIS ✨

CLUSTER RESET [HARD | SOFT]

πŸ’– DESCRIPTION πŸ’–

so basically you're resetting a Valkey Cluster node, and how drastic it is depends on the reset type β€” it can be hard or soft. pick your fighter, bestie.

⚠️ real talk tho: this command does NOT work for primaries if they're holding one or more keys. like, at all. if you wanna completely reset a primary node you have to remove its keys first β€” for example by using valkey-flushall(7) FLUSHALL first, and then CLUSTER RESET. no skipping steps, i'm serious 😭

Effects on the node πŸ¦‹

here's literally everything that happens, in order, no cap:

  1. All the other nodes in the cluster are forgotten.
  2. All the assigned / open slots are reset, so the slots-to-nodes mapping is totally cleared.
  3. If the node is a replica it is turned into an (empty) primary. Its dataset is flushed, so at the end the node will be an empty primary.
  4. Hard reset only: a new Node ID is generated.
  5. Hard reset only: currentEpoch and configEpoch vars are set to 0.
  6. The new configuration is persisted on disk in the node cluster configuration file.

so what's the point of all this? mainly re-provisioning a Valkey Cluster node so you can use it in a whole new, different cluster. it's giving main character makeover energy πŸ’…βœ¨. and it's also extensively used by the Valkey Cluster testing framework to reset the state of the cluster every time a new test unit is executed β€” the test girlies are obsessed with it, fr fr.

and if you don't specify a reset type? the default is soft. so chill. 🌸


πŸŽ€ REPLY πŸŽ€

valkey-protocol(7) Simple string reply: OK if the command was successful. Otherwise an error is returned.


🌈 COMPLEXITY 🌈

O(N) where N is the number of known nodes. and heads up β€” the command may execute a FLUSHALL as a side effect. yeah. she can do that. 😳


πŸ‘‘ ACL CATEGORIES πŸ‘‘

  • @admin
  • @dangerous
  • @slow

πŸ¦‹ HISTORY πŸ¦‹

  • Available since: 3.0.0

⭐ SEE ALSO ⭐


and that's the whole page bestie 🫢 this one's from Valkey 9.0.0, dated 2025-10-21. go reset something responsibly (or don't, i'm not your mom) πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from