diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index 8ec66316e33a09825248a3628e990c854a7e554b..21d4480a73ee0d2a6539828304219ac1f8b38951 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -124,8 +124,6 @@ int32_t vnodeDrop(int32_t vgId) { vInfo("vgId:%d, vnode will be dropped, refCount:%d pVnode:%p", pVnode->vgId, pVnode->refCount, pVnode); pVnode->dropped = 1; - // remove from hash, so new messages wont be consumed - vnodeRemoveFromHash(pVnode); vnodeRelease(pVnode); vnodeCleanupInMWorker(pVnode); diff --git a/src/vnode/src/vnodeMgmt.c b/src/vnode/src/vnodeMgmt.c index 32f95321383981924c5b6496bd4302edca19da5e..62eb4dadcc2468fcb7ebeced77bd0f5c615921d9 100644 --- a/src/vnode/src/vnodeMgmt.c +++ b/src/vnode/src/vnodeMgmt.c @@ -118,6 +118,8 @@ void vnodeRelease(void *vparam) { tsem_post(&pVnode->sem); } } else { + vnodeRemoveFromHash(pVnode); + vDebug("vgId:%d, vnode will be destroyed, refCount:%d pVnode:%p", pVnode->vgId, refCount, pVnode); vnodeDestroyInMWorker(pVnode); int32_t count = taosHashGetSize(tsVnodesHash); diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index b60fc5a8cd2b820342d478aba9c03da6f5d2d63a..2f8da0012ba142bd5efbb76ac4231a477ac3d534 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -117,14 +117,18 @@ static SVReadMsg *vnodeBuildVReadMsg(SVnodeObj *pVnode, void *pCont, int32_t con } int32_t vnodeWriteToRQueue(void *vparam, void *pCont, int32_t contLen, int8_t qtype, void *rparam) { + SVnodeObj *pVnode = vparam; + + if (pVnode->dropped) { + return TSDB_CODE_VND_INVALID_VGROUP_ID; + } + SVReadMsg *pRead = vnodeBuildVReadMsg(vparam, pCont, contLen, qtype, rparam); if (pRead == NULL) { assert(terrno != 0); return terrno; } - SVnodeObj *pVnode = vparam; - int32_t code = vnodeCheckRead(pVnode); if (code != TSDB_CODE_SUCCESS) { taosFreeQitem(pRead); diff --git a/src/vnode/src/vnodeWrite.c b/src/vnode/src/vnodeWrite.c index 36516d81df50a1903bb0d6c332b4eacf35f248c1..1b6e2e37ca2ef9183195e5484168f1d0a726cd62 100644 --- a/src/vnode/src/vnodeWrite.c +++ b/src/vnode/src/vnodeWrite.c @@ -386,4 +386,6 @@ void vnodeWaitWriteCompleted(SVnodeObj *pVnode) { vTrace("vgId:%d, queued wmsg num:%d", pVnode->vgId, pVnode->queuedWMsg); taosMsleep(10); } + + taosMsleep(1000 * 3); }