CLUSTER-SLAVES(3valkey)

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

πŸ’… CLUSTER-SLAVES β€” the valkey command manual, but make it make sense

okay bestie, sit down, hydrate, and let's talk about CLUSTER-SLAVES β€” a lil command from the Valkey Command Manual that goes and finds all the replica nodes chilling under one primary node. it's giving ✨inventory check✨. it's also giving deprecated, but we'll get to that. 🫢


✨ NAME ✨

cluster-slaves β€” lists the replica nodes of a primary node. that's it, that's the whole job. πŸ’–


🌸 SYNOPSIS 🌸

CLUSTER SLAVES node-id

one arg, one dream. you hand it a node-id, it hands you a list. no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

first things first, and this is important, so listen up: a note about the word slave used in this man page and in the command name β€” the Valkey project no longer uses the words β€œmaster” and β€œslave”. please use the new command CLUSTER REPLICAS. the command CLUSTER SLAVES will continue to work for backward compatibility, so nothing's breaking, it's just... an old nickname we don't use anymore. πŸ₯²

so, what does it actually do? the command provides a list of replica nodes replicating from the specified primary node. the list is provided in the same format used by CLUSTER NODES (please refer to its documentation for the specification of the format). so if you already know that format, you're set β€” it's the same vibe, just filtered down to the replicas of one primary. πŸ‘‘

the command will fail if the specified node is not known or if it is not a primary according to the node table of the node receiving the command. so like, don't ask it about a replica and expect replicas back. it's not gonna do that. πŸ’€

and now the caveat, because there's always one: note that if a replica is added, moved, or removed from a given primary node, and we ask CLUSTER SLAVES to a node that has not yet received the configuration update, it may show stale information. however eventually (in a matter of seconds if there are no network partitions) all the nodes will agree about the set of nodes associated with a given primary. so it's not wrong forever, it's just wrong for a sec. gossip takes a minute to travel, bestie. 🫧


πŸ’œ REPLY πŸ’œ

valkey-protocol(7) Array reply: a list of replica nodes replicating from the specified primary node provided in the same format used by CLUSTER NODES.

an array. of replica nodes. in the CLUSTER NODES format. iconic behavior, honestly. 🌈


⭐ COMPLEXITY ⭐

O(N) where N is the number of replicas.

linear, babes. more replicas = more walking. no magic shortcuts here. πŸšΆβ€β™€οΈ


πŸŽ€ ACL CATEGORIES πŸŽ€

@admin @dangerous @slow

yeah she's in the dangerous club and she's slow. respect her for it. 😌


🧚 HISTORY 🧚

  • Available since: 3.0.0

an elder. been here since day one-ish. πŸ‘‘


πŸ’€ NOTES πŸ’€

This command is deprecated (since 5.0.0) and replaced by CLUSTER REPLICAS.

fr fr, if you're writing new code, use CLUSTER REPLICAS. CLUSTER SLAVES still works for backward compatibility, but it's the old name and the docs are literally telling you to move on. we love growth. πŸ¦‹


🌸 SEE ALSO 🌸

go read these too, bestie, they're all part of the same friend group:


okay that's the whole page, you ate it, congrats. πŸ’… this was Valkey version 9.0.0, dated 2025-10-21, brought to you by the CLUSTER-SLAVES(3valkey) page herself. go use CLUSTER REPLICAS and make her proud. 🫢✨

πŸ“¦ where this page comes from