From cb433c191bc6a7b6f617885b3e492ac5f297385e Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Mon, 2 Jan 2023 08:58:13 +0800 Subject: [PATCH] enh: reset as stagnation only when not matched in syncLogReplMgrRetryOnNeed --- source/libs/sync/src/syncPipeline.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/libs/sync/src/syncPipeline.c b/source/libs/sync/src/syncPipeline.c index 7b8d5bed28..04a9f9728f 100644 --- a/source/libs/sync/src/syncPipeline.c +++ b/source/libs/sync/src/syncPipeline.c @@ -632,9 +632,10 @@ int32_t syncLogReplMgrRetryOnNeed(SSyncLogReplMgr* pMgr, SSyncNode* pNode) { } 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); - 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; } continue;