未验证 提交 705e8178 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2264 from taosdata/hotfix/queue

release local resources only after all messages are consumed
......@@ -321,6 +321,22 @@ void vnodeRelease(void *pVnodeRaw) {
return;
}
if (pVnode->tsdb)
tsdbCloseRepo(pVnode->tsdb, 1);
pVnode->tsdb = NULL;
if (pVnode->wal)
walClose(pVnode->wal);
pVnode->wal = NULL;
if (pVnode->wqueue)
dnodeFreeVnodeWqueue(pVnode->wqueue);
pVnode->wqueue = NULL;
if (pVnode->rqueue)
dnodeFreeVnodeRqueue(pVnode->rqueue);
pVnode->rqueue = NULL;
tfree(pVnode->rootDir);
if (pVnode->status == TAOS_VN_STATUS_DELETING) {
......@@ -411,33 +427,21 @@ void vnodeBuildStatusMsg(void *param) {
}
static void vnodeCleanUp(SVnodeObj *pVnode) {
// remove from hash, so new messages wont be consumed
taosHashRemove(tsDnodeVnodesHash, (const char *)&pVnode->vgId, sizeof(int32_t));
// stop replication module
if (pVnode->sync) {
syncStop(pVnode->sync);
pVnode->sync = NULL;
}
if (pVnode->tsdb)
tsdbCloseRepo(pVnode->tsdb, 1);
pVnode->tsdb = NULL;
if (pVnode->wal)
walClose(pVnode->wal);
pVnode->wal = NULL;
// stop continuous query
if (pVnode->cq)
cqClose(pVnode->cq);
pVnode->cq = NULL;
if (pVnode->wqueue)
dnodeFreeVnodeWqueue(pVnode->wqueue);
pVnode->wqueue = NULL;
if (pVnode->rqueue)
dnodeFreeVnodeRqueue(pVnode->rqueue);
pVnode->rqueue = NULL;
// release local resources only after cutting off outside connections
vnodeRelease(pVnode);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册