提交 d4254489 编写于 作者: J Jeff Tao

dont delete vnode hash until the final stage, otherwise, pVnode will be freed

上级 f8908155
......@@ -182,6 +182,7 @@ void vnodeRelease(void *pVnodeRaw) {
}
dTrace("pVnode:%p vgId:%d, vnode is released", pVnode, pVnode->vgId);
taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
tsOpennedVnodes--;
if (tsOpennedVnodes <= 0) {
......@@ -198,6 +199,11 @@ void *vnodeGetVnode(int32_t vgId) {
return NULL;
}
if (pVnode->status == VN_STATUS_CLOSING || pVnode->status == VN_STATUS_DELETING) {
terrno = TSDB_CODE_INVALID_VGROUP_ID;
return NULL;
}
atomic_add_fetch_32(&pVnode->refCount, 1);
dTrace("pVnode:%p vgId:%d, get vnode, refCount:%d", pVnode, pVnode->vgId, pVnode->refCount);
......@@ -241,7 +247,6 @@ static void vnodeBuildVloadMsg(char *pNode, void * param) {
}
static void vnodeCleanUp(SVnodeObj *pVnode) {
taosDeleteIntHash(tsDnodeVnodesHash, pVnode->vgId);
//syncStop(pVnode->sync);
tsdbCloseRepo(pVnode->tsdb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册