Skip to content

Commit

Permalink
Deflake test "Psync established after RDB load - beyond grace period"
Browse files Browse the repository at this point in the history
*** [err]: Psync established after RDB load - beyond grace period in tests/integration/dual-channel-replication.tcl
log message of '"*Replica main channel failed to establish PSYNC within the grace period*"' not found in ./tests/tmp/server.7063.182/stdout after line: 0 till line: 196

Signed-off-by: naglera <[email protected]>
  • Loading branch information
naglera committed Jul 18, 2024
1 parent 8b48031 commit 4bd8d70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/helpers/bg_server_sleep.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source tests/support/util.tcl
proc bg_server_sleep {host port sec} {
set r [valkey $host $port 0]
$r client setname SLEEP_HANDLER
$r debug sleep $sec
catch {$r debug sleep $sec}
}

bg_server_sleep [lindex $argv 0] [lindex $argv 1] [lindex $argv 2]
11 changes: 4 additions & 7 deletions tests/integration/dual-channel-replication.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,9 @@ start_server {tags {"dual-channel-replication external:skip"}} {
set loglines [lindex $res 1]
incr $loglines
# At this point rdb is loaded but psync hasn't been established yet.
# Force the replica to sleep for 8 seconds so the primary main process will wake up, while the replica is unresponsive.
# Force the replica to sleep so the primary main process will wake up, while the replica is unresponsive.
# We expect the grace time to be over before the replica wake up, so sync will fail.
set sleep_handle [start_bg_server_sleep $replica_host $replica_port 8]
set sleep_handle [start_bg_server_sleep $replica_host $replica_port 1000]
wait_for_condition 50 100 {
[string match {*replicas_waiting_psync:1*} [$primary info replication]]
} else {
Expand All @@ -642,15 +642,12 @@ start_server {tags {"dual-channel-replication external:skip"}} {

# Sync should fail once the replica ask for PSYNC using main channel
set res [wait_for_log_messages -1 {"*Replica main channel failed to establish PSYNC within the grace period*"} 0 4000 1]

# Should succeed on retry
verify_replica_online $primary 0 500
wait_for_condition 50 100 {
[string match {*replicas_waiting_psync:0*} [$primary info replication]]
} else {
fail "Primary did not free repl buf block after psync establishment"
fail "Primary did not free waiting psync replica after grace period"
}
$replica replicaof no one
stop_bg_server_sleep $sleep_handle
}
stop_write_load $load_handle0
}
Expand Down

0 comments on commit 4bd8d70

Please sign in to comment.