CLUSTER-RESET(3valkey)
β¨ 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 usingvalkey-flushall(7)FLUSHALLfirst, and thenCLUSTER RESET. no skipping steps, i'm serious π
Effects on the node π¦
here's literally everything that happens, in order, no cap:
- All the other nodes in the cluster are forgotten.
- All the assigned / open slots are reset, so the slots-to-nodes mapping is totally cleared.
- 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.
- Hard reset only: a new Node ID is generated.
- Hard reset only:
currentEpochandconfigEpochvars are set to0. - 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 β
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-saveconfig(3valkey)cluster-set-config-epoch(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 one's from Valkey9.0.0, dated2025-10-21. go reset something responsibly (or don't, i'm not your mom) πβ¨π
π¦ 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