fix: round lastApplyIndex up to beginIndex -1 in syncBeginSnapshot
This commit is contained in:
parent
c030fdc04f
commit
bd23a36f86
|
@ -306,7 +306,7 @@ int32_t syncBeginSnapshot(int64_t rid, int64_t lastApplyIndex) {
|
||||||
if (pSyncNode->replicaNum > 1) {
|
if (pSyncNode->replicaNum > 1) {
|
||||||
// multi replicas
|
// multi replicas
|
||||||
|
|
||||||
lastApplyIndex -= SYNC_VNODE_LOG_RETENTION;
|
lastApplyIndex = TMAX(lastApplyIndex - SYNC_VNODE_LOG_RETENTION, beginIndex - 1);
|
||||||
|
|
||||||
if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) {
|
if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) {
|
||||||
pSyncNode->minMatchIndex = syncMinMatchIndex(pSyncNode);
|
pSyncNode->minMatchIndex = syncMinMatchIndex(pSyncNode);
|
||||||
|
|
Loading…
Reference in New Issue