Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions commands/client-capa.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ The capabilities currently supported are:
* `redirect` - This indicates that the client is capable of handling redirect messages.
When accessing a replica node in standalone mode, if a data operation is performed (read or write commands),
Valkey will return `-REDIRECT primary-ip:port` to this connection.
Note that the `primary-ip` can be an IPv6 which itself contains colons, so to properly parse ip and port, a client needs to locate the *last* colon.
Using the [`READONLY`](readonly.md) command can enable this connection to execute read commands on the replica node.
3 changes: 3 additions & 0 deletions commands/cluster-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ The meaning of each field is the following:
1. `id`: The node ID, a 40-character globally unique string generated when a node is created and never changed again (unless [`CLUSTER RESET HARD`](cluster-reset.md) is used).
2. `ip:port@cport`: The node address that clients should contact to run queries, along with the used cluster bus port.
`:0@0` can be expected when the address is no longer known for this node ID, hence flagged with `noaddr`.
Note that `ip` can be an IPv6 address, which can contain multiple colons.
Here, an IPv6 address is *not* enclosed in square brackets as it would be in other contexts such as URIs.
To properly split the `ip:port@cport` into `ip` and `port@cport`, you need to locate the *last* colon.
3. `hostname`: A human readable string that can be configured via the `cluster-annouce-hostname` setting. The max length of the string is 256 characters, excluding the null terminator. The name can contain ASCII alphanumeric characters, '-', and '.' only.
5. `flags`: A list of comma separated flags: `myself`, `master`, `slave`, `fail?`, `fail`, `handshake`, `noaddr`, `nofailover`, `noflags`. Flags are explained below.
6. `master`: If the node is a replica, and the primary is known, the primary node ID, otherwise the "-" character.
Expand Down
4 changes: 4 additions & 0 deletions topics/cluster-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ The client needs to reissue the query to the specified node's endpoint address a
The endpoint can be either an IP address, a hostname, or it can be empty (e.g. `-MOVED 3999 :6380`).
An empty endpoint indicates that the server node has an unknown endpoint, and the client should send the next request to the same endpoint as the current request but with the provided port.

The endpoint can be an IPv6 address, which can contain multiple colons.
Here, an IPv6 address is *not* enclosed in square brackets as it would be in other contexts such as URIs.
To properly split the string `endpoint:port` into `endpoint` and `port`, a cluster client needs to locate the *last* colon.

Note that even if the client waits a long time before reissuing the query,
and in the meantime the cluster configuration changed, the destination node
will reply again with a MOVED error if the hash slot 3999 is now served by
Expand Down
1 change: 1 addition & 0 deletions wordlist
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ Unwatches
unwatches
uppercased
urandom
URIs
used_memory_scripts_eval
userSession
usr
Expand Down