提交 4b180352 编写于 作者: H Hongze Cheng

fix bug

上级 fb0609f0
......@@ -162,7 +162,7 @@ const char *TFS_DISK_PATH(int level, int id) { return DISK_DIR(TFS_DISK_AT(level
// TFILE APIs ====================================
static void tfsSetFileAname(TFILE *pf) {
if (TFS_IS_VALID_DISK(pf->level, pf->id)) {
SDisk *pDisk = TFS_DISK_AT(pf->level, pf->level);
SDisk *pDisk = TFS_DISK_AT(pf->level, pf->id);
ASSERT(pDisk != NULL);
snprintf(pf->aname, TSDB_FILENAME_LEN, "%s/%s", DISK_DIR(pDisk), pf->rname);
}
......
......@@ -511,7 +511,7 @@ static FORCE_INLINE STsdbBufBlock* tsdbGetCurrBufBlock(STsdbRepo* pRepo) {
STsdbFileH* tsdbNewFileH(STsdbCfg* pCfg);
void tsdbFreeFileH(STsdbFileH* pFileH);
int tsdbOpenFileH(STsdbRepo* pRepo);
void tsdbCloseFileH(STsdbRepo* pRepo);
void tsdbCloseFileH(STsdbRepo* pRepo, bool isRestart);
SFileGroup *tsdbCreateFGroup(STsdbRepo *pRepo, int fid, int level);
void tsdbInitFileGroupIter(STsdbFileH* pFileH, SFileGroupIter* pIter, int direction);
void tsdbSeekFileGroupIter(SFileGroupIter* pIter, int fid);
......
......@@ -124,7 +124,7 @@ int tsdbOpenFileH(STsdbRepo *pRepo) {
return 0;
}
void tsdbCloseFileH(STsdbRepo *pRepo) {
void tsdbCloseFileH(STsdbRepo *pRepo, bool isRestart) {
STsdbFileH *pFileH = pRepo->tsdbFileH;
for (int i = 0; i < pFileH->nFGroups; i++) {
......@@ -132,7 +132,9 @@ void tsdbCloseFileH(STsdbRepo *pRepo) {
for (int type = 0; type < TSDB_FILE_TYPE_MAX; type++) {
tsdbCloseFile(&(pFGroup->files[type]));
}
tfsDecDiskFile(pFGroup->files[0].file.level, pFGroup->files[0].file.level, TSDB_FILE_TYPE_MAX);
if (isRestart) {
tfsDecDiskFile(pFGroup->files[0].file.level, pFGroup->files[0].file.level, TSDB_FILE_TYPE_MAX);
}
}
}
......
......@@ -151,7 +151,7 @@ int tsdbCloseRepo(TSDB_REPO_T *repo, int toCommit) {
pRepo->mem = NULL;
pRepo->imem = NULL;
tsdbCloseFileH(pRepo);
tsdbCloseFileH(pRepo, !toCommit);
tsdbCloseBufPool(pRepo);
tsdbCloseMeta(pRepo);
tsdbFreeRepo(pRepo);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册