diff --git a/src/rdb.c b/src/rdb.c index c0288de481..32b5210ca4 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -3450,10 +3450,9 @@ static void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) { if (!bysignal && exitcode == 0) { serverLog(LL_NOTICE, "Background RDB transfer terminated with success"); } else if (!bysignal && exitcode != 0) { - serverLog(LL_WARNING, "Background transfer error"); - server.lastbgsave_status = C_ERR; + serverLog(LL_WARNING, "Background RDB transfer error"); } else { - serverLog(LL_WARNING, "Background transfer terminated by signal %d", bysignal); + serverLog(LL_WARNING, "Background RDB transfer terminated by signal %d", bysignal); } if (server.rdb_child_exit_pipe != -1) close(server.rdb_child_exit_pipe); if (server.rdb_pipe_read > 0) { diff --git a/tests/integration/dual-channel-replication.tcl b/tests/integration/dual-channel-replication.tcl index 906f8cacb8..77b717d46e 100644 --- a/tests/integration/dual-channel-replication.tcl +++ b/tests/integration/dual-channel-replication.tcl @@ -894,6 +894,7 @@ start_server {tags {"dual-channel-replication external:skip"}} { $primary debug log "killing replica main connection" set replica_main_conn_id [get_client_id_by_last_cmd $primary "psync"] assert {$replica_main_conn_id != ""} + set loglines [count_log_lines -1] $primary client kill id $replica_main_conn_id # Wait for primary to abort the sync wait_for_condition 50 1000 { @@ -901,11 +902,7 @@ start_server {tags {"dual-channel-replication external:skip"}} { } else { fail "Primary did not free repl buf block after sync failure" } - wait_for_condition 1000 10 { - [s -1 rdb_last_bgsave_status] eq "err" - } else { - fail "bgsave did not stop in time" - } + wait_for_log_messages -1 {"*Background RDB transfer error*"} $loglines 1000 10 } test "Test dual channel replication slave of no one after main conn kill" { @@ -931,14 +928,10 @@ start_server {tags {"dual-channel-replication external:skip"}} { set replica_rdb_channel_id [get_client_id_by_last_cmd $primary "sync"] $primary debug log "killing replica rdb connection $replica_rdb_channel_id" assert {$replica_rdb_channel_id != ""} + set loglines [count_log_lines -1] $primary client kill id $replica_rdb_channel_id # Wait for primary to abort the sync - wait_for_condition 1000 10 { - [s -1 rdb_bgsave_in_progress] eq 0 && - [s -1 rdb_last_bgsave_status] eq "err" - } else { - fail "Primary should abort sync" - } + wait_for_log_messages -1 {"*Background RDB transfer error*"} $loglines 1000 10 } test "Test dual channel replication slave of no one after rdb conn kill" { @@ -1072,6 +1065,7 @@ start_server {tags {"dual-channel-replication external:skip"}} { $primary debug log "killing replica rdb connection" set replica_rdb_channel_id [get_client_id_by_last_cmd $primary "sync"] assert {$replica_rdb_channel_id != ""} + set loglines [count_log_lines -1] $primary client kill id $replica_rdb_channel_id # Wait for primary to abort the sync wait_for_condition 50 1000 { @@ -1079,11 +1073,7 @@ start_server {tags {"dual-channel-replication external:skip"}} { } else { fail "Primary did not free repl buf block after sync failure" } - wait_for_condition 1000 10 { - [s -1 rdb_last_bgsave_status] eq "err" - } else { - fail "bgsave did not stop in time" - } + wait_for_log_messages -1 {"*Background RDB transfer error*"} $loglines 1000 10 # Replica should retry wait_for_condition 500 1000 { [string match "*slave*,state=wait_bgsave*,type=rdb-channel*" [$primary info replication]] && @@ -1113,6 +1103,7 @@ start_server {tags {"dual-channel-replication external:skip"}} { $primary debug log "killing replica main connection" set replica_main_conn_id [get_client_id_by_last_cmd $primary "sync"] assert {$replica_main_conn_id != ""} + set loglines [count_log_lines -1] $primary client kill id $replica_main_conn_id # Wait for primary to abort the sync wait_for_condition 50 1000 { @@ -1120,11 +1111,7 @@ start_server {tags {"dual-channel-replication external:skip"}} { } else { fail "Primary did not free repl buf block after sync failure" } - wait_for_condition 1000 10 { - [s -1 rdb_last_bgsave_status] eq "err" - } else { - fail "bgsave did not stop in time" - } + wait_for_log_messages -1 {"*Background RDB transfer error*"} $loglines 1000 10 # Replica should retry wait_for_condition 500 1000 { [string match "*slave*,state=wait_bgsave*,type=rdb-channel*" [$primary info replication]] &&