Merge pull request #24339 from taosdata/FEAT/TS-3816-3.0
enh: restore sync log store from snap on fsm state incomplete
This commit is contained in:
commit
6239fe7a95
|
@ -790,7 +790,7 @@ int32_t syncNodeLogStoreRestoreOnNeed(SSyncNode* pNode) {
|
||||||
SyncIndex commitIndex = snapshot.lastApplyIndex;
|
SyncIndex commitIndex = snapshot.lastApplyIndex;
|
||||||
SyncIndex firstVer = pNode->pLogStore->syncLogBeginIndex(pNode->pLogStore);
|
SyncIndex firstVer = pNode->pLogStore->syncLogBeginIndex(pNode->pLogStore);
|
||||||
SyncIndex lastVer = pNode->pLogStore->syncLogLastIndex(pNode->pLogStore);
|
SyncIndex lastVer = pNode->pLogStore->syncLogLastIndex(pNode->pLogStore);
|
||||||
if (lastVer < commitIndex || firstVer > commitIndex + 1) {
|
if ((lastVer < commitIndex || firstVer > commitIndex + 1) || pNode->fsmState == SYNC_FSM_STATE_INCOMPLETE) {
|
||||||
if (pNode->pLogStore->syncLogRestoreFromSnapshot(pNode->pLogStore, commitIndex)) {
|
if (pNode->pLogStore->syncLogRestoreFromSnapshot(pNode->pLogStore, commitIndex)) {
|
||||||
sError("vgId:%d, failed to restore log store from snapshot since %s. lastVer:%" PRId64 ", snapshotVer:%" PRId64,
|
sError("vgId:%d, failed to restore log store from snapshot since %s. lastVer:%" PRId64 ", snapshotVer:%" PRId64,
|
||||||
pNode->vgId, terrstr(), lastVer, commitIndex);
|
pNode->vgId, terrstr(), lastVer, commitIndex);
|
||||||
|
|
Loading…
Reference in New Issue