fix stream snap deadlock

This commit is contained in:
yihaoDeng 2023-10-17 11:23:39 +08:00
parent b6005d6183
commit 77542cc461
2 changed files with 4 additions and 5 deletions

View File

@ -65,8 +65,8 @@ typedef struct {
rocksdb_compactionfilterfactory_t* filterFactory;
TdThreadMutex mutex;
char* idstr;
int64_t refId;
char* path;
int64_t refId;
int64_t chkpId;
SArray* chkpSaved;

View File

@ -237,8 +237,9 @@ void* streamMetaGetBackendByTaskKey(SStreamMeta* pMeta, char* key, int64_t chkpI
taosThreadMutexUnlock(&pMeta->backendMutex);
return NULL;
}
*ref = taosAddRef(taskDbWrapperId, pBackend);
int64_t tref = taosAddRef(taskDbWrapperId, pBackend);
*ref = tref;
((STaskDbWrapper*)pBackend)->refId = tref;
taosHashPut(pMeta->pTaskDbUnique, key, strlen(key), &pBackend, sizeof(void*));
taosThreadMutexUnlock(&pMeta->backendMutex);
@ -824,8 +825,6 @@ int32_t streamMetaLoadAllTasks(SStreamMeta* pMeta) {
taosArrayPush(pMeta->pTaskList, &pTask->id);
} else {
tdbFree(pKey);
tdbFree(pVal);
taosMemoryFree(pTask);
continue;
}