Skip to content
Merged
Show file tree
Hide file tree
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
29 changes: 24 additions & 5 deletions tests/gtid/master_restart.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ proc restart_server_gtided {level wait_ready rotate_logs gtid_enabled {reconnect
}
if {$reconnect} {
reconnect $level
# In swap mode, restarting loads a heavier RDB (includes RocksDB
# snapshot data), so wait until loading completes before returning.
if {$::swap} {
wait_done_loading [srv $level client]
}
}
}

Expand Down Expand Up @@ -120,7 +125,16 @@ proc restart_test {master_gtid_enabled slave_gtid_enabled restat_master_gtid_ena
restart_server_gtided 0 true false $restat_master_gtid_enabled
set master [srv 0 client]
}


# In swap mode, restart loads a heavier RDB (RocksDB state).
# wait_done_loading inside restart_server_gtided has only a 5s
# timeout and is wrapped in catch, so add an explicit longer wait
# here to guarantee the master is fully loaded before proceeding.
if {$::swap} {
set master [srv 0 client]
wait_done_loading $master
}

#@step4 check slave sync is continue
if $is_full_sync {
wait_for_condition 1000 10 {
Expand All @@ -138,11 +152,16 @@ proc restart_test {master_gtid_enabled slave_gtid_enabled restat_master_gtid_ena
fail "partial sync fail"
}
}




after 20
# In swap mode with full sync, the slave loads a new RDB
# (including RocksDB state) which can take longer than in mem
# mode. Wait until the slave exits LOADING before checking dbsize,
# because wait_for_condition propagates LOADING errors immediately
# rather than retrying.
if {$::swap && $is_full_sync} {
wait_done_loading $slave
}

wait_for_condition 1000 30 {
[$master dbsize] eq [$slave dbsize]
&& [$slave dbsize] eq 0
Expand Down
5 changes: 5 additions & 0 deletions tests/gtid/psync2-master-restart.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ proc restart_server_gtided {level wait_ready rotate_logs gtid_enabled {reconnect
}
if {$reconnect} {
reconnect $level
# In swap mode, restarting loads a heavier RDB (includes RocksDB
# snapshot data), so wait until loading completes before returning.
if {$::swap} {
wait_done_loading [srv $level client]
}
}
}
start_server {tags {"psync2 external:skip"} overrides {gtid-enabled yes}} {
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/replication-buffer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ start_server {} {
$master config set repl-diskless-sync-max-replicas 2
$replica1 replicaof $master_host $master_port
$replica2 replicaof $master_host $master_port
wait_for_condition 50 100 {
# In swap mode the fork is heavier (RocksDB snapshot) and CI load is
# higher, so give more time for both replicas to reach sync state.
set sync_wait [expr {$::swap ? 300 : 50}]
wait_for_condition $sync_wait 100 {
([s rdb_bgsave_in_progress] == 1) &&
[lindex [$replica1 role] 3] eq {sync} &&
[lindex [$replica2 role] 3] eq {sync}
Expand Down
Loading