fix(stream): add refId for meta at the end of init functions

This commit is contained in:
Haojun Liao 2024-10-29 10:20:27 +08:00
parent cbb3572fdd
commit 097d3caa90
1 changed files with 3 additions and 1 deletions

View File

@ -434,7 +434,6 @@ int32_t streamMetaOpen(const char* path, void* ahandle, FTaskBuild buildTaskFn,
pMeta->closeFlag = false;
stInfo("vgId:%d open stream meta succ, latest checkpoint:%" PRId64 ", stage:%" PRId64, vgId, pMeta->chkpId, stage);
pMeta->rid = taosAddRef(streamMetaId, pMeta);
// set the attribute when running on Linux OS
TdThreadRwlockAttr attr;
@ -468,6 +467,9 @@ int32_t streamMetaOpen(const char* path, void* ahandle, FTaskBuild buildTaskFn,
code = taosThreadMutexInit(&pMeta->backendMutex, NULL);
TSDB_CHECK_CODE(code, lino, _err);
// add refId at the end of initialization function
pMeta->rid = taosAddRef(streamMetaId, pMeta);
*p = pMeta;
return code;