Merge pull request #5588 from taosdata/hotfix/TD-3534
[TD-3534]<hotfix>: fix TD-3534
This commit is contained in:
commit
e0d6fe731b
|
@ -452,6 +452,14 @@ static int tsdbCommitToFile(SCommitH *pCommith, SDFileSet *pSet, int fid) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (tsdbUpdateDFileSetHeader(&(pCommith->wSet)) < 0) {
|
||||
tsdbError("vgId:%d failed to update FSET %d header since %s", REPO_ID(pRepo), fid, tstrerror(terrno));
|
||||
tsdbCloseCommitFile(pCommith, true);
|
||||
// revert the file change
|
||||
tsdbApplyDFileSetChange(TSDB_COMMIT_WRITE_FSET(pCommith), pSet);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Close commit file
|
||||
tsdbCloseCommitFile(pCommith, false);
|
||||
|
||||
|
|
|
@ -134,14 +134,14 @@ int tsdbCreateMFile(SMFile *pMFile, bool updateHeader) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
pMFile->info.size += TSDB_FILE_HEAD_SIZE;
|
||||
|
||||
if (tsdbUpdateMFileHeader(pMFile) < 0) {
|
||||
tsdbCloseMFile(pMFile);
|
||||
tsdbRemoveMFile(pMFile);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pMFile->info.size += TSDB_FILE_HEAD_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -378,14 +378,14 @@ int tsdbCreateDFile(SDFile *pDFile, bool updateHeader) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
pDFile->info.size += TSDB_FILE_HEAD_SIZE;
|
||||
|
||||
if (tsdbUpdateDFileHeader(pDFile) < 0) {
|
||||
tsdbCloseDFile(pDFile);
|
||||
tsdbRemoveDFile(pDFile);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pDFile->info.size += TSDB_FILE_HEAD_SIZE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue