diff --git a/src/replication.c b/src/replication.c index 58fb1f8522..4eadba5f0e 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1745,10 +1745,8 @@ void updateReplicasWaitingBgsave(int bgsaveerr, int type) { struct valkey_stat buf; if (bgsaveerr != C_OK) { - if (replica->flag.protected_rdb_channel) { - /* If bgsaveerr is error, there is no need to protect the rdb channel. */ - replica->flag.protected_rdb_channel = 0; - } + /* If bgsaveerr is error, there is no need to protect the rdb channel. */ + replica->flag.protected_rdb_channel = 0; freeClientAsync(replica); serverLog(LL_WARNING, "SYNC failed. BGSAVE child returned an error"); continue;