Skip to content

Commit

Permalink
Active replicas memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Sep 22, 2020
1 parent 143f7f6 commit 22ac56d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ void setExpire(client *c, redisDb *db, robj *key, robj *subkey, long long when)
db->setexpire->insert(e);
}

int writable_slave = listLength(g_pserver->masters) && g_pserver->repl_slave_ro == 0;
int writable_slave = listLength(g_pserver->masters) && g_pserver->repl_slave_ro == 0 && !g_pserver->fActiveReplica;
if (c && writable_slave && !(c->flags & CLIENT_MASTER))
rememberSlaveKeyWithExpire(db,key);
}
Expand Down Expand Up @@ -1432,7 +1432,7 @@ void setExpire(client *c, redisDb *db, robj *key, expireEntry &&e)
((robj*)dictGetVal(kde))->SetFExpires(true);


int writable_slave = listLength(g_pserver->masters) && g_pserver->repl_slave_ro == 0;
int writable_slave = listLength(g_pserver->masters) && g_pserver->repl_slave_ro == 0 && !g_pserver->fActiveReplica;
if (c && writable_slave && !(c->flags & CLIENT_MASTER))
rememberSlaveKeyWithExpire(db,key);
}
Expand Down

0 comments on commit 22ac56d

Please sign in to comment.