summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorPing Xie <pingxie@google.com>2022-11-16 19:24:18 -0800
committerGitHub <noreply@github.com>2022-11-16 19:24:18 -0800
commit203b12e41ff7981f0fae5b23819f072d61594813 (patch)
treeff5f2f829bbfcc6928190a01d401ee4b1ebbaf9e /src/commands
parent2168ccc661791ced6271c5e4ab0f5eb60b1559e2 (diff)
downloadredis-203b12e41ff7981f0fae5b23819f072d61594813.tar.gz
Introduce Shard IDs to logically group nodes in cluster mode (#10536)
Introduce Shard IDs to logically group nodes in cluster mode. 1. Added a new "shard_id" field to "cluster nodes" output and nodes.conf after "hostname" 2. Added a new PING extension to propagate "shard_id" 3. Handled upgrade from pre-7.2 releases automatically 4. Refactored PING extension assembling/parsing logic Behavior of Shard IDs: Replicas will always follow the shards of their reported primaries. If a primary updates its shard ID, the replica will follow. (This need not follow for cluster v2) This is not an expected use case.
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/cluster-myshardid.json18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/commands/cluster-myshardid.json b/src/commands/cluster-myshardid.json
new file mode 100644
index 000000000..ffd26eec6
--- /dev/null
+++ b/src/commands/cluster-myshardid.json
@@ -0,0 +1,18 @@
+{
+ "MYSHARDID": {
+ "summary": "Return the node shard id",
+ "complexity": "O(1)",
+ "group": "cluster",
+ "since": "7.2.0",
+ "arity": 2,
+ "container": "CLUSTER",
+ "function": "clusterCommand",
+ "history": [],
+ "command_flags": [
+ "STALE"
+ ],
+ "command_tips": [
+ "NONDETERMINISTIC_OUTPUT"
+ ]
+ }
+}