Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion tests/integration/replication.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,30 @@ start_server {tags {"repl external:skip"} overrides {save ""}} {
# Let one replica hit repl-timeout while the slow reader
# is paused, then restore a generous timeout so the
# remaining replica can finish the streamed RDB.
#
# The disconnect can land in either of two branches in
# replication.c serverCron (see src/replication.c around
# the "Disconnecting timedout replica" emitters):
# - "(full sync)" WAIT_BGSAVE_END + rdb_child_type == SOCKET
# - "(streaming sync)" REPLICA_STATE_ONLINE
# On some platforms (notably macOS CI) the RDB child can
# exit and clear rdb_child_type in the same serverCron
# tick as the disconnect check, closing the (full sync)
# window; the timed-out replica is by then already
# promoted via replicaPutOnline() and the disconnect
# surfaces on the (streaming sync) path instead. Both
# are legitimate timeout-driven disconnects.
$master config set repl-timeout 2
wait_for_log_messages -2 {"*Disconnecting timedout replica (full sync)*"} $loglines 100 100
if {[catch {
wait_for_log_messages -2 {"*Disconnecting timedout replica (full sync)*"} $loglines 100 100
}]} {
wait_for_log_messages -2 {"*Disconnecting timedout replica (streaming sync)*"} $loglines 100 100
}
# Guard against silently broadening the assertion: the
# slow replica must time out exactly once across both
# branches in this subcase.
assert_equal 1 [count_log_message -2 "Disconnecting timedout replica"] \
"expected exactly one 'Disconnecting timedout replica' log entry (full sync or streaming sync) for the slow replica"
$master config set repl-timeout 60
}

Expand Down
Loading