提交 e35ebdad 编写于 作者: S Shengliang Guan

refactor: rename LEADER to leader

上级 27c1687a
...@@ -655,7 +655,7 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ...@@ -655,7 +655,7 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataAppend(pColInfo, numOfRows, b1, false); colDataAppend(pColInfo, numOfRows, b1, false);
const char *roles = "OFFLINE"; const char *roles = "offline";
if (pObj->id == pMnode->selfDnodeId) { if (pObj->id == pMnode->selfDnodeId) {
roles = syncStr(TAOS_SYNC_STATE_LEADER); roles = syncStr(TAOS_SYNC_STATE_LEADER);
} }
...@@ -667,9 +667,9 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB ...@@ -667,9 +667,9 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataAppend(pColInfo, numOfRows, (const char *)b2, false); colDataAppend(pColInfo, numOfRows, (const char *)b2, false);
const char *status = "READY"; const char *status = "ready";
if (objStatus == SDB_STATUS_CREATING) status = "CREATING"; if (objStatus == SDB_STATUS_CREATING) status = "creating";
if (objStatus == SDB_STATUS_DROPPING) status = "DROPPING"; if (objStatus == SDB_STATUS_DROPPING) status = "dropping";
char b3[9 + VARSTR_HEADER_SIZE] = {0}; char b3[9 + VARSTR_HEADER_SIZE] = {0};
STR_WITH_MAXSIZE_TO_VARSTR(b3, status, pShow->pMeta->pSchemas[cols].bytes); STR_WITH_MAXSIZE_TO_VARSTR(b3, status, pShow->pMeta->pSchemas[cols].bytes);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
......
...@@ -705,7 +705,7 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p ...@@ -705,7 +705,7 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p
} }
char buf1[20] = {0}; char buf1[20] = {0};
const char *role = online ? syncStr(pVgroup->vnodeGid[i].role) : "OFFLINE"; const char *role = online ? syncStr(pVgroup->vnodeGid[i].role) : "offline";
STR_WITH_MAXSIZE_TO_VARSTR(buf1, role, pShow->pMeta->pSchemas[cols].bytes); STR_WITH_MAXSIZE_TO_VARSTR(buf1, role, pShow->pMeta->pSchemas[cols].bytes);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
......
...@@ -1450,12 +1450,12 @@ static void syncFreeNode(void* param) { ...@@ -1450,12 +1450,12 @@ static void syncFreeNode(void* param) {
const char* syncStr(ESyncState state) { const char* syncStr(ESyncState state) {
switch (state) { switch (state) {
case TAOS_SYNC_STATE_FOLLOWER: case TAOS_SYNC_STATE_FOLLOWER:
return "FOLLOWER"; return "follower";
case TAOS_SYNC_STATE_CANDIDATE: case TAOS_SYNC_STATE_CANDIDATE:
return "CANDIDATE"; return "candidate";
case TAOS_SYNC_STATE_LEADER: case TAOS_SYNC_STATE_LEADER:
return "LEADER"; return "leader";
default: default:
return "ERROR"; return "error";
} }
} }
...@@ -190,7 +190,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_BNODE_ALREADY_EXIST, "Bnode already exists" ...@@ -190,7 +190,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_BNODE_ALREADY_EXIST, "Bnode already exists"
TAOS_DEFINE_ERROR(TSDB_CODE_MND_BNODE_NOT_EXIST, "Bnode not there") TAOS_DEFINE_ERROR(TSDB_CODE_MND_BNODE_NOT_EXIST, "Bnode not there")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_FEW_MNODES, "The replicas of mnode cannot less than 1") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_FEW_MNODES, "The replicas of mnode cannot less than 1")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_MNODES, "The replicas of mnode cannot exceed 3") TAOS_DEFINE_ERROR(TSDB_CODE_MND_TOO_MANY_MNODES, "The replicas of mnode cannot exceed 3")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_CANT_DROP_MASTER, "Can't drop mnode which is LEADER") TAOS_DEFINE_ERROR(TSDB_CODE_MND_CANT_DROP_MASTER, "Can't drop mnode which is leader")
// mnode-acct // mnode-acct
TAOS_DEFINE_ERROR(TSDB_CODE_MND_ACCT_ALREADY_EXIST, "Account already exists") TAOS_DEFINE_ERROR(TSDB_CODE_MND_ACCT_ALREADY_EXIST, "Account already exists")
......
...@@ -24,7 +24,7 @@ if $data00 != 1 then ...@@ -24,7 +24,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
...@@ -71,7 +71,7 @@ if $data00 != 1 then ...@@ -71,7 +71,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
......
...@@ -131,43 +131,43 @@ endi ...@@ -131,43 +131,43 @@ endi
sleep 3000 sleep 3000
#sql show db.vgroups #sql show db.vgroups
#if $data[0][4] == LEADER then #if $data[0][4] == leader then
# if $data[0][6] != FOLLOWER then # if $data[0][6] != follower then
# return -1 # return -1
# endi # endi
# if $data[0][8] != FOLLOWER then # if $data[0][8] != follower then
# return -1 # return -1
# endi # endi
#endi #endi
#if $data[0][6] == LEADER then #if $data[0][6] == leader then
# if $data[0][4] != FOLLOWER then # if $data[0][4] != follower then
# return -1 # return -1
# endi # endi
# if $data[0][8] != FOLLOWER then # if $data[0][8] != follower then
# return -1 # return -1
# endi # endi
#endi #endi
#if $data[0][8] == LEADER then #if $data[0][8] == leader then
# if $data[0][4] != FOLLOWER then # if $data[0][4] != follower then
# return -1 # return -1
# endi # endi
# if $data[0][6] != FOLLOWER then # if $data[0][6] != follower then
# return -1 # return -1
# endi # endi
#endi #endi
# #
#if $data[0][4] != LEADER then #if $data[0][4] != leader then
# if $data[0][4] != FOLLOWER then # if $data[0][4] != follower then
# return -1 # return -1
# endi # endi
#endi #endi
#if $data[0][6] != LEADER then #if $data[0][6] != leader then
# if $data[0][6] != FOLLOWER then # if $data[0][6] != follower then
# return -1 # return -1
# endi # endi
#endi #endi
#if $data[0][8] != LEADER then #if $data[0][8] != leader then
# if $data[0][8] != FOLLOWER then # if $data[0][8] != follower then
# return -1 # return -1
# endi # endi
#endi #endi
......
...@@ -117,13 +117,13 @@ step4: ...@@ -117,13 +117,13 @@ step4:
sql show db.vgroups sql show db.vgroups
print ===> rows: $rows print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05 print ===> $data00 $data01 $data02 $data03 $data04 $data05
if $data[0][4] != LEADER then if $data[0][4] != leader then
goto step4 goto step4
endi endi
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto step4 goto step4
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto step4 goto step4
endi endi
......
...@@ -27,7 +27,7 @@ if $data00 != 1 then ...@@ -27,7 +27,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
...@@ -74,7 +74,7 @@ if $data00 != 1 then ...@@ -74,7 +74,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
......
...@@ -15,7 +15,7 @@ if $data00 != 1 then ...@@ -15,7 +15,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
...@@ -59,13 +59,13 @@ endi ...@@ -59,13 +59,13 @@ endi
if $data(1)[0] != 1 then if $data(1)[0] != 1 then
return -1 return -1
endi endi
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
return -1 return -1
endi endi
if $data(2)[0] != 2 then if $data(2)[0] != 2 then
return -1 return -1
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step2 goto step2
endi endi
...@@ -95,7 +95,7 @@ endi ...@@ -95,7 +95,7 @@ endi
if $data(1)[0] != 1 then if $data(1)[0] != 1 then
return -1 return -1
endi endi
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
return -1 return -1
endi endi
if $data(2)[0] != null then if $data(2)[0] != null then
...@@ -131,13 +131,13 @@ endi ...@@ -131,13 +131,13 @@ endi
if $data(1)[0] != 1 then if $data(1)[0] != 1 then
return -1 return -1
endi endi
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
return -1 return -1
endi endi
if $data(2)[0] != 2 then if $data(2)[0] != 2 then
return -1 return -1
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step3 goto step3
endi endi
......
...@@ -15,7 +15,7 @@ if $data00 != 1 then ...@@ -15,7 +15,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
...@@ -56,13 +56,13 @@ endi ...@@ -56,13 +56,13 @@ endi
if $data(1)[0] != 1 then if $data(1)[0] != 1 then
return -1 return -1
endi endi
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
return -1 return -1
endi endi
if $data(2)[0] != 2 then if $data(2)[0] != 2 then
return -1 return -1
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step2 goto step2
endi endi
......
...@@ -49,13 +49,13 @@ step2: ...@@ -49,13 +49,13 @@ step2:
return -1 return -1
endi endi
sql show mnodes -x step2 sql show mnodes -x step2
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
goto step2 goto step2
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step2 goto step2
endi endi
if $data(3)[2] != FOLLOWER then if $data(3)[2] != follower then
goto step2 goto step2
endi endi
...@@ -114,7 +114,7 @@ print $data(1)[0] $data(1)[1] $data(1)[2] ...@@ -114,7 +114,7 @@ print $data(1)[0] $data(1)[1] $data(1)[2]
print $data(2)[0] $data(2)[1] $data(2)[2] print $data(2)[0] $data(2)[1] $data(2)[2]
print $data(3)[0] $data(3)[1] $data(3)[2] print $data(3)[0] $data(3)[1] $data(3)[2]
if $data(2)[2] != OFFLINE then if $data(2)[2] != offline then
goto step5 goto step5
endi endi
......
...@@ -63,22 +63,22 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] ...@@ -63,22 +63,22 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
goto step3 goto step3
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step3 goto step3
endi endi
if $data(3)[2] != OFFLINE then if $data(3)[2] != offline then
goto step3 goto step3
endi endi
if $data(1)[3] != READY then if $data(1)[3] != ready then
goto step3 goto step3
endi endi
if $data(2)[3] != READY then if $data(2)[3] != ready then
goto step3 goto step3
endi endi
if $data(3)[3] != CREATING then if $data(3)[3] != creating then
goto step3 goto step3
endi endi
...@@ -97,22 +97,22 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] ...@@ -97,22 +97,22 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
goto step4 goto step4
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step4 goto step4
endi endi
if $data(3)[2] != FOLLOWER then if $data(3)[2] != follower then
goto step4 goto step4
endi endi
if $data(1)[3] != READY then if $data(1)[3] != ready then
goto step4 goto step4
endi endi
if $data(2)[3] != READY then if $data(2)[3] != ready then
goto step4 goto step4
endi endi
if $data(3)[3] != READY then if $data(3)[3] != ready then
goto step4 goto step4
endi endi
...@@ -132,22 +132,22 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] ...@@ -132,22 +132,22 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4] print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
goto step5 goto step5
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step5 goto step5
endi endi
if $data(3)[2] != OFFLINE then if $data(3)[2] != offline then
goto step5 goto step5
endi endi
if $data(1)[3] != READY then if $data(1)[3] != ready then
goto step5 goto step5
endi endi
if $data(2)[3] != READY then if $data(2)[3] != ready then
goto step5 goto step5
endi endi
if $data(3)[3] != DROPPING then if $data(3)[3] != dropping then
goto step5 goto step5
endi endi
...@@ -169,19 +169,19 @@ print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] ...@@ -169,19 +169,19 @@ print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $rows != 2 then if $rows != 2 then
goto step6 goto step6
endi endi
if $data(1)[2] != LEADER then if $data(1)[2] != leader then
goto step6 goto step6
endi endi
if $data(2)[2] != FOLLOWER then if $data(2)[2] != follower then
goto step6 goto step6
endi endi
if $data(3)[2] != null then if $data(3)[2] != null then
goto step6 goto step6
endi endi
if $data(1)[3] != READY then if $data(1)[3] != ready then
goto step6 goto step6
endi endi
if $data(2)[3] != READY then if $data(2)[3] != ready then
goto step6 goto step6
endi endi
if $data(3)[3] != null then if $data(3)[3] != null then
......
...@@ -24,7 +24,7 @@ if $data00 != 1 then ...@@ -24,7 +24,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
...@@ -71,7 +71,7 @@ if $data00 != 1 then ...@@ -71,7 +71,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
......
system sh/stop_dnodes.sh system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode1 -i 1
print ========= start dnode1 as LEADER print ========= start dnode1 as leader
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sql connect sql connect
......
...@@ -4,7 +4,7 @@ system sh/deploy.sh -n dnode1 -i 1 ...@@ -4,7 +4,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2 system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
print ========= start dnode1 as LEADER print ========= start dnode1 as leader
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 2000 sleep 2000
sql connect sql connect
......
...@@ -5,7 +5,7 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 2 ...@@ -5,7 +5,7 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c udf -v 1 system sh/cfg.sh -n dnode1 -c udf -v 1
print ========= start dnode1 as LEADER print ========= start dnode1 as leader
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sleep 1000 sleep 1000
sql connect sql connect
......
...@@ -24,7 +24,7 @@ if $data00 != 1 then ...@@ -24,7 +24,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
...@@ -71,7 +71,7 @@ if $data00 != 1 then ...@@ -71,7 +71,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
......
...@@ -105,21 +105,21 @@ if $rows != $vgroups then ...@@ -105,21 +105,21 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi endi
endi endi
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi endi
endi endi
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi endi
endi endi
...@@ -239,21 +239,21 @@ if $rows != $vgroups then ...@@ -239,21 +239,21 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi endi
endi endi
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi endi
endi endi
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi endi
endi endi
...@@ -447,21 +447,21 @@ if $rows != $vgroups then ...@@ -447,21 +447,21 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi endi
endi endi
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi endi
endi endi
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi endi
endi endi
......
...@@ -108,21 +108,21 @@ if $rows != $vgroups then ...@@ -108,21 +108,21 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi endi
endi endi
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi endi
endi endi
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi endi
endi endi
...@@ -130,21 +130,21 @@ else ...@@ -130,21 +130,21 @@ else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[1][4] == LEADER then if $data[1][4] == leader then
if $data[1][6] == FOLLOWER then if $data[1][6] == follower then
if $data[1][8] == FOLLOWER then if $data[1][8] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
endi endi
endi endi
elif $data[1][6] == LEADER then elif $data[1][6] == leader then
if $data[1][4] == FOLLOWER then if $data[1][4] == follower then
if $data[1][8] == FOLLOWER then if $data[1][8] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
endi endi
endi endi
elif $data[1][8] == LEADER then elif $data[1][8] == leader then
if $data[1][4] == FOLLOWER then if $data[1][4] == follower then
if $data[1][6] == FOLLOWER then if $data[1][6] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
endi endi
endi endi
...@@ -152,21 +152,21 @@ else ...@@ -152,21 +152,21 @@ else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[2][4] == LEADER then if $data[2][4] == leader then
if $data[2][6] == FOLLOWER then if $data[2][6] == follower then
if $data[2][8] == FOLLOWER then if $data[2][8] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
endi endi
endi endi
elif $data[2][6] == LEADER then elif $data[2][6] == leader then
if $data[2][4] == FOLLOWER then if $data[2][4] == follower then
if $data[2][8] == FOLLOWER then if $data[2][8] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
endi endi
endi endi
elif $data[2][8] == LEADER then elif $data[2][8] == leader then
if $data[2][4] == FOLLOWER then if $data[2][4] == follower then
if $data[2][6] == FOLLOWER then if $data[2][6] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
endi endi
endi endi
...@@ -174,21 +174,21 @@ else ...@@ -174,21 +174,21 @@ else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[3][4] == LEADER then if $data[3][4] == leader then
if $data[3][6] == FOLLOWER then if $data[3][6] == follower then
if $data[3][8] == FOLLOWER then if $data[3][8] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
endi endi
endi endi
elif $data[3][6] == LEADER then elif $data[3][6] == leader then
if $data[3][4] == FOLLOWER then if $data[3][4] == follower then
if $data[3][8] == FOLLOWER then if $data[3][8] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
endi endi
endi endi
elif $data[3][8] == LEADER then elif $data[3][8] == leader then
if $data[3][4] == FOLLOWER then if $data[3][4] == follower then
if $data[3][6] == FOLLOWER then if $data[3][6] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
endi endi
endi endi
...@@ -196,21 +196,21 @@ else ...@@ -196,21 +196,21 @@ else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[4][4] == LEADER then if $data[4][4] == leader then
if $data[4][6] == FOLLOWER then if $data[4][6] == follower then
if $data[4][8] == FOLLOWER then if $data[4][8] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
endi endi
endi endi
elif $data[4][6] == LEADER then elif $data[4][6] == leader then
if $data[4][4] == FOLLOWER then if $data[4][4] == follower then
if $data[4][8] == FOLLOWER then if $data[4][8] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
endi endi
endi endi
elif $data[4][8] == LEADER then elif $data[4][8] == leader then
if $data[4][4] == FOLLOWER then if $data[4][4] == follower then
if $data[4][6] == FOLLOWER then if $data[4][6] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
endi endi
endi endi
...@@ -335,21 +335,21 @@ if $rows != $vgroups then ...@@ -335,21 +335,21 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi endi
endi endi
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi endi
endi endi
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi endi
endi endi
...@@ -357,21 +357,21 @@ else ...@@ -357,21 +357,21 @@ else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[1][4] == LEADER then if $data[1][4] == leader then
if $data[1][6] == FOLLOWER then if $data[1][6] == follower then
if $data[1][8] == FOLLOWER then if $data[1][8] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
endi endi
endi endi
elif $data[1][6] == LEADER then elif $data[1][6] == leader then
if $data[1][4] == FOLLOWER then if $data[1][4] == follower then
if $data[1][8] == FOLLOWER then if $data[1][8] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
endi endi
endi endi
elif $data[1][8] == LEADER then elif $data[1][8] == leader then
if $data[1][4] == FOLLOWER then if $data[1][4] == follower then
if $data[1][6] == FOLLOWER then if $data[1][6] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
endi endi
endi endi
...@@ -379,21 +379,21 @@ else ...@@ -379,21 +379,21 @@ else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[2][4] == LEADER then if $data[2][4] == leader then
if $data[2][6] == FOLLOWER then if $data[2][6] == follower then
if $data[2][8] == FOLLOWER then if $data[2][8] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
endi endi
endi endi
elif $data[2][6] == LEADER then elif $data[2][6] == leader then
if $data[2][4] == FOLLOWER then if $data[2][4] == follower then
if $data[2][8] == FOLLOWER then if $data[2][8] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
endi endi
endi endi
elif $data[2][8] == LEADER then elif $data[2][8] == leader then
if $data[2][4] == FOLLOWER then if $data[2][4] == follower then
if $data[2][6] == FOLLOWER then if $data[2][6] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
endi endi
endi endi
...@@ -401,21 +401,21 @@ else ...@@ -401,21 +401,21 @@ else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[3][4] == LEADER then if $data[3][4] == leader then
if $data[3][6] == FOLLOWER then if $data[3][6] == follower then
if $data[3][8] == FOLLOWER then if $data[3][8] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
endi endi
endi endi
elif $data[3][6] == LEADER then elif $data[3][6] == leader then
if $data[3][4] == FOLLOWER then if $data[3][4] == follower then
if $data[3][8] == FOLLOWER then if $data[3][8] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
endi endi
endi endi
elif $data[3][8] == LEADER then elif $data[3][8] == leader then
if $data[3][4] == FOLLOWER then if $data[3][4] == follower then
if $data[3][6] == FOLLOWER then if $data[3][6] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
endi endi
endi endi
...@@ -423,21 +423,21 @@ else ...@@ -423,21 +423,21 @@ else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[4][4] == LEADER then if $data[4][4] == leader then
if $data[4][6] == FOLLOWER then if $data[4][6] == follower then
if $data[4][8] == FOLLOWER then if $data[4][8] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
endi endi
endi endi
elif $data[4][6] == LEADER then elif $data[4][6] == leader then
if $data[4][4] == FOLLOWER then if $data[4][4] == follower then
if $data[4][8] == FOLLOWER then if $data[4][8] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
endi endi
endi endi
elif $data[4][8] == LEADER then elif $data[4][8] == leader then
if $data[4][4] == FOLLOWER then if $data[4][4] == follower then
if $data[4][6] == FOLLOWER then if $data[4][6] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
endi endi
endi endi
...@@ -635,21 +635,21 @@ if $rows != $vgroups then ...@@ -635,21 +635,21 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi endi
endi endi
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][8] == FOLLOWER then if $data[0][8] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi endi
endi endi
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == FOLLOWER then if $data[0][4] == follower then
if $data[0][6] == FOLLOWER then if $data[0][6] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi endi
endi endi
...@@ -657,21 +657,21 @@ else ...@@ -657,21 +657,21 @@ else
goto check_vg_ready3 goto check_vg_ready3
endi endi
if $data[1][4] == LEADER then if $data[1][4] == leader then
if $data[1][6] == FOLLOWER then if $data[1][6] == follower then
if $data[1][8] == FOLLOWER then if $data[1][8] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
endi endi
endi endi
elif $data[1][6] == LEADER then elif $data[1][6] == leader then
if $data[1][4] == FOLLOWER then if $data[1][4] == follower then
if $data[1][8] == FOLLOWER then if $data[1][8] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
endi endi
endi endi
elif $data[1][8] == LEADER then elif $data[1][8] == leader then
if $data[1][4] == FOLLOWER then if $data[1][4] == follower then
if $data[1][6] == FOLLOWER then if $data[1][6] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
endi endi
endi endi
...@@ -679,21 +679,21 @@ else ...@@ -679,21 +679,21 @@ else
goto check_vg_ready3 goto check_vg_ready3
endi endi
if $data[2][4] == LEADER then if $data[2][4] == leader then
if $data[2][6] == FOLLOWER then if $data[2][6] == follower then
if $data[2][8] == FOLLOWER then if $data[2][8] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
endi endi
endi endi
elif $data[2][6] == LEADER then elif $data[2][6] == leader then
if $data[2][4] == FOLLOWER then if $data[2][4] == follower then
if $data[2][8] == FOLLOWER then if $data[2][8] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
endi endi
endi endi
elif $data[2][8] == LEADER then elif $data[2][8] == leader then
if $data[2][4] == FOLLOWER then if $data[2][4] == follower then
if $data[2][6] == FOLLOWER then if $data[2][6] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
endi endi
endi endi
...@@ -701,21 +701,21 @@ else ...@@ -701,21 +701,21 @@ else
goto check_vg_ready3 goto check_vg_ready3
endi endi
if $data[3][4] == LEADER then if $data[3][4] == leader then
if $data[3][6] == FOLLOWER then if $data[3][6] == follower then
if $data[3][8] == FOLLOWER then if $data[3][8] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
endi endi
endi endi
elif $data[3][6] == LEADER then elif $data[3][6] == leader then
if $data[3][4] == FOLLOWER then if $data[3][4] == follower then
if $data[3][8] == FOLLOWER then if $data[3][8] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
endi endi
endi endi
elif $data[3][8] == LEADER then elif $data[3][8] == leader then
if $data[3][4] == FOLLOWER then if $data[3][4] == follower then
if $data[3][6] == FOLLOWER then if $data[3][6] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
endi endi
endi endi
...@@ -723,21 +723,21 @@ else ...@@ -723,21 +723,21 @@ else
goto check_vg_ready3 goto check_vg_ready3
endi endi
if $data[4][4] == LEADER then if $data[4][4] == leader then
if $data[4][6] == FOLLOWER then if $data[4][6] == follower then
if $data[4][8] == FOLLOWER then if $data[4][8] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
endi endi
endi endi
elif $data[4][6] == LEADER then elif $data[4][6] == leader then
if $data[4][4] == FOLLOWER then if $data[4][4] == follower then
if $data[4][8] == FOLLOWER then if $data[4][8] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
endi endi
endi endi
elif $data[4][8] == LEADER then elif $data[4][8] == leader then
if $data[4][4] == FOLLOWER then if $data[4][4] == follower then
if $data[4][6] == FOLLOWER then if $data[4][6] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
endi endi
endi endi
......
...@@ -103,13 +103,13 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -103,13 +103,13 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
goto vg_ready goto vg_ready
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
goto vg_ready goto vg_ready
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
goto vg_ready goto vg_ready
else else
...@@ -154,11 +154,11 @@ switch_leader_to_offine_loop: ...@@ -154,11 +154,11 @@ switch_leader_to_offine_loop:
print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*) print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*)
sql show vgroups sql show vgroups
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] $data[0][7] $data[0][8] $data[0][9] $data[0][6] $data[0][11] $data[0][12] $data[0][13] print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $data[0][6] $data[0][7] $data[0][8] $data[0][9] $data[0][6] $data[0][11] $data[0][12] $data[0][13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
$dnodeId = $data[0][3] $dnodeId = $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
$dnodeId = $data[0][5] $dnodeId = $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
$dnodeId = $data[0][7] $dnodeId = $data[0][7]
else else
print ====> no leader vnode!!! print ====> no leader vnode!!!
...@@ -186,13 +186,13 @@ if $rows != $vgroups then ...@@ -186,13 +186,13 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == OFFLINE then if $data[0][4] == offline then
print ---- vgroup $dnodeId leader switch to offline print ---- vgroup $dnodeId leader switch to offline
goto vg_offline_1 goto vg_offline_1
elif $data[0][6] == OFFLINE then elif $data[0][6] == offline then
print ---- vgroup $dnodeId leader switch to offline print ---- vgroup $dnodeId leader switch to offline
goto vg_offline_1 goto vg_offline_1
elif $data[0][8] == OFFLINE then elif $data[0][8] == offline then
print ---- vgroup $dnodeId leader switch to offline print ---- vgroup $dnodeId leader switch to offline
goto vg_offline_1 goto vg_offline_1
else else
...@@ -218,13 +218,13 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -218,13 +218,13 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
goto countinu_loop goto countinu_loop
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
goto countinu_loop goto countinu_loop
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
goto countinu_loop goto countinu_loop
else else
......
...@@ -104,7 +104,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -104,7 +104,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != NULL then if $data[0][6] != NULL then
goto check_vg_ready goto check_vg_ready
endi endi
...@@ -114,7 +114,7 @@ if $data[0][4] == LEADER then ...@@ -114,7 +114,7 @@ if $data[0][4] == LEADER then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
goto vg_ready goto vg_ready
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
if $data[0][4] != NULL then if $data[0][4] != NULL then
goto check_vg_ready goto check_vg_ready
endi endi
...@@ -124,7 +124,7 @@ if $data[0][6] == LEADER then ...@@ -124,7 +124,7 @@ if $data[0][6] == LEADER then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
goto vg_ready goto vg_ready
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
if $data[0][4] != NULL then if $data[0][4] != NULL then
goto check_vg_ready goto check_vg_ready
endi endi
...@@ -208,11 +208,11 @@ switch_leader_loop: ...@@ -208,11 +208,11 @@ switch_leader_loop:
print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*) print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*)
sql show vgroups sql show vgroups
print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13] print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
$dnodeId = $data[0][3] $dnodeId = $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
$dnodeId = $data[0][5] $dnodeId = $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
$dnodeId = $data[0][7] $dnodeId = $data[0][7]
else else
print ====> no leader vnode!!! print ====> no leader vnode!!!
...@@ -238,7 +238,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -238,7 +238,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != NULL then if $data[0][6] != NULL then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
...@@ -248,7 +248,7 @@ if $data[0][4] == LEADER then ...@@ -248,7 +248,7 @@ if $data[0][4] == LEADER then
print ---- vgroup $data[0][0] leader switch to dnode $data[0][3] print ---- vgroup $data[0][0] leader switch to dnode $data[0][3]
goto vg_ready_2 goto vg_ready_2
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
if $data[0][4] != NULL then if $data[0][4] != NULL then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
...@@ -258,7 +258,7 @@ if $data[0][6] == LEADER then ...@@ -258,7 +258,7 @@ if $data[0][6] == LEADER then
print ---- vgroup $data[0][0] leader switch to dnode $data[0][5] print ---- vgroup $data[0][0] leader switch to dnode $data[0][5]
goto vg_ready_2 goto vg_ready_2
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
if $data[0][4] != NULL then if $data[0][4] != NULL then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
...@@ -343,7 +343,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -343,7 +343,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != NULL then if $data[0][6] != NULL then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
...@@ -352,7 +352,7 @@ if $data[0][4] == LEADER then ...@@ -352,7 +352,7 @@ if $data[0][4] == LEADER then
endi endi
goto vg_ready_1 goto vg_ready_1
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
if $data[0][4] != NULL then if $data[0][4] != NULL then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
...@@ -361,7 +361,7 @@ if $data[0][6] == LEADER then ...@@ -361,7 +361,7 @@ if $data[0][6] == LEADER then
endi endi
goto vg_ready_1 goto vg_ready_1
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
if $data[0][4] != NULL then if $data[0][4] != NULL then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
......
...@@ -104,51 +104,51 @@ if $rows != $vgroups then ...@@ -104,51 +104,51 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
else else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[1][4] == LEADER then if $data[1][4] == leader then
print ---- vgroup $data[1][0] leader locate on dnode $data[0][3] print ---- vgroup $data[1][0] leader locate on dnode $data[0][3]
elif $data[1][6] == LEADER then elif $data[1][6] == leader then
print ---- vgroup $data[1][0] leader locate on dnode $data[0][5] print ---- vgroup $data[1][0] leader locate on dnode $data[0][5]
elif $data[1][8] == LEADER then elif $data[1][8] == leader then
print ---- vgroup $data[1][0] leader locate on dnode $data[0][7] print ---- vgroup $data[1][0] leader locate on dnode $data[0][7]
else else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[2][4] == LEADER then if $data[2][4] == leader then
print ---- vgroup $data[2][0] leader locate on dnode $data[0][3] print ---- vgroup $data[2][0] leader locate on dnode $data[0][3]
elif $data[2][6] == LEADER then elif $data[2][6] == leader then
print ---- vgroup $data[2][0] leader locate on dnode $data[0][5] print ---- vgroup $data[2][0] leader locate on dnode $data[0][5]
elif $data[2][8] == LEADER then elif $data[2][8] == leader then
print ---- vgroup $data[2][0] leader locate on dnode $data[0][7] print ---- vgroup $data[2][0] leader locate on dnode $data[0][7]
else else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[3][4] == LEADER then if $data[3][4] == leader then
print ---- vgroup $data[3][0] leader locate on dnode $data[0][3] print ---- vgroup $data[3][0] leader locate on dnode $data[0][3]
elif $data[3][6] == LEADER then elif $data[3][6] == leader then
print ---- vgroup $data[3][0] leader locate on dnode $data[0][5] print ---- vgroup $data[3][0] leader locate on dnode $data[0][5]
elif $data[3][8] == LEADER then elif $data[3][8] == leader then
print ---- vgroup $data[3][0] leader locate on dnode $data[0][7] print ---- vgroup $data[3][0] leader locate on dnode $data[0][7]
else else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[4][4] == LEADER then if $data[4][4] == leader then
print ---- vgroup $data[4][0] leader locate on dnode $data[0][3] print ---- vgroup $data[4][0] leader locate on dnode $data[0][3]
elif $data[4][6] == LEADER then elif $data[4][6] == leader then
print ---- vgroup $data[4][0] leader locate on dnode $data[0][5] print ---- vgroup $data[4][0] leader locate on dnode $data[0][5]
elif $data[4][8] == LEADER then elif $data[4][8] == leader then
print ---- vgroup $data[4][0] leader locate on dnode $data[0][7] print ---- vgroup $data[4][0] leader locate on dnode $data[0][7]
else else
goto check_vg_ready goto check_vg_ready
...@@ -272,51 +272,51 @@ if $rows != $vgroups then ...@@ -272,51 +272,51 @@ if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
else else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[1][4] == LEADER then if $data[1][4] == leader then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
elif $data[1][6] == LEADER then elif $data[1][6] == leader then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
elif $data[1][8] == LEADER then elif $data[1][8] == leader then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
else else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[2][4] == LEADER then if $data[2][4] == leader then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
elif $data[2][6] == LEADER then elif $data[2][6] == leader then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
elif $data[2][8] == LEADER then elif $data[2][8] == leader then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
else else
goto check_vg_ready goto check_vg_ready
endi endi
if $data[3][4] == LEADER then if $data[3][4] == leader then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
elif $data[3][6] == LEADER then elif $data[3][6] == leader then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
elif $data[3][8] == LEADER then elif $data[3][8] == leader then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
else else
goto check_vg_ready1 goto check_vg_ready1
endi endi
if $data[4][4] == LEADER then if $data[4][4] == leader then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
elif $data[4][6] == LEADER then elif $data[4][6] == leader then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
elif $data[4][8] == LEADER then elif $data[4][8] == leader then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
else else
goto check_vg_ready1 goto check_vg_ready1
......
...@@ -104,7 +104,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -104,7 +104,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != FLLOWER then if $data[0][6] != FLLOWER then
goto check_vg_ready goto check_vg_ready
endi endi
...@@ -114,7 +114,7 @@ if $data[0][4] == LEADER then ...@@ -114,7 +114,7 @@ if $data[0][4] == LEADER then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
goto vg_ready goto vg_ready
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
if $data[0][4] != FLLOWER then if $data[0][4] != FLLOWER then
goto check_vg_ready goto check_vg_ready
endi endi
...@@ -124,7 +124,7 @@ if $data[0][6] == LEADER then ...@@ -124,7 +124,7 @@ if $data[0][6] == LEADER then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
goto vg_ready goto vg_ready
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
if $data[0][4] != FLLOWER then if $data[0][4] != FLLOWER then
goto check_vg_ready goto check_vg_ready
endi endi
...@@ -199,11 +199,11 @@ endi ...@@ -199,11 +199,11 @@ endi
print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*) print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*)
sql show vgroups sql show vgroups
print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13] print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
$dnodeId = $data[0][3] $dnodeId = $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
$dnodeId = $data[0][5] $dnodeId = $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
$dnodeId = $data[0][7] $dnodeId = $data[0][7]
else else
print ====> no leader vnode!!! print ====> no leader vnode!!!
...@@ -216,11 +216,11 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT ...@@ -216,11 +216,11 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT
sql show vgroups sql show vgroups
print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13] print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
print ---- vgroup $data[0][0] leader switch to dnode $data[0][3] print ---- vgroup $data[0][0] leader switch to dnode $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
print ---- vgroup $data[0][0] leader switch to dnode $data[0][5] print ---- vgroup $data[0][0] leader switch to dnode $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
print ---- vgroup $data[0][0] leader switch to dnode $data[0][7] print ---- vgroup $data[0][0] leader switch to dnode $data[0][7]
else else
print ====> no leader vnode!!! print ====> no leader vnode!!!
...@@ -264,7 +264,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -264,7 +264,7 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != FLLOWER then if $data[0][6] != FLLOWER then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
...@@ -273,7 +273,7 @@ if $data[0][4] == LEADER then ...@@ -273,7 +273,7 @@ if $data[0][4] == LEADER then
endi endi
goto vg_ready_1 goto vg_ready_1
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
if $data[0][4] != FLLOWER then if $data[0][4] != FLLOWER then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
...@@ -282,7 +282,7 @@ if $data[0][6] == LEADER then ...@@ -282,7 +282,7 @@ if $data[0][6] == LEADER then
endi endi
goto vg_ready_1 goto vg_ready_1
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
if $data[0][4] != FLLOWER then if $data[0][4] != FLLOWER then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
...@@ -325,27 +325,27 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT ...@@ -325,27 +325,27 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT
check_vg_ready_3: check_vg_ready_3:
sql show vgroups sql show vgroups
print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13] print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == LEADER then if $data[0][6] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
print ---- vgroup $data[0][0] leader locating dnode $data[0][5] print ---- vgroup $data[0][0] leader locating dnode $data[0][5]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == LEADER then if $data[0][4] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
print ---- vgroup $data[0][0] leader locating dnode $data[0][7] print ---- vgroup $data[0][0] leader locating dnode $data[0][7]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == LEADER then if $data[0][4] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
print ---- vgroup $data[0][0] leader locating dnode $data[0][9] print ---- vgroup $data[0][0] leader locating dnode $data[0][9]
......
...@@ -103,29 +103,29 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -103,29 +103,29 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto check_vg_ready goto check_vg_ready
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto check_vg_ready goto check_vg_ready
endi endi
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
goto vg_ready goto vg_ready
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] != FOLLOWER then if $data[0][4] != follower then
goto check_vg_ready goto check_vg_ready
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto check_vg_ready goto check_vg_ready
endi endi
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
goto vg_ready goto vg_ready
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] != FOLLOWER then if $data[0][4] != follower then
goto check_vg_ready goto check_vg_ready
endi endi
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto check_vg_ready goto check_vg_ready
endi endi
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
...@@ -193,11 +193,11 @@ switch_leader_loop: ...@@ -193,11 +193,11 @@ switch_leader_loop:
print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*) print ====> finde vnode of leader, and stop the dnode where the vnode is located, and query stb/ntb count(*)
sql show vgroups sql show vgroups
print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13] print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
$dnodeId = $data[0][3] $dnodeId = $data[0][3]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
$dnodeId = $data[0][5] $dnodeId = $data[0][5]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
$dnodeId = $data[0][7] $dnodeId = $data[0][7]
else else
print ====> no leader vnode!!! print ====> no leader vnode!!!
...@@ -226,29 +226,29 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -226,29 +226,29 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
print ---- vgroup $dnodeId leader switch to dnode $data[0][3] print ---- vgroup $dnodeId leader switch to dnode $data[0][3]
goto vg_ready_2 goto vg_ready_2
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] != FOLLOWER then if $data[0][4] != follower then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
print ---- vgroup $dnodeId leader switch to dnode $data[0][5] print ---- vgroup $dnodeId leader switch to dnode $data[0][5]
goto vg_ready_2 goto vg_ready_2
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] != FOLLOWER then if $data[0][4] != follower then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto check_vg_ready_2 goto check_vg_ready_2
endi endi
print ---- vgroup $dnodeId leader switch to dnode $data[0][7] print ---- vgroup $dnodeId leader switch to dnode $data[0][7]
...@@ -329,29 +329,29 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d ...@@ -329,29 +329,29 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4] $data[0][5] $d
if $rows != $vgroups then if $rows != $vgroups then
return -1 return -1
endi endi
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
goto vg_ready_1 goto vg_ready_1
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
if $data[0][4] != FOLLOWER then if $data[0][4] != follower then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
if $data[0][8] != FOLLOWER then if $data[0][8] != follower then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
goto vg_ready_1 goto vg_ready_1
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
if $data[0][4] != FOLLOWER then if $data[0][4] != follower then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
if $data[0][6] != FOLLOWER then if $data[0][6] != follower then
goto check_vg_ready_1 goto check_vg_ready_1
endi endi
goto vg_ready_1 goto vg_ready_1
...@@ -390,27 +390,27 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT ...@@ -390,27 +390,27 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT
check_vg_ready_3: check_vg_ready_3:
sql show vgroups sql show vgroups
print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13] print $data(2)[0] $data(2)[1] $data(2)[2] $data(2)[3] $data(2)[4] $data(2)[5] $data(2)[6] $data(2)[7] $data(2)[8] $data(2)[9] $data(2)[10] $data(2)[11] $data(2)[12] $data(2)[13]
if $data[0][4] == LEADER then if $data[0][4] == leader then
if $data[0][6] == LEADER then if $data[0][6] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
print ---- vgroup $data[0][0] leader locating dnode $data[0][5] print ---- vgroup $data[0][0] leader locating dnode $data[0][5]
elif $data[0][6] == LEADER then elif $data[0][6] == leader then
if $data[0][4] == LEADER then if $data[0][4] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
if $data[0][8] == LEADER then if $data[0][8] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
print ---- vgroup $data[0][0] leader locating dnode $data[0][7] print ---- vgroup $data[0][0] leader locating dnode $data[0][7]
elif $data[0][8] == LEADER then elif $data[0][8] == leader then
if $data[0][4] == LEADER then if $data[0][4] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
if $data[0][6] == LEADER then if $data[0][6] == leader then
goto check_vg_ready_3 goto check_vg_ready_3
endi endi
print ---- vgroup $data[0][0] leader locating dnode $data[0][9] print ---- vgroup $data[0][0] leader locating dnode $data[0][9]
......
...@@ -26,7 +26,7 @@ if $data00 != 1 then ...@@ -26,7 +26,7 @@ if $data00 != 1 then
return -1 return -1
endi endi
if $data02 != LEADER then if $data02 != leader then
return -1 return -1
endi endi
......
...@@ -75,7 +75,7 @@ def telemetryInfoCheck(infoDict=''): ...@@ -75,7 +75,7 @@ def telemetryInfoCheck(infoDict=''):
if k not in infoDict["cluster_info"]["dnodes"][0] or v != infoDict["cluster_info"]["dnodes"][0][k] : if k not in infoDict["cluster_info"]["dnodes"][0] or v != infoDict["cluster_info"]["dnodes"][0][k] :
tdLog.exit("dnodes info is null!") tdLog.exit("dnodes info is null!")
mnodes_info = { "mnode_id":1, "mnode_ep":f"{hostname}:{serverPort}","role": "LEADER" } mnodes_info = { "mnode_id":1, "mnode_ep":f"{hostname}:{serverPort}","role": "leader" }
for k ,v in mnodes_info.items(): for k ,v in mnodes_info.items():
if k not in infoDict["cluster_info"]["mnodes"][0] or v != infoDict["cluster_info"]["mnodes"][0][k] : if k not in infoDict["cluster_info"]["mnodes"][0] or v != infoDict["cluster_info"]["mnodes"][0][k] :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册