From 203b12e41ff7981f0fae5b23819f072d61594813 Mon Sep 17 00:00:00 2001 From: Ping Xie Date: Wed, 16 Nov 2022 19:24:18 -0800 Subject: 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. --- src/commands/cluster-myshardid.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/commands/cluster-myshardid.json (limited to 'src/commands') 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" + ] + } +} -- cgit v1.2.1