Merge pull request #18006 from taosdata/feature/3.0_mhli
refactor(sync): if index less than wal.commitVer, do not truncate, otherwise it will print much log
This commit is contained in:
commit
2103df2907
|
@ -294,6 +294,12 @@ static int32_t raftLogTruncate(struct SSyncLogStore* pLogStore, SyncIndex fromIn
|
|||
return 0;
|
||||
}
|
||||
|
||||
// need not truncate
|
||||
SyncIndex walCommitVer = walGetCommittedVer(pWal);
|
||||
if (fromIndex <= walCommitVer) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t code = walRollback(pWal, fromIndex);
|
||||
if (code != 0) {
|
||||
int32_t err = terrno;
|
||||
|
|
Loading…
Reference in New Issue