Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9e422f74
Commit
9e422f74
authored
Apr 29, 2014
by
antirez
Browse files
Cluster test: config epoch conflict resolution.
parent
2c556223
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/cluster/tests/00-base.tcl
View file @
9e422f74
...
@@ -50,3 +50,27 @@ test "Check if nodes auto-discovery works" {
...
@@ -50,3 +50,27 @@ test "Check if nodes auto-discovery works" {
}
}
}
}
}
}
test
"After the join, every node gets a different config epoch"
{
set trynum 60
while
{[
incr trynum -1
]
!= 0
}
{
# We check that this condition is true for *all* the nodes.
set ok 1
;
# Will be set to 0 every time a node is not ok.
foreach_redis_id id
{
set epochs
{}
foreach n
[
get_cluster_nodes $id
]
{
lappend epochs
[
dict get $n config_epoch
]
}
if
{[
lsort $epochs
]
!=
[
lsort -unique $epochs
]}
{
set ok 0
;
# At least one collision!
}
}
if
{
$ok
}
break
after 1000
puts -nonewline .
flush stdout
}
if
{
$trynum
== 0
}
{
fail
"Config epoch conflict resolution is not working."
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment