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
3765a5d9
Commit
3765a5d9
authored
Nov 24, 2014
by
antirez
Browse files
Attempt to prevent false positives in replication test.
parent
9466f3b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/replication.tcl
View file @
3765a5d9
...
@@ -118,7 +118,8 @@ foreach dl {no yes} {
...
@@ -118,7 +118,8 @@ foreach dl {no yes} {
[
lindex $slaves 1
]
slaveof $master_host $master_port
[
lindex $slaves 1
]
slaveof $master_host $master_port
[
lindex $slaves 2
]
slaveof $master_host $master_port
[
lindex $slaves 2
]
slaveof $master_host $master_port
# Wait for all the three slaves to reach the
"online"
state
# Wait for all the three slaves to reach the
"online"
# state from the POV of the master.
set retry 500
set retry 500
while
{
$retry
}
{
while
{
$retry
}
{
set info
[
r -3 info
]
set info
[
r -3 info
]
...
@@ -133,6 +134,17 @@ foreach dl {no yes} {
...
@@ -133,6 +134,17 @@ foreach dl {no yes} {
error
"assertion:Slaves not correctly synchronized"
error
"assertion:Slaves not correctly synchronized"
}
}
# Wait that slaves acknowledge they are online so
# we are sure that DBSIZE and DEBUG DIGEST will not
# fail because of timing issues.
wait_for_condition 500 100
{
[
lindex
[[
lindex $slaves 0
]
role
]
3
]
eq
{
connected
}
&&
[
lindex
[[
lindex $slaves 1
]
role
]
3
]
eq
{
connected
}
&&
[
lindex
[[
lindex $slaves 2
]
role
]
3
]
eq
{
connected
}
}
else
{
fail
"Slaves still not connected after some time"
}
# Stop the write load
# Stop the write load
stop_write_load $load_handle0
stop_write_load $load_handle0
stop_write_load $load_handle1
stop_write_load $load_handle1
...
@@ -140,16 +152,8 @@ foreach dl {no yes} {
...
@@ -140,16 +152,8 @@ foreach dl {no yes} {
stop_write_load $load_handle3
stop_write_load $load_handle3
stop_write_load $load_handle4
stop_write_load $load_handle4
# Wait that slaves exit the
"loading"
state
# Make sure that slaves and master have same
wait_for_condition 500 100
{
# number of keys
!
[
string match
{
*loading:1*
}
[[
lindex $slaves 0
]
info
]]
&&
!
[
string match
{
*loading:1*
}
[[
lindex $slaves 1
]
info
]]
&&
!
[
string match
{
*loading:1*
}
[[
lindex $slaves 2
]
info
]]
}
else
{
fail
"Slaves still loading data after too much time"
}
# Make sure that slaves and master have same number of keys
wait_for_condition 500 100
{
wait_for_condition 500 100
{
[
$master
dbsize
]
==
[[
lindex $slaves 0
]
dbsize
]
&&
[
$master
dbsize
]
==
[[
lindex $slaves 0
]
dbsize
]
&&
[
$master
dbsize
]
==
[[
lindex $slaves 1
]
dbsize
]
&&
[
$master
dbsize
]
==
[[
lindex $slaves 1
]
dbsize
]
&&
...
...
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