From c8516f3dc484920de4fc52acd72f5104d643ca87 Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 17 Jul 2019 02:34:02 -0400 Subject: [PATCH] Fix Issue #58 --- src/server.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/server.cpp b/src/server.cpp index e1d0aa5da..c425933a4 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2934,6 +2934,18 @@ void initServer(void) { g_pserver->db[j].defrag_later = listCreate(); } + /* Fixup Master Client Database */ + listIter li; + listNode *ln; + listRewind(g_pserver->masters, &li); + while ((ln = listNext(&li))) + { + redisMaster *mi = (redisMaster*)listNodeValue(ln); + serverAssert(mi->master == nullptr); + if (mi->cached_master != nullptr) + selectDb(mi->cached_master, 0); + } + if (g_pserver->syslog_enabled) { openlog(g_pserver->syslog_ident, LOG_PID | LOG_NDELAY | LOG_NOWAIT, g_pserver->syslog_facility);