Skip to content

Commit 0b94ca6

Browse files
authored
Stabilize dual replication test to avoid getting LOADING error (valkey-io#1979)
Supplement the repair of valkey-io#1288, need to wait for the Loading to complete before executing `$replica replicaof no one`. Signed-off-by: artikell <739609084@qq.com>
1 parent 05d8fd4 commit 0b94ca6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/integration/dual-channel-replication.tcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ start_server {tags {"dual-channel-replication external:skip"}} {
773773
set load_handle0 [start_write_load $primary_host $primary_port 60]
774774
set load_handle1 [start_write_load $primary_host $primary_port 60]
775775
set load_handle2 [start_write_load $primary_host $primary_port 60]
776+
set replica_loglines [count_log_lines 0]
776777

777778
$replica config set dual-channel-replication-enabled yes
778779
$replica config set loglevel debug
@@ -801,12 +802,14 @@ start_server {tags {"dual-channel-replication external:skip"}} {
801802
# In this way, in the subsequent replicaof no one, we won't get the LOADING error if the replica reconnects
802803
# too quickly and enters the loading state.
803804
$primary debug pause-after-fork 1
805+
set replica_loglines [count_log_lines 0]
804806
resume_process $replica_pid
805807
set res [wait_for_log_messages -1 {"*Unable to partial resync with replica * for lack of backlog*"} $loglines 2000 10]
806808
set loglines [lindex $res 1]
807809
}
808810
# Waiting for the primary to enter the paused state, that is, make sure that bgsave is triggered.
809811
wait_process_paused -1
812+
wait_for_log_messages 0 {"*Done loading RDB*"} $replica_loglines 1000 10
810813
$replica replicaof no one
811814
# Resume the primary and make sure the sync is dropped.
812815
resume_process [srv -1 pid]

0 commit comments

Comments
 (0)