Merge pull request #25644 from taosdata/FIX/TD-29908-3.0
enh: check snap begin index against commit index on leader
This commit is contained in:
commit
05f0253991
|
@ -1100,6 +1100,14 @@ static int32_t syncNodeOnSnapshotPrepRsp(SSyncNode *pSyncNode, SSyncSnapshotSend
|
|||
int32_t code = -1;
|
||||
SSnapshot snapshot = {0};
|
||||
|
||||
if (pMsg->snapBeginIndex > pSyncNode->commitIndex) {
|
||||
sSError(pSender,
|
||||
"snapshot begin index is greater than commit index. snapBeginIndex:%" PRId64 ", commitIndex:%" PRId64,
|
||||
pMsg->snapBeginIndex, pSyncNode->commitIndex);
|
||||
terrno = TSDB_CODE_SYN_INVALID_SNAPSHOT_MSG;
|
||||
return -1;
|
||||
}
|
||||
|
||||
taosThreadMutexLock(&pSender->pSndBuf->mutex);
|
||||
pSyncNode->pFsm->FpGetSnapshotInfo(pSyncNode->pFsm, &snapshot);
|
||||
|
||||
|
|
Loading…
Reference in New Issue