summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-08-04 13:14:25 +0200
committerantirez <antirez@gmail.com>2015-08-04 13:14:25 +0200
commitd1ff328170a161fc002e47954e5dd0e0989d2ce9 (patch)
tree382f92cc68b4226af189bd897a54983b1cf9b414
parent6233d210cd624ba3645426f1a6b52f5de0388dc1 (diff)
downloadredis-d1ff328170a161fc002e47954e5dd0e0989d2ce9.tar.gz
Test PSYNC with diskless replication.
Thanks to Oran Agra from Redis Labs for providing this patch.
-rw-r--r--tests/integration/replication-psync.tcl30
1 files changed, 17 insertions, 13 deletions
diff --git a/tests/integration/replication-psync.tcl b/tests/integration/replication-psync.tcl
index f131dafe3..a7d1e6b8c 100644
--- a/tests/integration/replication-psync.tcl
+++ b/tests/integration/replication-psync.tcl
@@ -13,7 +13,7 @@ proc stop_bg_complex_data {handle} {
#
# You can specifiy backlog size, ttl, delay before reconnection, test duration
# in seconds, and an additional condition to verify at the end.
-proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
+proc test_psync {descr duration backlog_size backlog_ttl delay cond diskless} {
start_server {tags {"repl"}} {
start_server {} {
@@ -24,6 +24,8 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
$master config set repl-backlog-size $backlog_size
$master config set repl-backlog-ttl $backlog_ttl
+ $master config set repl-diskless-sync $diskless
+ $master config set repl-diskless-sync-delay 1
set load_handle0 [start_bg_complex_data $master_host $master_port 9 100000]
set load_handle1 [start_bg_complex_data $master_host $master_port 11 100000]
@@ -48,7 +50,7 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
}
}
- test "Test replication partial resync: $descr" {
+ test "Test replication partial resync: $descr (diskless: $diskless)" {
# Now while the clients are writing data, break the maste-slave
# link multiple times.
for {set j 0} {$j < $duration*10} {incr j} {
@@ -98,18 +100,20 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond} {
}
}
-test_psync {ok psync} 6 1000000 3600 0 {
- assert {[s -1 sync_partial_ok] > 0}
-}
+foreach diskless {no yes} {
+ test_psync {ok psync} 6 1000000 3600 0 {
+ assert {[s -1 sync_partial_ok] > 0}
+ } $diskless
-test_psync {no backlog} 6 100 3600 0.5 {
- assert {[s -1 sync_partial_err] > 0}
-}
+ test_psync {no backlog} 6 100 3600 0.5 {
+ assert {[s -1 sync_partial_err] > 0}
+ } $diskless
-test_psync {ok after delay} 3 100000000 3600 3 {
- assert {[s -1 sync_partial_ok] > 0}
-}
+ test_psync {ok after delay} 3 100000000 3600 3 {
+ assert {[s -1 sync_partial_ok] > 0}
+ } $diskless
-test_psync {backlog expired} 3 100000000 1 3 {
- assert {[s -1 sync_partial_err] > 0}
+ test_psync {backlog expired} 3 100000000 1 3 {
+ assert {[s -1 sync_partial_err] > 0}
+ } $diskless
}