Merge pull request #19054 from taosdata/fix/TD-21388
fix: the mnode is also offline when dnode on it is offline
This commit is contained in:
commit
9ed8a2125c
|
@ -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++);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue