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
4c53bab1
Commit
4c53bab1
authored
May 05, 2016
by
antirez
Browse files
Cluster test 12: reshard back just a few slots to speedup the test.
parent
971e3c51
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/cluster/tests/12-replica-migration-2.tcl
View file @
4c53bab1
...
...
@@ -6,21 +6,21 @@
source
"../tests/includes/init-tests.tcl"
# Create a cluster with 5 master and 1
0
slaves,
s
o
that we have 2
#
slaves for each master
.
# Create a cluster with 5 master and 1
5
slaves,
t
o
make sure there are no
#
empty masters and make rebalancing simpler to handle during the test
.
test
"Create a 5 nodes cluster"
{
create_cluster 5 1
0
create_cluster 5 1
5
}
test
"Cluster is up"
{
assert_cluster_state ok
}
test
"Each master should have two replicas attached"
{
test
"Each master should have
at least
two replicas attached"
{
foreach_redis_id id
{
if
{
$id
< 5
}
{
wait_for_condition 1000 50
{
[
llength
[
lindex
[
R 0 role
]
2
]]
=
= 2
[
llength
[
lindex
[
R 0 role
]
2
]]
>
= 2
}
else
{
fail
"Master #
$id
does not have 2 slaves as expected"
}
...
...
@@ -44,13 +44,13 @@ test "Master #0 should lose its replicas" {
}
}
test
"Resharding
all the master #0 slots back to it
"
{
test
"Resharding
back some slot to master #0
"
{
# Wait for the cluster config to propagate before attempting a
# new resharding.
after 10000
set output
[
exec
\
../../../src/redis-trib.rb rebalance
\
--weight $
{
master0_id
}
=1
\
--weight $
{
master0_id
}
=
.0
1
\
--use-empty-masters
\
127.0.0.1:
[
get_instance_attrib redis 0 port
]
>@ stdout
]
}
...
...
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