From e35ebdadac82f57b510bc05005c191e86fe761be Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 2 Jun 2022 14:35:59 +0800 Subject: [PATCH] refactor: rename LEADER to leader --- source/dnode/mnode/impl/src/mndMnode.c | 8 +- source/dnode/mnode/impl/src/mndVgroup.c | 2 +- source/libs/sync/src/syncMain.c | 8 +- source/util/src/terror.c | 2 +- tests/script/tsim/bnode/basic1.sim | 4 +- tests/script/tsim/db/alter_option.sim | 30 +- tests/script/tsim/db/alter_replica_13.sim | 6 +- tests/script/tsim/dnode/basic1.sim | 4 +- tests/script/tsim/mnode/basic1.sim | 12 +- tests/script/tsim/mnode/basic2.sim | 6 +- tests/script/tsim/mnode/basic3.sim | 8 +- tests/script/tsim/mnode/basic4.sim | 44 +-- tests/script/tsim/qnode/basic1.sim | 4 +- tests/script/tsim/query/explain.sim | 2 +- tests/script/tsim/query/scalarNull.sim | 2 +- tests/script/tsim/query/udf.sim | 2 +- tests/script/tsim/snode/basic1.sim | 4 +- tests/script/tsim/sync/3Replica1VgElect.sim | 54 ++-- tests/script/tsim/sync/3Replica5VgElect.sim | 270 +++++++++--------- tests/script/tsim/sync/oneReplica1VgElect.sim | 24 +- .../sync/oneReplica1VgElectWithInsert.sim | 24 +- tests/script/tsim/sync/oneReplica5VgElect.sim | 60 ++-- .../script/tsim/sync/threeReplica1VgElect.sim | 42 +-- .../sync/threeReplica1VgElectWihtInsert.sim | 78 ++--- tests/script/tsim/trans/create_db.sim | 2 +- tests/system-test/0-others/taosdMonitor.py | 2 +- 26 files changed, 352 insertions(+), 352 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndMnode.c b/source/dnode/mnode/impl/src/mndMnode.c index 7c94a33ffe..160fc8d428 100644 --- a/source/dnode/mnode/impl/src/mndMnode.c +++ b/source/dnode/mnode/impl/src/mndMnode.c @@ -655,7 +655,7 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, b1, false); - const char *roles = "OFFLINE"; + const char *roles = "offline"; if (pObj->id == pMnode->selfDnodeId) { roles = syncStr(TAOS_SYNC_STATE_LEADER); } @@ -667,9 +667,9 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); colDataAppend(pColInfo, numOfRows, (const char *)b2, false); - const char *status = "READY"; - if (objStatus == SDB_STATUS_CREATING) status = "CREATING"; - if (objStatus == SDB_STATUS_DROPPING) status = "DROPPING"; + const char *status = "ready"; + if (objStatus == SDB_STATUS_CREATING) status = "creating"; + if (objStatus == SDB_STATUS_DROPPING) status = "dropping"; 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/source/dnode/mnode/impl/src/mndVgroup.c b/source/dnode/mnode/impl/src/mndVgroup.c index 9262aa167b..2577febf66 100644 --- a/source/dnode/mnode/impl/src/mndVgroup.c +++ b/source/dnode/mnode/impl/src/mndVgroup.c @@ -705,7 +705,7 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p } 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); pColInfo = taosArrayGet(pBlock->pDataBlock, cols++); diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 620fc514c6..66806dbd0c 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1450,12 +1450,12 @@ static void syncFreeNode(void* param) { const char* syncStr(ESyncState state) { switch (state) { case TAOS_SYNC_STATE_FOLLOWER: - return "FOLLOWER"; + return "follower"; case TAOS_SYNC_STATE_CANDIDATE: - return "CANDIDATE"; + return "candidate"; case TAOS_SYNC_STATE_LEADER: - return "LEADER"; + return "leader"; default: - return "ERROR"; + return "error"; } } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index 74fc14ecdd..a72a6e4df2 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -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_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_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 TAOS_DEFINE_ERROR(TSDB_CODE_MND_ACCT_ALREADY_EXIST, "Account already exists") diff --git a/tests/script/tsim/bnode/basic1.sim b/tests/script/tsim/bnode/basic1.sim index b1db6efc72..80608453b8 100644 --- a/tests/script/tsim/bnode/basic1.sim +++ b/tests/script/tsim/bnode/basic1.sim @@ -24,7 +24,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi @@ -71,7 +71,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi diff --git a/tests/script/tsim/db/alter_option.sim b/tests/script/tsim/db/alter_option.sim index aeb04293f2..f3adb4535e 100644 --- a/tests/script/tsim/db/alter_option.sim +++ b/tests/script/tsim/db/alter_option.sim @@ -131,43 +131,43 @@ endi sleep 3000 #sql show db.vgroups -#if $data[0][4] == LEADER then -# if $data[0][6] != FOLLOWER then +#if $data[0][4] == leader then +# if $data[0][6] != follower then # return -1 # endi -# if $data[0][8] != FOLLOWER then +# if $data[0][8] != follower then # return -1 # endi #endi -#if $data[0][6] == LEADER then -# if $data[0][4] != FOLLOWER then +#if $data[0][6] == leader then +# if $data[0][4] != follower then # return -1 # endi -# if $data[0][8] != FOLLOWER then +# if $data[0][8] != follower then # return -1 # endi #endi -#if $data[0][8] == LEADER then -# if $data[0][4] != FOLLOWER then +#if $data[0][8] == leader then +# if $data[0][4] != follower then # return -1 # endi -# if $data[0][6] != FOLLOWER then +# if $data[0][6] != follower then # return -1 # endi #endi # -#if $data[0][4] != LEADER then -# if $data[0][4] != FOLLOWER then +#if $data[0][4] != leader then +# if $data[0][4] != follower then # return -1 # endi #endi -#if $data[0][6] != LEADER then -# if $data[0][6] != FOLLOWER then +#if $data[0][6] != leader then +# if $data[0][6] != follower then # return -1 # endi #endi -#if $data[0][8] != LEADER then -# if $data[0][8] != FOLLOWER then +#if $data[0][8] != leader then +# if $data[0][8] != follower then # return -1 # endi #endi diff --git a/tests/script/tsim/db/alter_replica_13.sim b/tests/script/tsim/db/alter_replica_13.sim index ded828e3f8..e20bf6937d 100644 --- a/tests/script/tsim/db/alter_replica_13.sim +++ b/tests/script/tsim/db/alter_replica_13.sim @@ -117,13 +117,13 @@ step4: sql show db.vgroups print ===> rows: $rows print ===> $data00 $data01 $data02 $data03 $data04 $data05 -if $data[0][4] != LEADER then +if $data[0][4] != leader then goto step4 endi -if $data[0][6] != FOLLOWER then +if $data[0][6] != follower then goto step4 endi -if $data[0][8] != FOLLOWER then +if $data[0][8] != follower then goto step4 endi diff --git a/tests/script/tsim/dnode/basic1.sim b/tests/script/tsim/dnode/basic1.sim index d5c791e902..a5b5427e03 100644 --- a/tests/script/tsim/dnode/basic1.sim +++ b/tests/script/tsim/dnode/basic1.sim @@ -27,7 +27,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi @@ -74,7 +74,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi diff --git a/tests/script/tsim/mnode/basic1.sim b/tests/script/tsim/mnode/basic1.sim index e922ebe376..d93d4ca53f 100644 --- a/tests/script/tsim/mnode/basic1.sim +++ b/tests/script/tsim/mnode/basic1.sim @@ -15,7 +15,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi @@ -59,13 +59,13 @@ endi if $data(1)[0] != 1 then return -1 endi -if $data(1)[2] != LEADER then +if $data(1)[2] != leader then return -1 endi if $data(2)[0] != 2 then return -1 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step2 endi @@ -95,7 +95,7 @@ endi if $data(1)[0] != 1 then return -1 endi -if $data(1)[2] != LEADER then +if $data(1)[2] != leader then return -1 endi if $data(2)[0] != null then @@ -131,13 +131,13 @@ endi if $data(1)[0] != 1 then return -1 endi -if $data(1)[2] != LEADER then +if $data(1)[2] != leader then return -1 endi if $data(2)[0] != 2 then return -1 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step3 endi diff --git a/tests/script/tsim/mnode/basic2.sim b/tests/script/tsim/mnode/basic2.sim index 18aa85cf5b..78558263d6 100644 --- a/tests/script/tsim/mnode/basic2.sim +++ b/tests/script/tsim/mnode/basic2.sim @@ -15,7 +15,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi @@ -56,13 +56,13 @@ endi if $data(1)[0] != 1 then return -1 endi -if $data(1)[2] != LEADER then +if $data(1)[2] != leader then return -1 endi if $data(2)[0] != 2 then return -1 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step2 endi diff --git a/tests/script/tsim/mnode/basic3.sim b/tests/script/tsim/mnode/basic3.sim index edbf429075..bc70cd7a85 100644 --- a/tests/script/tsim/mnode/basic3.sim +++ b/tests/script/tsim/mnode/basic3.sim @@ -49,13 +49,13 @@ step2: return -1 endi sql show mnodes -x step2 -if $data(1)[2] != LEADER then +if $data(1)[2] != leader then goto step2 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step2 endi -if $data(3)[2] != FOLLOWER then +if $data(3)[2] != follower then goto step2 endi @@ -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(3)[0] $data(3)[1] $data(3)[2] -if $data(2)[2] != OFFLINE then +if $data(2)[2] != offline then goto step5 endi diff --git a/tests/script/tsim/mnode/basic4.sim b/tests/script/tsim/mnode/basic4.sim index 2a4a9d3626..3874b11317 100644 --- a/tests/script/tsim/mnode/basic4.sim +++ b/tests/script/tsim/mnode/basic4.sim @@ -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[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 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step3 endi -if $data(3)[2] != OFFLINE then +if $data(3)[2] != offline then goto step3 endi -if $data(1)[3] != READY then +if $data(1)[3] != ready then goto step3 endi -if $data(2)[3] != READY then +if $data(2)[3] != ready then goto step3 endi -if $data(3)[3] != CREATING then +if $data(3)[3] != creating then goto step3 endi @@ -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[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 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step4 endi -if $data(3)[2] != FOLLOWER then +if $data(3)[2] != follower then goto step4 endi -if $data(1)[3] != READY then +if $data(1)[3] != ready then goto step4 endi -if $data(2)[3] != READY then +if $data(2)[3] != ready then goto step4 endi -if $data(3)[3] != READY then +if $data(3)[3] != ready then goto step4 endi @@ -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[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 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step5 endi -if $data(3)[2] != OFFLINE then +if $data(3)[2] != offline then goto step5 endi -if $data(1)[3] != READY then +if $data(1)[3] != ready then goto step5 endi -if $data(2)[3] != READY then +if $data(2)[3] != ready then goto step5 endi -if $data(3)[3] != DROPPING then +if $data(3)[3] != dropping then goto step5 endi @@ -169,19 +169,19 @@ print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4] if $rows != 2 then goto step6 endi -if $data(1)[2] != LEADER then +if $data(1)[2] != leader then goto step6 endi -if $data(2)[2] != FOLLOWER then +if $data(2)[2] != follower then goto step6 endi if $data(3)[2] != null then goto step6 endi -if $data(1)[3] != READY then +if $data(1)[3] != ready then goto step6 endi -if $data(2)[3] != READY then +if $data(2)[3] != ready then goto step6 endi if $data(3)[3] != null then diff --git a/tests/script/tsim/qnode/basic1.sim b/tests/script/tsim/qnode/basic1.sim index 2351403909..7108fcaf59 100644 --- a/tests/script/tsim/qnode/basic1.sim +++ b/tests/script/tsim/qnode/basic1.sim @@ -24,7 +24,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi @@ -71,7 +71,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi diff --git a/tests/script/tsim/query/explain.sim b/tests/script/tsim/query/explain.sim index 21162a99b0..2b0d52d253 100644 --- a/tests/script/tsim/query/explain.sim +++ b/tests/script/tsim/query/explain.sim @@ -1,7 +1,7 @@ system sh/stop_dnodes.sh 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 sql connect diff --git a/tests/script/tsim/query/scalarNull.sim b/tests/script/tsim/query/scalarNull.sim index c7e7aa9a34..b08ac1d3d9 100644 --- a/tests/script/tsim/query/scalarNull.sim +++ b/tests/script/tsim/query/scalarNull.sim @@ -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 numOfMnodes -v 1 -print ========= start dnode1 as LEADER +print ========= start dnode1 as leader system sh/exec.sh -n dnode1 -s start sleep 2000 sql connect diff --git a/tests/script/tsim/query/udf.sim b/tests/script/tsim/query/udf.sim index 24ddcc1b75..93cae4e391 100644 --- a/tests/script/tsim/query/udf.sim +++ b/tests/script/tsim/query/udf.sim @@ -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 udf -v 1 -print ========= start dnode1 as LEADER +print ========= start dnode1 as leader system sh/exec.sh -n dnode1 -s start sleep 1000 sql connect diff --git a/tests/script/tsim/snode/basic1.sim b/tests/script/tsim/snode/basic1.sim index 660951c591..a9d4867354 100644 --- a/tests/script/tsim/snode/basic1.sim +++ b/tests/script/tsim/snode/basic1.sim @@ -24,7 +24,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi @@ -71,7 +71,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi diff --git a/tests/script/tsim/sync/3Replica1VgElect.sim b/tests/script/tsim/sync/3Replica1VgElect.sim index 61b3b09288..e531fa82ad 100644 --- a/tests/script/tsim/sync/3Replica1VgElect.sim +++ b/tests/script/tsim/sync/3Replica1VgElect.sim @@ -105,21 +105,21 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] == FOLLOWER then - if $data[0][8] == FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] endi endi -elif $data[0][6] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][8] == FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] endi endi -elif $data[0][8] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][6] == FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] == follower then + if $data[0][6] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi @@ -239,21 +239,21 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] == FOLLOWER then - if $data[0][8] == FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] endi endi -elif $data[0][6] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][8] == FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] endi endi -elif $data[0][8] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][6] == FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] == follower then + if $data[0][6] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi @@ -447,21 +447,21 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] == FOLLOWER then - if $data[0][8] == FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] endi endi -elif $data[0][6] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][8] == FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] endi endi -elif $data[0][8] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][6] == FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] == follower then + if $data[0][6] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi diff --git a/tests/script/tsim/sync/3Replica5VgElect.sim b/tests/script/tsim/sync/3Replica5VgElect.sim index 4041263e55..2e05e848be 100644 --- a/tests/script/tsim/sync/3Replica5VgElect.sim +++ b/tests/script/tsim/sync/3Replica5VgElect.sim @@ -108,21 +108,21 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] == FOLLOWER then - if $data[0][8] == FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] endi endi -elif $data[0][6] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][8] == FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] endi endi -elif $data[0][8] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][6] == FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] == follower then + if $data[0][6] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi @@ -130,21 +130,21 @@ else goto check_vg_ready endi -if $data[1][4] == LEADER then - if $data[1][6] == FOLLOWER then - if $data[1][8] == FOLLOWER then +if $data[1][4] == leader then + if $data[1][6] == follower then + if $data[1][8] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] endi endi -elif $data[1][6] == LEADER then - if $data[1][4] == FOLLOWER then - if $data[1][8] == FOLLOWER then +elif $data[1][6] == leader then + if $data[1][4] == follower then + if $data[1][8] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] endi endi -elif $data[1][8] == LEADER then - if $data[1][4] == FOLLOWER then - if $data[1][6] == FOLLOWER then +elif $data[1][8] == leader then + if $data[1][4] == follower then + if $data[1][6] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] endi endi @@ -152,21 +152,21 @@ else goto check_vg_ready endi -if $data[2][4] == LEADER then - if $data[2][6] == FOLLOWER then - if $data[2][8] == FOLLOWER then +if $data[2][4] == leader then + if $data[2][6] == follower then + if $data[2][8] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] endi endi -elif $data[2][6] == LEADER then - if $data[2][4] == FOLLOWER then - if $data[2][8] == FOLLOWER then +elif $data[2][6] == leader then + if $data[2][4] == follower then + if $data[2][8] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] endi endi -elif $data[2][8] == LEADER then - if $data[2][4] == FOLLOWER then - if $data[2][6] == FOLLOWER then +elif $data[2][8] == leader then + if $data[2][4] == follower then + if $data[2][6] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] endi endi @@ -174,21 +174,21 @@ else goto check_vg_ready endi -if $data[3][4] == LEADER then - if $data[3][6] == FOLLOWER then - if $data[3][8] == FOLLOWER then +if $data[3][4] == leader then + if $data[3][6] == follower then + if $data[3][8] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] endi endi -elif $data[3][6] == LEADER then - if $data[3][4] == FOLLOWER then - if $data[3][8] == FOLLOWER then +elif $data[3][6] == leader then + if $data[3][4] == follower then + if $data[3][8] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] endi endi -elif $data[3][8] == LEADER then - if $data[3][4] == FOLLOWER then - if $data[3][6] == FOLLOWER then +elif $data[3][8] == leader then + if $data[3][4] == follower then + if $data[3][6] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] endi endi @@ -196,21 +196,21 @@ else goto check_vg_ready endi -if $data[4][4] == LEADER then - if $data[4][6] == FOLLOWER then - if $data[4][8] == FOLLOWER then +if $data[4][4] == leader then + if $data[4][6] == follower then + if $data[4][8] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] endi endi -elif $data[4][6] == LEADER then - if $data[4][4] == FOLLOWER then - if $data[4][8] == FOLLOWER then +elif $data[4][6] == leader then + if $data[4][4] == follower then + if $data[4][8] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] endi endi -elif $data[4][8] == LEADER then - if $data[4][4] == FOLLOWER then - if $data[4][6] == FOLLOWER then +elif $data[4][8] == leader then + if $data[4][4] == follower then + if $data[4][6] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] endi endi @@ -335,21 +335,21 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] == FOLLOWER then - if $data[0][8] == FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] endi endi -elif $data[0][6] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][8] == FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] endi endi -elif $data[0][8] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][6] == FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] == follower then + if $data[0][6] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi @@ -357,21 +357,21 @@ else goto check_vg_ready1 endi -if $data[1][4] == LEADER then - if $data[1][6] == FOLLOWER then - if $data[1][8] == FOLLOWER then +if $data[1][4] == leader then + if $data[1][6] == follower then + if $data[1][8] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] endi endi -elif $data[1][6] == LEADER then - if $data[1][4] == FOLLOWER then - if $data[1][8] == FOLLOWER then +elif $data[1][6] == leader then + if $data[1][4] == follower then + if $data[1][8] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] endi endi -elif $data[1][8] == LEADER then - if $data[1][4] == FOLLOWER then - if $data[1][6] == FOLLOWER then +elif $data[1][8] == leader then + if $data[1][4] == follower then + if $data[1][6] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] endi endi @@ -379,21 +379,21 @@ else goto check_vg_ready1 endi -if $data[2][4] == LEADER then - if $data[2][6] == FOLLOWER then - if $data[2][8] == FOLLOWER then +if $data[2][4] == leader then + if $data[2][6] == follower then + if $data[2][8] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] endi endi -elif $data[2][6] == LEADER then - if $data[2][4] == FOLLOWER then - if $data[2][8] == FOLLOWER then +elif $data[2][6] == leader then + if $data[2][4] == follower then + if $data[2][8] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] endi endi -elif $data[2][8] == LEADER then - if $data[2][4] == FOLLOWER then - if $data[2][6] == FOLLOWER then +elif $data[2][8] == leader then + if $data[2][4] == follower then + if $data[2][6] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] endi endi @@ -401,21 +401,21 @@ else goto check_vg_ready1 endi -if $data[3][4] == LEADER then - if $data[3][6] == FOLLOWER then - if $data[3][8] == FOLLOWER then +if $data[3][4] == leader then + if $data[3][6] == follower then + if $data[3][8] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] endi endi -elif $data[3][6] == LEADER then - if $data[3][4] == FOLLOWER then - if $data[3][8] == FOLLOWER then +elif $data[3][6] == leader then + if $data[3][4] == follower then + if $data[3][8] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] endi endi -elif $data[3][8] == LEADER then - if $data[3][4] == FOLLOWER then - if $data[3][6] == FOLLOWER then +elif $data[3][8] == leader then + if $data[3][4] == follower then + if $data[3][6] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] endi endi @@ -423,21 +423,21 @@ else goto check_vg_ready1 endi -if $data[4][4] == LEADER then - if $data[4][6] == FOLLOWER then - if $data[4][8] == FOLLOWER then +if $data[4][4] == leader then + if $data[4][6] == follower then + if $data[4][8] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] endi endi -elif $data[4][6] == LEADER then - if $data[4][4] == FOLLOWER then - if $data[4][8] == FOLLOWER then +elif $data[4][6] == leader then + if $data[4][4] == follower then + if $data[4][8] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] endi endi -elif $data[4][8] == LEADER then - if $data[4][4] == FOLLOWER then - if $data[4][6] == FOLLOWER then +elif $data[4][8] == leader then + if $data[4][4] == follower then + if $data[4][6] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] endi endi @@ -635,21 +635,21 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] == FOLLOWER then - if $data[0][8] == FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] endi endi -elif $data[0][6] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][8] == FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] == follower then + if $data[0][8] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] endi endi -elif $data[0][8] == LEADER then - if $data[0][4] == FOLLOWER then - if $data[0][6] == FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] == follower then + if $data[0][6] == follower then print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi @@ -657,21 +657,21 @@ else goto check_vg_ready3 endi -if $data[1][4] == LEADER then - if $data[1][6] == FOLLOWER then - if $data[1][8] == FOLLOWER then +if $data[1][4] == leader then + if $data[1][6] == follower then + if $data[1][8] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][3] endi endi -elif $data[1][6] == LEADER then - if $data[1][4] == FOLLOWER then - if $data[1][8] == FOLLOWER then +elif $data[1][6] == leader then + if $data[1][4] == follower then + if $data[1][8] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][5] endi endi -elif $data[1][8] == LEADER then - if $data[1][4] == FOLLOWER then - if $data[1][6] == FOLLOWER then +elif $data[1][8] == leader then + if $data[1][4] == follower then + if $data[1][6] == follower then print ---- vgroup $data[1][0] leader locate on dnode $data[1][7] endi endi @@ -679,21 +679,21 @@ else goto check_vg_ready3 endi -if $data[2][4] == LEADER then - if $data[2][6] == FOLLOWER then - if $data[2][8] == FOLLOWER then +if $data[2][4] == leader then + if $data[2][6] == follower then + if $data[2][8] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][3] endi endi -elif $data[2][6] == LEADER then - if $data[2][4] == FOLLOWER then - if $data[2][8] == FOLLOWER then +elif $data[2][6] == leader then + if $data[2][4] == follower then + if $data[2][8] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][5] endi endi -elif $data[2][8] == LEADER then - if $data[2][4] == FOLLOWER then - if $data[2][6] == FOLLOWER then +elif $data[2][8] == leader then + if $data[2][4] == follower then + if $data[2][6] == follower then print ---- vgroup $data[2][0] leader locate on dnode $data[2][7] endi endi @@ -701,21 +701,21 @@ else goto check_vg_ready3 endi -if $data[3][4] == LEADER then - if $data[3][6] == FOLLOWER then - if $data[3][8] == FOLLOWER then +if $data[3][4] == leader then + if $data[3][6] == follower then + if $data[3][8] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][3] endi endi -elif $data[3][6] == LEADER then - if $data[3][4] == FOLLOWER then - if $data[3][8] == FOLLOWER then +elif $data[3][6] == leader then + if $data[3][4] == follower then + if $data[3][8] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][5] endi endi -elif $data[3][8] == LEADER then - if $data[3][4] == FOLLOWER then - if $data[3][6] == FOLLOWER then +elif $data[3][8] == leader then + if $data[3][4] == follower then + if $data[3][6] == follower then print ---- vgroup $data[3][0] leader locate on dnode $data[3][7] endi endi @@ -723,21 +723,21 @@ else goto check_vg_ready3 endi -if $data[4][4] == LEADER then - if $data[4][6] == FOLLOWER then - if $data[4][8] == FOLLOWER then +if $data[4][4] == leader then + if $data[4][6] == follower then + if $data[4][8] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][3] endi endi -elif $data[4][6] == LEADER then - if $data[4][4] == FOLLOWER then - if $data[4][8] == FOLLOWER then +elif $data[4][6] == leader then + if $data[4][4] == follower then + if $data[4][8] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][5] endi endi -elif $data[4][8] == LEADER then - if $data[4][4] == FOLLOWER then - if $data[4][6] == FOLLOWER then +elif $data[4][8] == leader then + if $data[4][4] == follower then + if $data[4][6] == follower then print ---- vgroup $data[4][0] leader locate on dnode $data[4][7] endi endi diff --git a/tests/script/tsim/sync/oneReplica1VgElect.sim b/tests/script/tsim/sync/oneReplica1VgElect.sim index d98b823192..cf8912e654 100644 --- a/tests/script/tsim/sync/oneReplica1VgElect.sim +++ b/tests/script/tsim/sync/oneReplica1VgElect.sim @@ -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 return -1 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] 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] 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] goto vg_ready else @@ -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(*) 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] -if $data[0][4] == LEADER then +if $data[0][4] == leader then $dnodeId = $data[0][3] -elif $data[0][6] == LEADER then +elif $data[0][6] == leader then $dnodeId = $data[0][5] -elif $data[0][8] == LEADER then +elif $data[0][8] == leader then $dnodeId = $data[0][7] else print ====> no leader vnode!!! @@ -186,13 +186,13 @@ if $rows != $vgroups then return -1 endi -if $data[0][4] == OFFLINE then +if $data[0][4] == offline then print ---- vgroup $dnodeId leader switch to offline goto vg_offline_1 -elif $data[0][6] == OFFLINE then +elif $data[0][6] == offline then print ---- vgroup $dnodeId leader switch to offline goto vg_offline_1 -elif $data[0][8] == OFFLINE then +elif $data[0][8] == offline then print ---- vgroup $dnodeId leader switch to offline goto vg_offline_1 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 if $rows != $vgroups then return -1 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] 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] 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] goto countinu_loop else diff --git a/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim b/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim index 7ceeb2806b..06a67b3c1b 100644 --- a/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim +++ b/tests/script/tsim/sync/oneReplica1VgElectWithInsert.sim @@ -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 return -1 endi -if $data[0][4] == LEADER then +if $data[0][4] == leader then if $data[0][6] != NULL then goto check_vg_ready endi @@ -114,7 +114,7 @@ if $data[0][4] == LEADER then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] goto vg_ready endi -if $data[0][6] == LEADER then +if $data[0][6] == leader then if $data[0][4] != NULL then goto check_vg_ready endi @@ -124,7 +124,7 @@ if $data[0][6] == LEADER then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] goto vg_ready endi -if $data[0][8] == LEADER then +if $data[0][8] == leader then if $data[0][4] != NULL then goto check_vg_ready endi @@ -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(*) 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] -if $data[0][4] == LEADER then +if $data[0][4] == leader then $dnodeId = $data[0][3] -elif $data[0][6] == LEADER then +elif $data[0][6] == leader then $dnodeId = $data[0][5] -elif $data[0][8] == LEADER then +elif $data[0][8] == leader then $dnodeId = $data[0][7] else 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 if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then +if $data[0][4] == leader then if $data[0][6] != NULL then goto check_vg_ready_2 endi @@ -248,7 +248,7 @@ if $data[0][4] == LEADER then print ---- vgroup $data[0][0] leader switch to dnode $data[0][3] goto vg_ready_2 endi -if $data[0][6] == LEADER then +if $data[0][6] == leader then if $data[0][4] != NULL then goto check_vg_ready_2 endi @@ -258,7 +258,7 @@ if $data[0][6] == LEADER then print ---- vgroup $data[0][0] leader switch to dnode $data[0][5] goto vg_ready_2 endi -if $data[0][8] == LEADER then +if $data[0][8] == leader then if $data[0][4] != NULL then goto check_vg_ready_2 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 if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then +if $data[0][4] == leader then if $data[0][6] != NULL then goto check_vg_ready_1 endi @@ -352,7 +352,7 @@ if $data[0][4] == LEADER then endi goto vg_ready_1 endi -if $data[0][6] == LEADER then +if $data[0][6] == leader then if $data[0][4] != NULL then goto check_vg_ready_1 endi @@ -361,7 +361,7 @@ if $data[0][6] == LEADER then endi goto vg_ready_1 endi -if $data[0][8] == LEADER then +if $data[0][8] == leader then if $data[0][4] != NULL then goto check_vg_ready_1 endi diff --git a/tests/script/tsim/sync/oneReplica5VgElect.sim b/tests/script/tsim/sync/oneReplica5VgElect.sim index d6d18093c3..5af48c7491 100644 --- a/tests/script/tsim/sync/oneReplica5VgElect.sim +++ b/tests/script/tsim/sync/oneReplica5VgElect.sim @@ -104,51 +104,51 @@ if $rows != $vgroups then return -1 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] -elif $data[0][6] == LEADER then +elif $data[0][6] == leader then 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] else goto check_vg_ready 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] -elif $data[1][6] == LEADER then +elif $data[1][6] == leader then 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] else goto check_vg_ready 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] -elif $data[2][6] == LEADER then +elif $data[2][6] == leader then 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] else goto check_vg_ready 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] -elif $data[3][6] == LEADER then +elif $data[3][6] == leader then 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] else goto check_vg_ready 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] -elif $data[4][6] == LEADER then +elif $data[4][6] == leader then 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] else goto check_vg_ready @@ -272,51 +272,51 @@ if $rows != $vgroups then return -1 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] -elif $data[0][6] == LEADER then +elif $data[0][6] == leader then 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] else goto check_vg_ready1 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] -elif $data[1][6] == LEADER then +elif $data[1][6] == leader then 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] else goto check_vg_ready1 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] -elif $data[2][6] == LEADER then +elif $data[2][6] == leader then 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] else goto check_vg_ready 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] -elif $data[3][6] == LEADER then +elif $data[3][6] == leader then 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] else goto check_vg_ready1 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] -elif $data[4][6] == LEADER then +elif $data[4][6] == leader then 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] else goto check_vg_ready1 diff --git a/tests/script/tsim/sync/threeReplica1VgElect.sim b/tests/script/tsim/sync/threeReplica1VgElect.sim index 1496d7c778..c3e9c13793 100644 --- a/tests/script/tsim/sync/threeReplica1VgElect.sim +++ b/tests/script/tsim/sync/threeReplica1VgElect.sim @@ -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 return -1 endi -if $data[0][4] == LEADER then +if $data[0][4] == leader then if $data[0][6] != FLLOWER then goto check_vg_ready endi @@ -114,7 +114,7 @@ if $data[0][4] == LEADER then print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] goto vg_ready endi -if $data[0][6] == LEADER then +if $data[0][6] == leader then if $data[0][4] != FLLOWER then goto check_vg_ready endi @@ -124,7 +124,7 @@ if $data[0][6] == LEADER then print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] goto vg_ready endi -if $data[0][8] == LEADER then +if $data[0][8] == leader then if $data[0][4] != FLLOWER then goto check_vg_ready 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(*) 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] -if $data[0][4] == LEADER then +if $data[0][4] == leader then $dnodeId = $data[0][3] -elif $data[0][6] == LEADER then +elif $data[0][6] == leader then $dnodeId = $data[0][5] -elif $data[0][8] == LEADER then +elif $data[0][8] == leader then $dnodeId = $data[0][7] else print ====> no leader vnode!!! @@ -216,11 +216,11 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT 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] -if $data[0][4] == LEADER then +if $data[0][4] == leader then 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] -elif $data[0][8] == LEADER then +elif $data[0][8] == leader then print ---- vgroup $data[0][0] leader switch to dnode $data[0][7] else 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 if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then +if $data[0][4] == leader then if $data[0][6] != FLLOWER then goto check_vg_ready_1 endi @@ -273,7 +273,7 @@ if $data[0][4] == LEADER then endi goto vg_ready_1 endi -if $data[0][6] == LEADER then +if $data[0][6] == leader then if $data[0][4] != FLLOWER then goto check_vg_ready_1 endi @@ -282,7 +282,7 @@ if $data[0][6] == LEADER then endi goto vg_ready_1 endi -if $data[0][8] == LEADER then +if $data[0][8] == leader then if $data[0][4] != FLLOWER then goto check_vg_ready_1 endi @@ -325,27 +325,27 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT check_vg_ready_3: 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] -if $data[0][4] == LEADER then - if $data[0][6] == LEADER then +if $data[0][4] == leader then + if $data[0][6] == leader then goto check_vg_ready_3 endi - if $data[0][8] == LEADER then + if $data[0][8] == leader then goto check_vg_ready_3 endi print ---- vgroup $data[0][0] leader locating dnode $data[0][5] -elif $data[0][6] == LEADER then - if $data[0][4] == LEADER then +elif $data[0][6] == leader then + if $data[0][4] == leader then goto check_vg_ready_3 endi - if $data[0][8] == LEADER then + if $data[0][8] == leader then goto check_vg_ready_3 endi print ---- vgroup $data[0][0] leader locating dnode $data[0][7] -elif $data[0][8] == LEADER then - if $data[0][4] == LEADER then +elif $data[0][8] == leader then + if $data[0][4] == leader then goto check_vg_ready_3 endi - if $data[0][6] == LEADER then + if $data[0][6] == leader then goto check_vg_ready_3 endi print ---- vgroup $data[0][0] leader locating dnode $data[0][9] diff --git a/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim b/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim index fc501096e6..3c21dff1b6 100644 --- a/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim +++ b/tests/script/tsim/sync/threeReplica1VgElectWihtInsert.sim @@ -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 return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] != FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] != follower then goto check_vg_ready endi - if $data[0][8] != FOLLOWER then + if $data[0][8] != follower then goto check_vg_ready endi print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] goto vg_ready -elif $data[0][6] == LEADER then - if $data[0][4] != FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] != follower then goto check_vg_ready endi - if $data[0][8] != FOLLOWER then + if $data[0][8] != follower then goto check_vg_ready endi print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] goto vg_ready -elif $data[0][8] == LEADER then - if $data[0][4] != FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] != follower then goto check_vg_ready endi - if $data[0][6] != FOLLOWER then + if $data[0][6] != follower then goto check_vg_ready endi print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] @@ -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(*) 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] -if $data[0][4] == LEADER then +if $data[0][4] == leader then $dnodeId = $data[0][3] -elif $data[0][6] == LEADER then +elif $data[0][6] == leader then $dnodeId = $data[0][5] -elif $data[0][8] == LEADER then +elif $data[0][8] == leader then $dnodeId = $data[0][7] else 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 if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] != FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] != follower then goto check_vg_ready_2 endi - if $data[0][8] != FOLLOWER then + if $data[0][8] != follower then goto check_vg_ready_2 endi print ---- vgroup $dnodeId leader switch to dnode $data[0][3] goto vg_ready_2 -elif $data[0][6] == LEADER then - if $data[0][4] != FOLLOWER then +elif $data[0][6] == leader then + if $data[0][4] != follower then goto check_vg_ready_2 endi - if $data[0][8] != FOLLOWER then + if $data[0][8] != follower then goto check_vg_ready_2 endi print ---- vgroup $dnodeId leader switch to dnode $data[0][5] goto vg_ready_2 -elif $data[0][8] == LEADER then - if $data[0][4] != FOLLOWER then +elif $data[0][8] == leader then + if $data[0][4] != follower then goto check_vg_ready_2 endi - if $data[0][6] != FOLLOWER then + if $data[0][6] != follower then goto check_vg_ready_2 endi 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 if $rows != $vgroups then return -1 endi -if $data[0][4] == LEADER then - if $data[0][6] != FOLLOWER then +if $data[0][4] == leader then + if $data[0][6] != follower then goto check_vg_ready_1 endi - if $data[0][8] != FOLLOWER then + if $data[0][8] != follower then goto check_vg_ready_1 endi goto vg_ready_1 endi -if $data[0][6] == LEADER then - if $data[0][4] != FOLLOWER then +if $data[0][6] == leader then + if $data[0][4] != follower then goto check_vg_ready_1 endi - if $data[0][8] != FOLLOWER then + if $data[0][8] != follower then goto check_vg_ready_1 endi goto vg_ready_1 endi -if $data[0][8] == LEADER then - if $data[0][4] != FOLLOWER then +if $data[0][8] == leader then + if $data[0][4] != follower then goto check_vg_ready_1 endi - if $data[0][6] != FOLLOWER then + if $data[0][6] != follower then goto check_vg_ready_1 endi goto vg_ready_1 @@ -390,27 +390,27 @@ system sh/exec.sh -n $dnodeId -s stop -x SIGINT check_vg_ready_3: 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] -if $data[0][4] == LEADER then - if $data[0][6] == LEADER then +if $data[0][4] == leader then + if $data[0][6] == leader then goto check_vg_ready_3 endi - if $data[0][8] == LEADER then + if $data[0][8] == leader then goto check_vg_ready_3 endi print ---- vgroup $data[0][0] leader locating dnode $data[0][5] -elif $data[0][6] == LEADER then - if $data[0][4] == LEADER then +elif $data[0][6] == leader then + if $data[0][4] == leader then goto check_vg_ready_3 endi - if $data[0][8] == LEADER then + if $data[0][8] == leader then goto check_vg_ready_3 endi print ---- vgroup $data[0][0] leader locating dnode $data[0][7] -elif $data[0][8] == LEADER then - if $data[0][4] == LEADER then +elif $data[0][8] == leader then + if $data[0][4] == leader then goto check_vg_ready_3 endi - if $data[0][6] == LEADER then + if $data[0][6] == leader then goto check_vg_ready_3 endi print ---- vgroup $data[0][0] leader locating dnode $data[0][9] diff --git a/tests/script/tsim/trans/create_db.sim b/tests/script/tsim/trans/create_db.sim index 158a6b9f92..e13014f9c0 100644 --- a/tests/script/tsim/trans/create_db.sim +++ b/tests/script/tsim/trans/create_db.sim @@ -26,7 +26,7 @@ if $data00 != 1 then return -1 endi -if $data02 != LEADER then +if $data02 != leader then return -1 endi diff --git a/tests/system-test/0-others/taosdMonitor.py b/tests/system-test/0-others/taosdMonitor.py index 657979658e..a219c54e59 100644 --- a/tests/system-test/0-others/taosdMonitor.py +++ b/tests/system-test/0-others/taosdMonitor.py @@ -75,7 +75,7 @@ def telemetryInfoCheck(infoDict=''): if k not in infoDict["cluster_info"]["dnodes"][0] or v != infoDict["cluster_info"]["dnodes"][0][k] : 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(): if k not in infoDict["cluster_info"]["mnodes"][0] or v != infoDict["cluster_info"]["mnodes"][0][k] : -- GitLab