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