summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2022-01-17 14:11:11 +0200
committerGitHub <noreply@github.com>2022-01-17 14:11:11 +0200
commitae89958972ee720be2bff68231d6353553c2272a (patch)
treed0cc61d5bc718b7c5077e5746abb802184423851 /tests/support
parent90916f16a5536bc833529d2e563d1094433de495 (diff)
downloadredis-ae89958972ee720be2bff68231d6353553c2272a.tar.gz
Set repl-diskless-sync to yes by default, add repl-diskless-sync-max-replicas (#10092)
1. enable diskless replication by default 2. add a new config named repl-diskless-sync-max-replicas that enables replication to start before the full repl-diskless-sync-delay was reached. 3. put replica online sooner on the master (see below) 4. test suite uses repl-diskless-sync-delay of 0 to be faster 5. a few tests that use multiple replica on a pre-populated master, are now using the new repl-diskless-sync-max-replicas 6. fix possible timing issues in a few cluster tests (see below) put replica online sooner on the master ---------------------------------------------------- there were two tests that failed because they needed for the master to realize that the replica is online, but the test code was actually only waiting for the replica to realize it's online, and in diskless it could have been before the master realized it. changes include two things: 1. the tests wait on the right thing 2. issues in the master, putting the replica online in two steps. the master used to put the replica as online in 2 steps. the first step was to mark it as online, and the second step was to enable the write event (only after getting ACK), but in fact the first step didn't contains some of the tasks to put it online (like updating good slave count, and sending the module event). this meant that if a test was waiting to see that the replica is online form the point of view of the master, and then confirm that the module got an event, or that the master has enough good replicas, it could fail due to timing issues. so now the full effect of putting the replica online, happens at once, and only the part about enabling the writes is delayed till the ACK. fix cluster tests -------------------- I added some code to wait for the replica to sync and avoid race conditions. later realized the sentinel and cluster tests where using the original 5 seconds delay, so changed it to 0. this means the other changes are probably not needed, but i suppose they're still better (avoid race conditions)
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/util.tcl8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/support/util.tcl b/tests/support/util.tcl
index 24199077d..5fc319254 100644
--- a/tests/support/util.tcl
+++ b/tests/support/util.tcl
@@ -118,6 +118,14 @@ proc wait_for_sync r {
}
}
+proc wait_replica_online r {
+ wait_for_condition 50 100 {
+ [string match "*slave0:*,state=online*" [$r info replication]]
+ } else {
+ fail "replica didn't sync in time"
+ }
+}
+
proc wait_for_ofs_sync {r1 r2} {
wait_for_condition 50 100 {
[status $r1 master_repl_offset] eq [status $r2 master_repl_offset]