Merge pull request #19696 from taosdata/FIX/TD-22081-main

fix: round lastApplyIndex up to beginIndex -1 in syncBeginSnapshot
This commit is contained in:
Shengliang Guan 2023-01-30 09:29:41 +08:00 committed by GitHub
commit 0ca1d55d4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -306,7 +306,7 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) {
if (pSyncNode->replicaNum > 1) {
// multi replicas
lastApplyIndex -= SYNC_VNODE_LOG_RETENTION;
lastApplyIndex = TMAX(lastApplyIndex - SYNC_VNODE_LOG_RETENTION, beginIndex - 1);
if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) {
pSyncNode->minMatchIndex = syncMinMatchIndex(pSyncNode);