Fix CLUSTER SHARDS command returns empty array (#13422)

Close https://github.com/redis/redis/issues/13414

When the cluster's master node fails and is switched to another node,
the first node in the shard node list (the old master) is no longer
valid.
Add a new method clusterGetMasterFromShard() to obtain the current
master.
This commit is contained in:
debing.sun
2025-01-06 16:03:47 +02:00
committed by YaacovHazan
parent 0e06e67a36
commit f4a6721dfd
2 changed files with 23 additions and 4 deletions
@@ -124,6 +124,10 @@ test "Verify health as fail for killed node" {
}
}
test "Verify that other nodes can correctly output the new master's slots" {
assert_not_equal {} [dict get [get_node_info_from_shard [R 4 CLUSTER MYID] 8 "shard"] slots]
}
set primary_id 4
set replica_id 0