From df4787eff1fc04406e74e3b1d34cd710af8ecc2c Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Wed, 1 Jun 2022 17:08:03 +0800 Subject: [PATCH] refactor: modify syncNodeAppendEntriesPeersSnapshot --- source/libs/sync/src/syncReplication.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/libs/sync/src/syncReplication.c b/source/libs/sync/src/syncReplication.c index bb7036788e..0746f0ed6e 100644 --- a/source/libs/sync/src/syncReplication.c +++ b/source/libs/sync/src/syncReplication.c @@ -144,6 +144,8 @@ int32_t syncNodeAppendEntriesPeersSnapshot(SSyncNode* pSyncNode) { sInfo("nextIndex:%ld in snapshot: , begin snapshot", nextIndex, snapshot.lastApplyIndex, snapshot.lastApplyTerm); + // do not use next index + // always send from new last index + 1 SyncIndex lastIndex; SyncTerm lastTerm; ret = syncNodeGetLastIndexTerm(pSyncNode, &lastIndex, &lastTerm);