enh: reset as stagnation only when not matched in syncLogReplMgrRetryOnNeed

This commit is contained in:
Benguang Zhao 2023-01-02 08:58:13 +08:00
parent 3edde0eadf
commit cb433c191b
1 changed files with 3 additions and 2 deletions

View File

@ -632,9 +632,10 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) {
} }
if (pMgr->states[pos].acked) { if (pMgr->states[pos].acked) {
if (pMgr->states[pos].timeMs + (syncGetRetryMaxWaitMs() << 3) < nowMs) { if (pMgr->matchIndex < index && pMgr->states[pos].timeMs + (syncGetRetryMaxWaitMs() << 3) < nowMs) {
syncLogReplMgrReset(pMgr); syncLogReplMgrReset(pMgr);
sWarn("vgId:%d, reset sync log repl mgr since stagnation. peer: %" PRIx64, pNode->vgId, pDestId->addr); sWarn("vgId:%d, reset sync log repl mgr since stagnation. index: %" PRId64 ", peer: %" PRIx64, pNode->vgId,
index, pDestId->addr);
goto _out; goto _out;
} }
continue; continue;