提交 797b9376 编写于 作者: C Cary Xu

chore: code optimization for fs destroy

上级 e792c663
......@@ -321,7 +321,8 @@ struct STsdbFS {
};
struct STsdbTrimHdl {
volatile int8_t state; // 0 idle 1 in use
volatile int8_t state; // 0 idle 1 in use
volatile int8_t limitSpeed; // 0 no limit, 1 with limit
volatile int32_t maxRetentFid;
volatile int32_t minCommitFid;
};
......
......@@ -250,7 +250,7 @@ _err:
void tsdbFSDestroy(STsdbFS *pFS) {
if (pFS->pDelFile) {
taosMemoryFree(pFS->pDelFile);
taosMemoryFreeClear(pFS->pDelFile);
}
for (int32_t iSet = 0; iSet < taosArrayGetSize(pFS->aDFileSet); iSet++) {
......@@ -263,7 +263,7 @@ void tsdbFSDestroy(STsdbFS *pFS) {
}
}
taosArrayDestroy(pFS->aDFileSet);
pFS->aDFileSet = taosArrayDestroy(pFS->aDFileSet);
}
static int32_t tsdbScanAndTryFixFS(STsdb *pTsdb) {
......
......@@ -174,6 +174,8 @@ _migrate_loop:
// reset
maxFid = INT32_MIN;
fSize = 0;
tsdbFSDestroy(&fs);
tsdbFSDestroy(&fsLatest);
code = tsdbFSCopy(pTsdb, &fs);
if (code) goto _exit;
......@@ -275,9 +277,9 @@ _merge_fs:
}
taosThreadRwlockUnlock(&pTsdb->rwLock);
tsdbFSDestroy(&fs);
_exit:
tsdbFSDestroy(&fs);
tsdbFSDestroy(&fsLatest);
if (code != 0) {
tsdbError("vgId:%d, tsdb do retention(migrate) failed since %s", TD_VID(pTsdb->pVnode), tstrerror(code));
ASSERT(0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册