From d57bc038146ed7a46206a4a841f299e013289ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Thu, 11 Sep 2025 18:14:16 +0200 Subject: [PATCH 1/2] Mention that IPv6 addresses are *not* enclosed in brackets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Viktor Söderqvist --- commands/client-capa.md | 1 + commands/cluster-nodes.md | 3 +++ topics/cluster-spec.md | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/commands/client-capa.md b/commands/client-capa.md index fafd3370..6deccd38 100644 --- a/commands/client-capa.md +++ b/commands/client-capa.md @@ -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. diff --git a/commands/cluster-nodes.md b/commands/cluster-nodes.md index 3376b32f..a9c5b232 100644 --- a/commands/cluster-nodes.md +++ b/commands/cluster-nodes.md @@ -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. diff --git a/topics/cluster-spec.md b/topics/cluster-spec.md index 8913551c..561f50a4 100644 --- a/topics/cluster-spec.md +++ b/topics/cluster-spec.md @@ -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 From a9aaaa78c36ede14257679ea2a28d816811e24fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Fri, 12 Sep 2025 11:32:32 +0200 Subject: [PATCH 2/2] Add URIs to wordlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Viktor Söderqvist --- wordlist | 1 + 1 file changed, 1 insertion(+) diff --git a/wordlist b/wordlist index dda5e4aa..ce95d685 100644 --- a/wordlist +++ b/wordlist @@ -926,6 +926,7 @@ Unwatches unwatches uppercased urandom +URIs used_memory_scripts_eval userSession usr