diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index 9c847c1138..198af420ce 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -633,6 +633,7 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB const char *status = "ready"; if (objStatus == SDB_STATUS_CREATING) status = "creating"; if (objStatus == SDB_STATUS_DROPPING) status = "dropping"; + if (!mndIsDnodeOnline(pObj->pDnode, curMs)) status = "offline"; char b3[9 + VARSTR_HEADER_SIZE] = {0}; STR_WITH_MAXSIZE_TO_VARSTR(b3, status, pShow->pMeta->pSchemas[cols].bytes); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); diff --git a/tests/system-test/6-cluster/clusterCommonCheck.py b/tests/system-test/6-cluster/clusterCommonCheck.py index 7cbe9d9680..a69d9707e4 100644 --- a/tests/system-test/6-cluster/clusterCommonCheck.py +++ b/tests/system-test/6-cluster/clusterCommonCheck.py @@ -174,34 +174,34 @@ class ClusterComCheck: tdLog.exit("mnode number is correct") if offlineDnodeNo == 1: if tdSql.queryResult[0][2]=='offline' : - if tdSql.queryResult[1][2]=='leader' and tdSql.queryResult[1][3]== 'ready' : - if tdSql.queryResult[2][2]=='follower' and tdSql.queryResult[2][3]== 'ready' : + if tdSql.queryResult[1][2]=='leader': + if tdSql.queryResult[2][2]=='follower': tdLog.success("stop mnodes on dnode %d successfully in 10s" %offlineDnodeNo) return True - elif tdSql.queryResult[1][2]=='follower' and tdSql.queryResult[1][3]== 'ready' : - if tdSql.queryResult[2][2]=='leader' and tdSql.queryResult[2][3]== 'ready' : + elif tdSql.queryResult[1][2]=='follower': + if tdSql.queryResult[2][2]=='leader': tdLog.debug("stop mnodes on dnode %d successfully in 10s" %offlineDnodeNo) return True count+=1 elif offlineDnodeNo == 2: if tdSql.queryResult[1][2]=='offline' : - if tdSql.queryResult[0][2]=='leader' and tdSql.queryResult[0][3]== 'ready' : - if tdSql.queryResult[2][2]=='follower' and tdSql.queryResult[2][3]== 'ready' : + if tdSql.queryResult[0][2]=='leader': + if tdSql.queryResult[2][2]=='follower': tdLog.debug("stop mnodes on dnode %d successfully in 10s" %offlineDnodeNo) return True - elif tdSql.queryResult[0][2]=='follower' and tdSql.queryResult[0][3]== 'ready' : - if tdSql.queryResult[2][2]=='leader' and tdSql.queryResult[2][3]== 'ready' : + elif tdSql.queryResult[0][2]=='follower': + if tdSql.queryResult[2][2]=='leader': tdLog.debug("stop mnodes on dnode %d successfully in 10s" %offlineDnodeNo) return True count+=1 elif offlineDnodeNo == 3: if tdSql.queryResult[2][2]=='offline' : - if tdSql.queryResult[0][2]=='leader' and tdSql.queryResult[0][3]== 'ready' : - if tdSql.queryResult[1][2]=='follower' and tdSql.queryResult[1][3]== 'ready' : + if tdSql.queryResult[0][2]=='leader': + if tdSql.queryResult[1][2]=='follower': tdLog.debug("stop mnodes on dnode %d successfully in 10s" %offlineDnodeNo) return True - elif tdSql.queryResult[0][2]=='follower' and tdSql.queryResult[0][3]== 'ready' : - if tdSql.queryResult[1][2]=='leader' and tdSql.queryResult[1][3]== 'ready' : + elif tdSql.queryResult[0][2]=='follower': + if tdSql.queryResult[1][2]=='leader': tdLog.debug("stop mnodes on dnode %d successfully in 10s" %offlineDnodeNo) return True count+=1 @@ -219,8 +219,8 @@ class ClusterComCheck: else: tdLog.exit("mnode number is correct") if tdSql.queryResult[0][2]=='leader' : - if tdSql.queryResult[1][2]=='offline' and tdSql.queryResult[1][3]== 'ready' : - if tdSql.queryResult[2][2]=='offline' and tdSql.queryResult[2][3]== 'ready' : + if tdSql.queryResult[1][2]=='offline': + if tdSql.queryResult[2][2]=='offline': tdLog.success("stop mnodes of follower on dnode successfully in 10s") return True count+=1