Merge pull request #27044 from taosdata/fix/TD-31252

fix invalid remove
This commit is contained in:
Hongze Cheng 2024-08-07 17:09:22 +08:00 committed by GitHub
commit d08e62bb04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -1144,6 +1144,8 @@ int32_t chkpMayDelObsolete(void* arg, int64_t chkpId, char* path) {
int64_t id = *(int64_t*)taosArrayGet(chkpDel, i); int64_t id = *(int64_t*)taosArrayGet(chkpDel, i);
char tbuf[256] = {0}; char tbuf[256] = {0};
sprintf(tbuf, "%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, id); sprintf(tbuf, "%s%scheckpoint%" PRId64 "", path, TD_DIRSEP, id);
stInfo("backend remove obsolete checkpoint: %s", tbuf);
if (taosIsDir(tbuf)) { if (taosIsDir(tbuf)) {
taosRemoveDir(tbuf); taosRemoveDir(tbuf);
} }
@ -2661,6 +2663,7 @@ void taskDbDestroy(void* pDb, bool flush) {
if (wrapper->removeAllFiles) { if (wrapper->removeAllFiles) {
char* err = NULL; char* err = NULL;
stInfo("drop task remove backend dat:%s", wrapper->path);
taosRemoveDir(wrapper->path); taosRemoveDir(wrapper->path);
} }
taosMemoryFree(wrapper->path); taosMemoryFree(wrapper->path);

View File

@ -321,7 +321,7 @@ void streamFreeTaskState(SStreamTask* pTask, int8_t remove) {
stDebug("s-task:0x%x start to free task state", pTask->id.taskId); stDebug("s-task:0x%x start to free task state", pTask->id.taskId);
streamStateClose(pTask->pState, remove); streamStateClose(pTask->pState, remove);
taskDbSetClearFileFlag(pTask->pBackend); if (remove)taskDbSetClearFileFlag(pTask->pBackend);
taskDbRemoveRef(pTask->pBackend); taskDbRemoveRef(pTask->pBackend);
pTask->pBackend = NULL; pTask->pBackend = NULL;
pTask->pState = NULL; pTask->pState = NULL;