You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: commands/cluster-shards.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ A client should issue this command on startup in order to retrieve the map assoc
8
8
This map should be used to direct commands to the node that is likely serving the slot associated with a given command.
9
9
In the event the command is sent to the wrong node, in that it received a '-MOVED' redirect, this command can then be used to update the topology of the cluster.
10
10
11
-
The command returns an array of shards, with each shard containing two fields, 'slots'and 'nodes'.
11
+
The command returns an array of shards, with each shard containing three fields, 'slots', 'nodes' and 'id'.
12
12
13
13
The 'slots' field is a list of slot ranges served by this shard, stored as pair of integers representing the inclusive start and end slots of the ranges.
14
14
For example, if a node owns the slots 1, 2, 3, 5, 7, 8 and 9, the slots ranges would be stored as [1-3], [5-5], [7-9].
@@ -48,6 +48,8 @@ This can happen in a cluster that consists of only one node or the node has not
48
48
The value `?` is displayed if the node is incorrectly configured to use announced hostnames but no hostname is configured using `cluster-announce-hostname`.
49
49
Clients may treat the empty string in the same way as NULL, that is the same endpoint it used to send the current command to, while `"?"` should be treated as an unknown node, not necessarily the same node as the one serving the current command.
50
50
51
+
The 'id' field is the unique id of the shard, which is randomly generated and 40 characters long.
52
+
51
53
## Examples
52
54
53
55
```
@@ -84,6 +86,8 @@ Clients may treat the empty string in the same way as NULL, that is the same end
84
86
12) (integer) 72156
85
87
13) "health"
86
88
14) "online"
89
+
5) "id"
90
+
6) "cd7688ca959bf54a32569ccf260b26715b82a6e3"
87
91
2) 1) "slots"
88
92
2) 1) (integer) 10923
89
93
2) (integer) 16383
@@ -116,6 +120,8 @@ Clients may treat the empty string in the same way as NULL, that is the same end
116
120
12) (integer) 72156
117
121
13) "health"
118
122
14) "online"
123
+
5) "id"
124
+
6) "0d77234c440a6b05c2d77d1b9f37ac63585fc747"
119
125
3) 1) "slots"
120
126
2) 1) (integer) 5461
121
127
2) (integer) 10922
@@ -148,4 +154,6 @@ Clients may treat the empty string in the same way as NULL, that is the same end
0 commit comments