mirror of
http://github.com/valkey-io/valkey
synced 2024-11-21 16:46:15 +00:00
Unprotect rdb channel when bgsave child fails in dual channel replication (#1297)
If bgsaveerr is error, there is no need to protect the rdb channel. The impact of this may be that when bgsave fails, we will protect the rdb channel for 60s. It may occupy the reference of the repl buf block, making it impossible to recycle it until we free the client due to COB or free the client after 60s. We kept the RDB channel open as long as the replica hadn't established a main connection, even if the snapshot process failed. There is no value in keeping the RDB client in this case. Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
92181b6797
commit
86f33ea2b0
@ -1741,6 +1741,8 @@ void updateReplicasWaitingBgsave(int bgsaveerr, int type) {
|
||||
struct valkey_stat buf;
|
||||
|
||||
if (bgsaveerr != C_OK) {
|
||||
/* 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;
|
||||
|
Loading…
Reference in New Issue
Block a user