From 9e1a00d663c9212e6e992feb690089a5eac686f3 Mon Sep 17 00:00:00 2001 From: Binbin Date: Thu, 22 Dec 2022 20:23:14 +0800 Subject: [PATCH] Fix race in PSYNC2 partial resync test (#11653) This test sometimes fails: ``` *** [err]: PSYNC2: Partial resync after Master restart using RDB aux fields with expire in tests/integration/psync2-master-restart.tcl Expected [status ::redis::redisHandle24 sync_partial_ok] == 1 (context: type eval line 49 cmd {assert {[status $replica sync_partial_ok] == 1}} proc ::test) ``` This is because the default repl-timeout value is 10s, sometimes the test got timeout, then it will do a reconnect, it will incr the sync_partial_ok counter, and then cause the test to fail.In this fix, we set the repl-timeout to a very large number to make sure we won't get the timeout. --- tests/integration/psync2-master-restart.tcl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/integration/psync2-master-restart.tcl b/tests/integration/psync2-master-restart.tcl index c0c8f471f..03470bf81 100644 --- a/tests/integration/psync2-master-restart.tcl +++ b/tests/integration/psync2-master-restart.tcl @@ -11,6 +11,13 @@ start_server {} { set sub_replica [srv -2 client] + # Because we will test partial resync later, we don’t want a timeout to cause + # the master-replica disconnect, then the extra reconnections will break the + # sync_partial_ok stat test + $master config set repl-timeout 3600 + $replica config set repl-timeout 3600 + $sub_replica config set repl-timeout 3600 + # Build replication chain $replica replicaof $master_host $master_port $sub_replica replicaof $replica_host $replica_port