From cfee6376d25d5fc573f916712aa60d3572b01635 Mon Sep 17 00:00:00 2001 From: John Sully Date: Thu, 18 Jul 2019 20:50:20 -0400 Subject: [PATCH] Active Replicas should always use their own slaveseldb variable when sending/saving rdbs - never those of their masters. This is because the Active Replica is also simultaneously a master Former-commit-id: bb090b6d20bfc3d5d3ca07270f64bf15fad42681 --- src/rdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rdb.cpp b/src/rdb.cpp index 2cac89178..d446109fa 100644 --- a/src/rdb.cpp +++ b/src/rdb.cpp @@ -2547,7 +2547,7 @@ rdbSaveInfo *rdbPopulateSaveInfo(rdbSaveInfo *rsi) { * connects to us, the NULL repl_backlog will trigger a full * synchronization, at the same time we will use a new replid and clear * replid2. */ - if (!listLength(g_pserver->masters) && g_pserver->repl_backlog) { + if (g_pserver->fActiveReplica || (!listLength(g_pserver->masters) && g_pserver->repl_backlog)) { /* Note that when g_pserver->slaveseldb is -1, it means that this master * didn't apply any write commands after a full synchronization. * So we can let repl_stream_db be 0, this allows a restarted slave