This commit is contained in:
Hongze Cheng 2023-06-30 15:04:18 +08:00
parent e79fe91ba0
commit 2f57c8439b
2 changed files with 11 additions and 2 deletions

View File

@ -872,7 +872,11 @@ int32_t tsdbFSWaitAllBgTask(STFileSystem *fs) {
} }
static int32_t tsdbFSDoDisableBgTask(STFileSystem *fs) { static int32_t tsdbFSDoDisableBgTask(STFileSystem *fs) {
// TODO fs->stop = true;
if (fs->bgTaskRunning) {
tsdbDoWaitBgTask(fs, fs->bgTaskRunning);
}
return 0; return 0;
} }
@ -884,6 +888,8 @@ int32_t tsdbFSDisableBgTask(STFileSystem *fs) {
} }
int32_t tsdbFSEnableBgTask(STFileSystem *fs) { int32_t tsdbFSEnableBgTask(STFileSystem *fs) {
// TODO taosThreadMutexLock(fs->mutex);
fs->stop = false;
taosThreadMutexUnlock(fs->mutex);
return 0; return 0;
} }

View File

@ -1025,6 +1025,8 @@ int32_t tsdbSnapWriterOpen(STsdb* pTsdb, int64_t sver, int64_t ever, STsdbSnapWr
code = tsdbFSCreateCopySnapshot(pTsdb->pFS, &writer[0]->fsetArr); code = tsdbFSCreateCopySnapshot(pTsdb->pFS, &writer[0]->fsetArr);
TSDB_CHECK_CODE(code, lino, _exit); TSDB_CHECK_CODE(code, lino, _exit);
tsdbFSDisableBgTask(pTsdb->pFS);
_exit: _exit:
if (code) { if (code) {
tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code)); tsdbError("vgId:%d %s failed at line %d since %s", TD_VID(pTsdb->pVnode), __func__, lino, tstrerror(code));
@ -1075,6 +1077,7 @@ int32_t tsdbSnapWriterClose(STsdbSnapWriter** writer, int8_t rollback) {
taosThreadRwlockUnlock(&writer[0]->tsdb->rwLock); taosThreadRwlockUnlock(&writer[0]->tsdb->rwLock);
} }
tsdbFSEnableBgTask(tsdb->pFS);
tsdbIterMergerClose(&writer[0]->ctx->tombIterMerger); tsdbIterMergerClose(&writer[0]->ctx->tombIterMerger);
tsdbIterMergerClose(&writer[0]->ctx->dataIterMerger); tsdbIterMergerClose(&writer[0]->ctx->dataIterMerger);