未验证 提交 1af62a9d 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #5468 from taosdata/fix/TD-3332

[TD-3332]<fix>: vnode report status if not closing instead of not ready
...@@ -128,7 +128,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) { ...@@ -128,7 +128,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) {
int64_t compStorage = 0; int64_t compStorage = 0;
int64_t pointsWritten = 0; int64_t pointsWritten = 0;
if (!vnodeInReadyStatus(pVnode)) return; if (vnodeInClosingStatus(pVnode)) return;
if (pStatus->openVnodes >= TSDB_MAX_VNODES) return; if (pStatus->openVnodes >= TSDB_MAX_VNODES) return;
if (pVnode->tsdb) { if (pVnode->tsdb) {
...@@ -194,4 +194,4 @@ void vnodeSetAccess(SVgroupAccess *pAccess, int32_t numOfVnodes) { ...@@ -194,4 +194,4 @@ void vnodeSetAccess(SVgroupAccess *pAccess, int32_t numOfVnodes) {
vnodeRelease(pVnode); vnodeRelease(pVnode);
} }
} }
} }
\ No newline at end of file
...@@ -153,6 +153,18 @@ bool vnodeInReadyOrUpdatingStatus(SVnodeObj* pVnode) { ...@@ -153,6 +153,18 @@ bool vnodeInReadyOrUpdatingStatus(SVnodeObj* pVnode) {
return in; 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 vnodeInResetStatus(SVnodeObj* pVnode) {
bool in = false; bool in = false;
pthread_mutex_lock(&pVnode->statusMutex); pthread_mutex_lock(&pVnode->statusMutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册