more code
This commit is contained in:
parent
6f947af8cc
commit
112a6b833a
|
@ -933,6 +933,9 @@ int32_t tsdbCompact(STsdb *pTsdb, int32_t flag) {
|
|||
tsdbCloseCompactor(pCompactor);
|
||||
}
|
||||
|
||||
code = tsdbFSUpsertDelFile(&pCompactor->fs, NULL);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
_exit:
|
||||
if (code) {
|
||||
tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
|
||||
|
|
|
@ -634,7 +634,15 @@ static int32_t tsdbFSApplyChange(STsdb *pTsdb, STsdbFS *pFS) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
ASSERT(pTsdb->fs.pDelFile == NULL);
|
||||
if (pTsdb->fs.pDelFile) {
|
||||
nRef = atomic_sub_fetch_32(&pTsdb->fs.pDelFile->nRef, 1);
|
||||
if (nRef == 0) {
|
||||
tsdbDelFileName(pTsdb, pTsdb->fs.pDelFile, fname);
|
||||
(void)taosRemoveFile(fname);
|
||||
taosMemoryFree(pTsdb->fs.pDelFile);
|
||||
}
|
||||
pTsdb->fs.pDelFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// aDFileSet
|
||||
|
@ -911,14 +919,21 @@ _exit:
|
|||
int32_t tsdbFSUpsertDelFile(STsdbFS *pFS, SDelFile *pDelFile) {
|
||||
int32_t code = 0;
|
||||
|
||||
if (pFS->pDelFile == NULL) {
|
||||
pFS->pDelFile = (SDelFile *)taosMemoryMalloc(sizeof(SDelFile));
|
||||
if (pDelFile) {
|
||||
if (pFS->pDelFile == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto _exit;
|
||||
pFS->pDelFile = (SDelFile *)taosMemoryMalloc(sizeof(SDelFile));
|
||||
if (pFS->pDelFile == NULL) {
|
||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||
goto _exit;
|
||||
}
|
||||
}
|
||||
*pFS->pDelFile = *pDelFile;
|
||||
} else {
|
||||
if (pFS->pDelFile) {
|
||||
taosMemoryFree(pFS->pDelFile);
|
||||
pFS->pDelFile = NULL;
|
||||
}
|
||||
}
|
||||
*pFS->pDelFile = *pDelFile;
|
||||
|
||||
_exit:
|
||||
return code;
|
||||
|
|
Loading…
Reference in New Issue