fix: set start of snap replication incremental properly

This commit is contained in:
Benguang Zhao 2023-12-13 13:48:45 +08:00
parent c74c4fe208
commit 6eb64fcd9b
1 changed files with 5 additions and 1 deletions

View File

@ -23,6 +23,8 @@
#include "syncReplication.h"
#include "syncUtil.h"
static SyncIndex syncNodeGetSnapBeginIndex(SSyncNode *ths);
static void syncSnapBufferReset(SSyncSnapBuffer *pBuf) {
for (int64_t i = pBuf->start; i < pBuf->end; ++i) {
if (pBuf->entryDeleteCb) {
@ -514,7 +516,9 @@ void snapshotReceiverStart(SSyncSnapshotReceiver *pReceiver, SyncSnapshotSend *p
pReceiver->term = pPreMsg->term;
pReceiver->fromId = pPreMsg->srcId;
pReceiver->startTime = pPreMsg->startTime;
ASSERT(pReceiver->startTime);
pReceiver->snapshotParam.start = syncNodeGetSnapBeginIndex(pReceiver->pSyncNode);
pReceiver->snapshotParam.end = -1;
sRInfo(pReceiver, "snapshot receiver start, from dnode:%d.", DID(&pReceiver->fromId));
}