mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
PSYNC test: also test the vanilla SYNC.
This commit is contained in:
parent
62b5c60ead
commit
76e0be416d
@ -13,7 +13,11 @@ proc stop_bg_complex_data {handle} {
|
|||||||
#
|
#
|
||||||
# You can specifiy backlog size, ttl, delay before reconnection, test duration
|
# You can specifiy backlog size, ttl, delay before reconnection, test duration
|
||||||
# in seconds, and an additional condition to verify at the end.
|
# in seconds, and an additional condition to verify at the end.
|
||||||
proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless} {
|
#
|
||||||
|
# If reconnect is > 0, the test actually try to break the connection and
|
||||||
|
# reconnect with the master, otherwise just the initial synchronization is
|
||||||
|
# checked for consistency.
|
||||||
|
proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless reconnect} {
|
||||||
start_server {tags {"repl"}} {
|
start_server {tags {"repl"}} {
|
||||||
start_server {} {
|
start_server {} {
|
||||||
|
|
||||||
@ -50,9 +54,10 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test "Test replication partial resync: $descr (diskless: $diskless)" {
|
test "Test replication partial resync: $descr (diskless: $diskless, reconnect: $reconnect)" {
|
||||||
# Now while the clients are writing data, break the maste-slave
|
# Now while the clients are writing data, break the maste-slave
|
||||||
# link multiple times.
|
# link multiple times.
|
||||||
|
if ($reconnect) {
|
||||||
for {set j 0} {$j < $duration*10} {incr j} {
|
for {set j 0} {$j < $duration*10} {incr j} {
|
||||||
after 100
|
after 100
|
||||||
# catch {puts "MASTER [$master dbsize] keys, SLAVE [$slave dbsize] keys"}
|
# catch {puts "MASTER [$master dbsize] keys, SLAVE [$slave dbsize] keys"}
|
||||||
@ -70,6 +75,7 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
stop_bg_complex_data $load_handle0
|
stop_bg_complex_data $load_handle0
|
||||||
stop_bg_complex_data $load_handle1
|
stop_bg_complex_data $load_handle1
|
||||||
stop_bg_complex_data $load_handle2
|
stop_bg_complex_data $load_handle2
|
||||||
@ -101,19 +107,22 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach diskless {no yes} {
|
foreach diskless {no yes} {
|
||||||
|
test_psync {no reconnection, just sync} 6 1000000 3600 0 {
|
||||||
|
} $diskless 0
|
||||||
|
|
||||||
test_psync {ok psync} 6 1000000 3600 0 {
|
test_psync {ok psync} 6 1000000 3600 0 {
|
||||||
assert {[s -1 sync_partial_ok] > 0}
|
assert {[s -1 sync_partial_ok] > 0}
|
||||||
} $diskless
|
} $diskless 1
|
||||||
|
|
||||||
test_psync {no backlog} 6 100 3600 0.5 {
|
test_psync {no backlog} 6 100 3600 0.5 {
|
||||||
assert {[s -1 sync_partial_err] > 0}
|
assert {[s -1 sync_partial_err] > 0}
|
||||||
} $diskless
|
} $diskless 1
|
||||||
|
|
||||||
test_psync {ok after delay} 3 100000000 3600 3 {
|
test_psync {ok after delay} 3 100000000 3600 3 {
|
||||||
assert {[s -1 sync_partial_ok] > 0}
|
assert {[s -1 sync_partial_ok] > 0}
|
||||||
} $diskless
|
} $diskless 1
|
||||||
|
|
||||||
test_psync {backlog expired} 3 100000000 1 3 {
|
test_psync {backlog expired} 3 100000000 1 3 {
|
||||||
assert {[s -1 sync_partial_err] > 0}
|
assert {[s -1 sync_partial_err] > 0}
|
||||||
} $diskless
|
} $diskless 1
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user