-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Dict with Rax for Cluster Nodes
Replace Dict with Rax for Cluster Nodes and construct primaries list on the go, instead of maintaining shards/masters list. Signed-off-by: Ram Prasad Voleti <[email protected]>
- Loading branch information
Ram Prasad Voleti
committed
Jul 5, 2024
1 parent
622a1bf
commit 45b7926
Showing
8 changed files
with
211 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
start_cluster 4 4 {tags {external:skip cluster}} { | ||
test "Deterministic order of CLUSTER SHARDS response" { | ||
set node_ids {} | ||
for {set j 0} {$j < 8} {incr j} { | ||
set shards_cfg [R $j CLUSTER SHARDS] | ||
set i 0 | ||
foreach shard_cfg $shards_cfg { | ||
set nodes [dict get $shard_cfg nodes] | ||
foreach node $nodes { | ||
if {$j == 0} { | ||
# Save the node ids from the first node response | ||
dict set node_ids $i [dict get $node id] | ||
} else { | ||
# Verify the order of the node ids is the same as the first node response | ||
assert_equal [dict get $node id] [dict get $node_ids $i] | ||
} | ||
incr i | ||
} | ||
} | ||
} | ||
} | ||
} |