From 25e40de31d9f163aa0479567de8e92a3141355ed Mon Sep 17 00:00:00 2001 From: Roshan Khatri <117414976+roshkhatri@users.noreply.github.com> Date: Thu, 25 Jul 2024 11:21:16 -0700 Subject: [PATCH 1/3] Update cluster-slots ref: https://github.com/valkey-io/valkey/pull/265 Signed-off-by: Roshan Khatri --- commands/cluster-slots.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/cluster-slots.md b/commands/cluster-slots.md index a09dde62..0abc2b94 100644 --- a/commands/cluster-slots.md +++ b/commands/cluster-slots.md @@ -34,7 +34,8 @@ Each nested result is: - ...continues until all replicas for this master are returned. Each result includes all active replicas of the master instance -for the listed slot range. Failed replicas are not returned. +for the listed slot range. These active replicas are ordered deterministically. +Failed replicas are not returned. The third nested reply is guaranteed to be the networking information of the master instance for the slot range. All networking information after the third nested reply are replicas of the master. From 95ba3e81f58173c98d7e135455ea58226222d925 Mon Sep 17 00:00:00 2001 From: Roshan Khatri Date: Thu, 25 Jul 2024 22:30:25 +0000 Subject: [PATCH 2/3] update Signed-off-by: Roshan Khatri --- commands/cluster-slots.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commands/cluster-slots.md b/commands/cluster-slots.md index 0abc2b94..37d7d647 100644 --- a/commands/cluster-slots.md +++ b/commands/cluster-slots.md @@ -1,4 +1,4 @@ -`CLUSTER SLOTS` returns details about which cluster slots map to which Valkey instances. +`CLUSTER SLOTS` returns details about which cluster slots map to which Valkey instances.The command response is deterministic across all nodes in a cluster and is ordered lexicographically. The command is suitable to be used by Valkey Cluster client libraries implementations in order to retrieve (or update when a redirection is received) the map associating cluster *hash slots* with actual nodes network information, so that when a command is received, it can be sent to what is likely the right instance for the keys specified in the command. The networking information for each node is an array containing the following elements: @@ -34,8 +34,7 @@ Each nested result is: - ...continues until all replicas for this master are returned. Each result includes all active replicas of the master instance -for the listed slot range. These active replicas are ordered deterministically. -Failed replicas are not returned. +for the listed slot range. Failed replicas are not returned. The third nested reply is guaranteed to be the networking information of the master instance for the slot range. All networking information after the third nested reply are replicas of the master. From fd7d6da17b93f5bcd158a7f149a6a0b3f3e5973c Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Fri, 26 Jul 2024 13:05:02 -0700 Subject: [PATCH 3/3] Apply suggestions from code review Signed-off-by: Madelyn Olson --- commands/cluster-slots.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/cluster-slots.md b/commands/cluster-slots.md index 37d7d647..2babfe2d 100644 --- a/commands/cluster-slots.md +++ b/commands/cluster-slots.md @@ -1,4 +1,4 @@ -`CLUSTER SLOTS` returns details about which cluster slots map to which Valkey instances.The command response is deterministic across all nodes in a cluster and is ordered lexicographically. +`CLUSTER SLOTS` returns details about which cluster slots map to which Valkey instances. The command is suitable to be used by Valkey Cluster client libraries implementations in order to retrieve (or update when a redirection is received) the map associating cluster *hash slots* with actual nodes network information, so that when a command is received, it can be sent to what is likely the right instance for the keys specified in the command. The networking information for each node is an array containing the following elements: @@ -36,6 +36,8 @@ Each nested result is: Each result includes all active replicas of the master instance for the listed slot range. Failed replicas are not returned. +The command response is deterministic across all nodes in a cluster, which means that if two nodes return the same response they have the same view of the cluster. +Primaries are ordered by the slots they serve and then replicas are ordered lexicographically by the node-id they were assigned by the cluster. The third nested reply is guaranteed to be the networking information of the master instance for the slot range. All networking information after the third nested reply are replicas of the master.