enh: reset sync log replication on stagnation for eight times maxRetryWaitMs

This commit is contained in:
Benguang Zhao 2022-12-30 19:02:46 +08:00
parent 4718f4d1b6
commit eb524e610a
1 changed files with 6 additions and 1 deletions

View File

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