diff --git a/src/vnode/src/vnodeMgmt.c b/src/vnode/src/vnodeMgmt.c index 8469ab12c1ef5833e73058c167afb2777ac76ba9..71d9bc07f50b6a8cba06d68b9b06b24f4dadcf83 100644 --- a/src/vnode/src/vnodeMgmt.c +++ b/src/vnode/src/vnodeMgmt.c @@ -128,7 +128,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) { int64_t compStorage = 0; int64_t pointsWritten = 0; - if (!vnodeInReadyStatus(pVnode)) return; + if (vnodeInClosingStatus(pVnode)) return; if (pStatus->openVnodes >= TSDB_MAX_VNODES) return; if (pVnode->tsdb) { @@ -194,4 +194,4 @@ void vnodeSetAccess(SVgroupAccess *pAccess, int32_t numOfVnodes) { vnodeRelease(pVnode); } } -} \ No newline at end of file +} diff --git a/src/vnode/src/vnodeStatus.c b/src/vnode/src/vnodeStatus.c index 68898435303daa8e0ac60a84cd54f4794515103e..64da8a4ad141a65482713cc200c6dd130352eb2e 100644 --- a/src/vnode/src/vnodeStatus.c +++ b/src/vnode/src/vnodeStatus.c @@ -153,6 +153,18 @@ bool vnodeInReadyOrUpdatingStatus(SVnodeObj* pVnode) { return in; } +bool vnodeInClosingStatus(SVnodeObj* pVnode) { + bool in = false; + pthread_mutex_lock(&pVnode->statusMutex); + + if (pVnode->status == TAOS_VN_STATUS_CLOSING) { + in = true; + } + + pthread_mutex_unlock(&pVnode->statusMutex); + return in; +} + bool vnodeInResetStatus(SVnodeObj* pVnode) { bool in = false; pthread_mutex_lock(&pVnode->statusMutex);