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
f5604de4c8
commit
fb0b31f10c
@ -826,18 +826,16 @@ void syncCommand(client *c) {
|
|||||||
|
|
||||||
/* CASE 3: There is no BGSAVE is progress. */
|
/* CASE 3: There is no BGSAVE is progress. */
|
||||||
} else {
|
} 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
|
/* Diskless replication RDB child is created inside
|
||||||
* replicationCron() since we want to delay its start a
|
* replicationCron() since we want to delay its start a
|
||||||
* few seconds to wait for more slaves to arrive. */
|
* few seconds to wait for more slaves to arrive. */
|
||||||
if (server.repl_diskless_sync_delay)
|
|
||||||
serverLog(LL_NOTICE,"Delay next BGSAVE for diskless SYNC");
|
serverLog(LL_NOTICE,"Delay next BGSAVE for diskless SYNC");
|
||||||
else
|
|
||||||
startBgsaveForReplication(c->slave_capa);
|
|
||||||
} else {
|
} else {
|
||||||
/* Target is disk (or the slave is not capable of supporting
|
/* We don't have a BGSAVE in progress, let's start one. Diskless
|
||||||
* diskless replication) and we don't have a BGSAVE in progress,
|
* or disk-based mode is determined by replica's capacity. */
|
||||||
* let's start one. */
|
|
||||||
if (!hasActiveChildProcess()) {
|
if (!hasActiveChildProcess()) {
|
||||||
startBgsaveForReplication(c->slave_capa);
|
startBgsaveForReplication(c->slave_capa);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user