Fix cases where duplicate RREPLAY is applied

Former-commit-id: c3317686f8b8d94a3b2295def899ae30e208f327
This commit is contained in:
John Sully 2020-02-11 00:59:07 -05:00
parent 30ece138d5
commit e4d74b993f

View File

@ -2329,10 +2329,11 @@ int connectWithMaster(redisMaster *mi) {
void undoConnectWithMaster(redisMaster *mi) {
int fd = mi->repl_transfer_s;
aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, [fd]{
int res = aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, [fd]{
aeDeleteFileEvent(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el,fd,AE_READABLE|AE_WRITABLE);
close(fd);
});
serverAssert(res == AE_OK);
mi->repl_transfer_s = -1;
}
@ -3459,7 +3460,7 @@ void replicaReplayCommand(client *c)
if (mi->clientFakeNesting != s_pstate->nesting())
cFake = nullptr;
serverAssert(mi != nullptr);
if (mvcc != 0 && g_mapmvcc[uuid] >= mvcc && (mi->clientFake == nullptr))
if (mvcc != 0 && g_mapmvcc[uuid] >= mvcc)
{
s_pstate->Cancel();
s_pstate->Pop();
@ -3485,6 +3486,7 @@ void replicaReplayCommand(client *c)
{
addReply(c, shared.ok);
selectDb(c, cFake->db->id);
if (mvcc > g_mapmvcc[uuid])
g_mapmvcc[uuid] = mvcc;
}
else