mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Fix diskless replication failure when has non-rdb child process (#8070)
If we enable diskless replication, set repl-diskless-sync-delay to 0, and master has non-rdb child process such as rewrite aof child, master will try to start to a new BGSAVE but fails immediately (before fork) when replicas ask for full synchronization, and master always fails to start a new BGSAVE and disconnects with replicas until non-rdb child process exists. this bug was introduced in #6271 (not yet released in 6.0.x)
This commit is contained in:
parent
e6fa47380a
commit
f207e1682f
@ -826,18 +826,16 @@ void syncCommand(client *c) {
|
||||
|
||||
/* CASE 3: There is no BGSAVE is progress. */
|
||||
} else {
|
||||
if (server.repl_diskless_sync && (c->slave_capa & SLAVE_CAPA_EOF)) {
|
||||
if (server.repl_diskless_sync && (c->slave_capa & SLAVE_CAPA_EOF) &&
|
||||
server.repl_diskless_sync_delay)
|
||||
{
|
||||
/* Diskless replication RDB child is created inside
|
||||
* replicationCron() since we want to delay its start a
|
||||
* few seconds to wait for more slaves to arrive. */
|
||||
if (server.repl_diskless_sync_delay)
|
||||
serverLog(LL_NOTICE,"Delay next BGSAVE for diskless SYNC");
|
||||
else
|
||||
startBgsaveForReplication(c->slave_capa);
|
||||
serverLog(LL_NOTICE,"Delay next BGSAVE for diskless SYNC");
|
||||
} else {
|
||||
/* Target is disk (or the slave is not capable of supporting
|
||||
* diskless replication) and we don't have a BGSAVE in progress,
|
||||
* let's start one. */
|
||||
/* We don't have a BGSAVE in progress, let's start one. Diskless
|
||||
* or disk-based mode is determined by replica's capacity. */
|
||||
if (!hasActiveChildProcess()) {
|
||||
startBgsaveForReplication(c->slave_capa);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user