Skip to content

Commit 981b8fe

Browse files
Deflakes Primary COB growth with inactive replica (#2715)
Resolves #2696 The primary issue was that with sanitizer mode, the test needed more time for primary’s replication buffers grow beyond `2 × backlog_size`. Increasing the threshold of `repl-timeout` to 30s, ensures that the inactive replica is not disconnected while the full sync is proceeding. `rdb-key-save-delay` controls or throttles the data written to the client output buffer, and in this case, we are deterministically able to perform the fullsync within 10s (10000 keys * 0.001s). Increasing the `wait_for_condition` gives it enough retries to verify that `mem_total_replication_buffers` reaches the required `2 × backlog_size`. Signed-off-by: Sarthak Aggarwal <[email protected]>
1 parent 54da834 commit 981b8fe

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/integration/dual-channel-replication.tcl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,12 @@ start_server {tags {"dual-channel-replication external:skip"}} {
537537
$primary config set repl-timeout 100
538538
$replica config set repl-timeout 100
539539
} else {
540-
$primary config set repl-timeout 10
541-
$replica config set repl-timeout 10
540+
$primary config set repl-timeout 30
541+
$replica config set repl-timeout 30
542542
}
543-
$primary config set rdb-key-save-delay 200
543+
544+
# Avoids timeout by keeping the RDB child alive longer while the replica is inactive
545+
$primary config set rdb-key-save-delay 1000
544546
populate 10000 primary 10000
545547

546548
set load_handle1 [start_one_key_write_load $primary_host $primary_port 100 "mykey1"]
@@ -556,10 +558,11 @@ start_server {tags {"dual-channel-replication external:skip"}} {
556558
test "dual-channel-replication: Primary COB growth with inactive replica" {
557559
$replica replicaof $primary_host $primary_port
558560
# Verify repl backlog can grow
559-
wait_for_condition 1000 10 {
561+
wait_for_condition 2000 10 {
560562
[s 0 mem_total_replication_buffers] > [expr {2 * $backlog_size}]
561563
} else {
562-
fail "Primary should allow backlog to grow beyond its limits during dual-channel-replication sync handshake"
564+
set cur [s 0 mem_total_replication_buffers]
565+
fail "Primary should allow backlog (have=$cur, need>[expr {2 * $backlog_size}]) to grow beyond its limits during dual-channel-replication sync handshake"
563566
}
564567
wait_and_resume_process -1
565568

0 commit comments

Comments
 (0)