Fix cases where duplicate RREPLAY is applied
Former-commit-id: c3317686f8b8d94a3b2295def899ae30e208f327
This commit is contained in:
parent
30ece138d5
commit
e4d74b993f
@ -2329,10 +2329,11 @@ int connectWithMaster(redisMaster *mi) {
|
|||||||
void undoConnectWithMaster(redisMaster *mi) {
|
void undoConnectWithMaster(redisMaster *mi) {
|
||||||
int fd = mi->repl_transfer_s;
|
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);
|
aeDeleteFileEvent(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el,fd,AE_READABLE|AE_WRITABLE);
|
||||||
close(fd);
|
close(fd);
|
||||||
});
|
});
|
||||||
|
serverAssert(res == AE_OK);
|
||||||
mi->repl_transfer_s = -1;
|
mi->repl_transfer_s = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3459,7 +3460,7 @@ void replicaReplayCommand(client *c)
|
|||||||
if (mi->clientFakeNesting != s_pstate->nesting())
|
if (mi->clientFakeNesting != s_pstate->nesting())
|
||||||
cFake = nullptr;
|
cFake = nullptr;
|
||||||
serverAssert(mi != 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->Cancel();
|
||||||
s_pstate->Pop();
|
s_pstate->Pop();
|
||||||
@ -3485,6 +3486,7 @@ void replicaReplayCommand(client *c)
|
|||||||
{
|
{
|
||||||
addReply(c, shared.ok);
|
addReply(c, shared.ok);
|
||||||
selectDb(c, cFake->db->id);
|
selectDb(c, cFake->db->id);
|
||||||
|
if (mvcc > g_mapmvcc[uuid])
|
||||||
g_mapmvcc[uuid] = mvcc;
|
g_mapmvcc[uuid] = mvcc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user