Merge pull request #29730 from taosdata/feat/3.0/TS-5584

Feat(sync):Add restore progress to the "show vnodes" command, and add…
This commit is contained in:
Shengliang Guan 2025-02-19 16:30:27 +08:00 committed by GitHub
commit d13f9448eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
33 changed files with 357 additions and 231 deletions

View File

@ -1355,10 +1355,10 @@ typedef struct {
int8_t encryptAlgorithm;
char dnodeListStr[TSDB_DNODE_LIST_LEN];
// 1. add auto-compact parameters
int32_t compactInterval; // minutes
int32_t compactStartTime; // minutes
int32_t compactEndTime; // minutes
int8_t compactTimeOffset; // hour
int32_t compactInterval; // minutes
int32_t compactStartTime; // minutes
int32_t compactEndTime; // minutes
int8_t compactTimeOffset; // hour
} SCreateDbReq;
int32_t tSerializeSCreateDbReq(void* buf, int32_t bufLen, SCreateDbReq* pReq);
@ -1777,6 +1777,8 @@ typedef struct {
int64_t numOfBatchInsertSuccessReqs;
int32_t numOfCachedTables;
int32_t learnerProgress; // use one reservered
int64_t syncAppliedIndex;
int64_t syncCommitIndex;
} SVnodeLoad;
typedef struct {
@ -3959,8 +3961,8 @@ typedef struct {
int8_t igExists;
int8_t intervalUnit;
int8_t slidingUnit;
int8_t timezone; // int8_t is not enough, timezone is unit of second
int32_t dstVgId; // for stream
int8_t timezone; // int8_t is not enough, timezone is unit of second
int32_t dstVgId; // for stream
int64_t interval;
int64_t offset;
int64_t sliding;

View File

@ -293,6 +293,7 @@ int32_t syncBecomeAssignedLeader(SSyncNode* ths, SRpcMsg* pRpcMsg);
int32_t syncUpdateArbTerm(int64_t rid, SyncTerm arbTerm);
SSyncState syncGetState(int64_t rid);
void syncGetCommitIndex(int64_t rid, int64_t* syncCommitIndex);
int32_t syncGetArbToken(int64_t rid, char* outToken);
int32_t syncCheckSynced(int64_t rid);
void syncGetRetryEpSet(int64_t rid, SEpSet* pEpSet);

View File

@ -322,8 +322,8 @@ typedef enum ELogicConditionType {
#define TSDB_ARB_GROUP_MEMBER_NUM 2
#define TSDB_ARB_TOKEN_SIZE 32
#define TSDB_TRANS_STAGE_LEN 12
#define TSDB_TRANS_TYPE_LEN 16
#define TSDB_TRANS_STAGE_LEN 12
#define TSDB_TRANS_TYPE_LEN 16
#define TSDB_TRANS_ERROR_LEN 512
#define TSDB_TRANS_OBJTYPE_LEN 40
#define TSDB_TRANS_RESULT_LEN 100
@ -357,6 +357,8 @@ typedef enum ELogicConditionType {
#define TSDB_MAX_REPLICA 5
#define TSDB_MAX_LEARNER_REPLICA 10
#define TSDB_SYNC_RESTORE_lEN 20
#define TSDB_SYNC_APPLY_COMMIT_LEN 41
#define TSDB_SYNC_LOG_BUFFER_SIZE 4096
#define TSDB_SYNC_LOG_BUFFER_RETENTION 256
#define TSDB_SYNC_LOG_BUFFER_THRESHOLD (1024 * 1024 * 5)
@ -672,7 +674,7 @@ typedef enum {
TSDB_VERSION_END,
} EVersionType;
#define MIN_RESERVE_MEM_SIZE 1024 // MB
#define MIN_RESERVE_MEM_SIZE 1024 // MB
#ifdef __cplusplus
}

View File

@ -14,8 +14,8 @@
*/
#define _DEFAULT_SOURCE
#include "tmsg.h"
#include "tglobal.h"
#include "tmsg.h"
#undef TD_MSG_NUMBER_
#undef TD_MSG_DICT_
@ -1471,6 +1471,12 @@ int32_t tSerializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pReq->analVer));
TAOS_CHECK_EXIT(tSerializeSMonitorParas(&encoder, &pReq->clusterCfg.monitorParas));
for (int32_t i = 0; i < vlen; ++i) {
SVnodeLoad *pload = taosArrayGet(pReq->pVloads, i);
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncAppliedIndex));
TAOS_CHECK_EXIT(tEncodeI64(&encoder, pload->syncCommitIndex));
}
tEndEncode(&encoder);
_exit:
@ -1600,6 +1606,14 @@ int32_t tDeserializeSStatusReq(void *buf, int32_t bufLen, SStatusReq *pReq) {
TAOS_CHECK_EXIT(tDeserializeSMonitorParas(&decoder, &pReq->clusterCfg.monitorParas));
}
if (!tDecodeIsEnd(&decoder)) {
for (int32_t i = 0; i < vlen; ++i) {
SVnodeLoad *pLoad = taosArrayGet(pReq->pVloads, i);
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pLoad->syncAppliedIndex));
TAOS_CHECK_EXIT(tDecodeI64(&decoder, &pLoad->syncCommitIndex));
}
}
tEndDecode(&decoder);
_exit:

View File

@ -293,12 +293,16 @@ static const SSysDbTableSchema vgroupsSchema[] = {
{.name = "tables", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true},
{.name = "v1_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true},
{.name = "v1_status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v1_applied/committed", .bytes = TSDB_SYNC_APPLY_COMMIT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v2_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true},
{.name = "v2_status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v2_applied/committed", .bytes = TSDB_SYNC_APPLY_COMMIT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v3_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true},
{.name = "v3_status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v3_applied/committed", .bytes = TSDB_SYNC_APPLY_COMMIT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v4_dnode", .bytes = 2, .type = TSDB_DATA_TYPE_SMALLINT, .sysInfo = true},
{.name = "v4_status", .bytes = 9 + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "v4_applied/committed", .bytes = TSDB_SYNC_APPLY_COMMIT_LEN + VARSTR_HEADER_SIZE, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "cacheload", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true},
{.name = "cacheelements", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true},
{.name = "tsma", .bytes = 1, .type = TSDB_DATA_TYPE_TINYINT, .sysInfo = true},
@ -369,6 +373,8 @@ static const SSysDbTableSchema vnodesSchema[] = {
{.name = "role_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "start_time", .bytes = 8, .type = TSDB_DATA_TYPE_TIMESTAMP, .sysInfo = true},
{.name = "restored", .bytes = 1, .type = TSDB_DATA_TYPE_BOOL, .sysInfo = true},
{.name = "apply_finish_time", .bytes = TSDB_SYNC_RESTORE_lEN, .type = TSDB_DATA_TYPE_VARCHAR, .sysInfo = true},
{.name = "unapplied", .bytes = 4, .type = TSDB_DATA_TYPE_INT, .sysInfo = true},
};
static const SSysDbTableSchema userUserPrivilegesSchema[] = {

View File

@ -136,7 +136,7 @@ typedef enum {
typedef enum {
TRN_KILL_MODE_SKIP = 0,
TRN_KILL_MODE_INTERUPT = 1,
//TRN_KILL_MODE_ROLLBACK = 2,
// TRN_KILL_MODE_ROLLBACK = 2,
} ETrnKillMode;
typedef enum {
@ -478,6 +478,10 @@ typedef struct {
int32_t dnodeId;
ESyncState syncState;
int64_t syncTerm;
int64_t syncAppliedIndex;
int64_t lastSyncAppliedIndexUpdateTime;
double appliedRate;
int64_t syncCommitIndex;
bool syncRestore;
bool syncCanRead;
int64_t roleTimeMs;

View File

@ -535,11 +535,37 @@ static int32_t mndCheckClusterCfgPara(SMnode *pMnode, SDnodeObj *pDnode, const S
return DND_REASON_ONLINE;
}
double calcAppliedRate(int64_t currentCount, int64_t lastCount, int64_t currentTimeMs, int64_t lastTimeMs) {
if ((currentTimeMs <= lastTimeMs) || (currentCount <= lastCount)) {
return 0.0;
}
int64_t deltaCount = currentCount - lastCount;
int64_t deltaMs = currentTimeMs - lastTimeMs;
double rate = (double)deltaCount / (double)deltaMs;
return rate;
}
static bool mndUpdateVnodeState(int32_t vgId, SVnodeGid *pGid, SVnodeLoad *pVload) {
bool stateChanged = false;
bool roleChanged = pGid->syncState != pVload->syncState ||
(pVload->syncTerm != -1 && pGid->syncTerm != pVload->syncTerm) ||
pGid->roleTimeMs != pVload->roleTimeMs;
if (pVload->syncCommitIndex > pVload->syncAppliedIndex) {
if (pGid->lastSyncAppliedIndexUpdateTime == 0) {
pGid->lastSyncAppliedIndexUpdateTime = taosGetTimestampMs();
} else if (pGid->syncAppliedIndex != pVload->syncAppliedIndex) {
int64_t currentTimeMs = taosGetTimestampMs();
pGid->appliedRate = calcAppliedRate(pVload->syncAppliedIndex, pGid->syncAppliedIndex, currentTimeMs,
pGid->lastSyncAppliedIndexUpdateTime);
pGid->lastSyncAppliedIndexUpdateTime = currentTimeMs;
}
}
pGid->syncAppliedIndex = pVload->syncAppliedIndex;
pGid->syncCommitIndex = pVload->syncCommitIndex;
if (roleChanged || pGid->syncRestore != pVload->syncRestore || pGid->syncCanRead != pVload->syncCanRead ||
pGid->startTimeMs != pVload->startTimeMs) {
mInfo(

View File

@ -244,6 +244,8 @@ static int32_t mndVgroupActionUpdate(SSdb *pSdb, SVgObj *pOld, SVgObj *pNew) {
pNewGid->syncState = pOldGid->syncState;
pNewGid->syncRestore = pOldGid->syncRestore;
pNewGid->syncCanRead = pOldGid->syncCanRead;
pNewGid->syncAppliedIndex = pOldGid->syncAppliedIndex;
pNewGid->syncCommitIndex = pOldGid->syncCommitIndex;
}
}
}
@ -1122,10 +1124,25 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p
mError("vgId:%d, failed to set role, since %s", pVgroup->vgId, tstrerror(code));
return code;
}
char applyStr[TSDB_SYNC_APPLY_COMMIT_LEN + 1] = {0};
char buf[TSDB_SYNC_APPLY_COMMIT_LEN + VARSTR_HEADER_SIZE + 1] = {0};
snprintf(applyStr, sizeof(applyStr), "%" PRId64 "/%" PRId64, pVgroup->vnodeGid[i].syncAppliedIndex,
pVgroup->vnodeGid[i].syncCommitIndex);
STR_WITH_MAXSIZE_TO_VARSTR(buf, applyStr, pShow->pMeta->pSchemas[cols].bytes);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
code = colDataSetVal(pColInfo, numOfRows, (const char *)&buf, false);
if (code != 0) {
mError("vgId:%d, failed to set role, since %s", pVgroup->vgId, tstrerror(code));
return code;
}
} else {
colDataSetNULL(pColInfo, numOfRows);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetNULL(pColInfo, numOfRows);
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
colDataSetNULL(pColInfo, numOfRows);
}
}
@ -1232,6 +1249,21 @@ int64_t mndGetVnodesMemory(SMnode *pMnode, int32_t dnodeId) {
return vnodeMemory;
}
void calculateRstoreFinishTime(double rate, int64_t applyCount, char *restoreStr, size_t restoreStrSize) {
if (rate == 0) {
snprintf(restoreStr, restoreStrSize, "0:0:0");
return;
}
int64_t costTime = applyCount / rate;
int64_t totalSeconds = costTime / 1000;
int64_t hours = totalSeconds / 3600;
totalSeconds %= 3600;
int64_t minutes = totalSeconds / 60;
int64_t seconds = totalSeconds % 60;
snprintf(restoreStr, restoreStrSize, "%" PRId64 ":%" PRId64 ":%" PRId64, hours, minutes, seconds);
}
static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
SMnode *pMnode = pReq->info.node;
SSdb *pSdb = pMnode->pSdb;
@ -1319,6 +1351,26 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
return code;
}
int64_t unappliedCount = pGid->syncCommitIndex - pGid->syncAppliedIndex;
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
char restoreStr[20] = {0};
if (unappliedCount > 0) {
calculateRstoreFinishTime(pGid->appliedRate, unappliedCount, restoreStr, sizeof(restoreStr));
}
STR_TO_VARSTR(buf, restoreStr);
code = colDataSetVal(pColInfo, numOfRows, (const char *)&buf, false);
if (code != 0) {
mError("vgId:%d, failed to set syncRestore finish time, since %s", pVgroup->vgId, tstrerror(code));
return code;
}
pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
code = colDataSetVal(pColInfo, numOfRows, (const char *)&unappliedCount, false);
if (code != 0) {
mError("vgId:%d, failed to set syncRestore, since %s", pVgroup->vgId, tstrerror(code));
return code;
}
numOfRows++;
sdbRelease(pSdb, pDnode);
}
@ -2771,7 +2823,7 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb
pVgroup->vnodeGid[0].dnodeId);
// add second
if (pNewVgroup->replica == 1){
if (pNewVgroup->replica == 1) {
TAOS_CHECK_RETURN(mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray));
}
@ -2792,8 +2844,8 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb
TAOS_CHECK_RETURN(mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup));
// add third
if (pNewVgroup->replica == 2){
TAOS_CHECK_RETURN (mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray));
if (pNewVgroup->replica == 2) {
TAOS_CHECK_RETURN(mndAddVnodeToVgroup(pMnode, pTrans, pNewVgroup, pArray));
}
pNewVgroup->vnodeGid[0].nodeRole = TAOS_SYNC_ROLE_VOTER;
@ -2823,7 +2875,7 @@ int32_t mndBuildAlterVgroupAction(SMnode *pMnode, STrans *pTrans, SDbObj *pOldDb
TAOS_CHECK_RETURN(mndRemoveVnodeFromVgroup(pMnode, pTrans, pNewVgroup, pArray, &del2));
TAOS_CHECK_RETURN(mndAddDropVnodeAction(pMnode, pTrans, pNewDb, pNewVgroup, &del2, true));
TAOS_CHECK_RETURN(
mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId));
mndAddAlterVnodeReplicaAction(pMnode, pTrans, pNewDb, pNewVgroup, pNewVgroup->vnodeGid[0].dnodeId));
TAOS_CHECK_RETURN(mndAddAlterVnodeConfirmAction(pMnode, pTrans, pNewDb, pNewVgroup));
} else if (pNewDb->cfg.replications == 2) {
mInfo("db:%s, vgId:%d, will add 1 vnode, vn:0 dnode:%d", pVgroup->dbName, pVgroup->vgId,

View File

@ -530,6 +530,8 @@ _exit:
int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) {
SSyncState state = syncGetState(pVnode->sync);
pLoad->syncAppliedIndex = pVnode->state.applied;
syncGetCommitIndex(pVnode->sync, &pLoad->syncCommitIndex);
pLoad->vgId = TD_VID(pVnode);
pLoad->syncState = state.state;

View File

@ -679,6 +679,14 @@ SSyncState syncGetState(int64_t rid) {
return state;
}
void syncGetCommitIndex(int64_t rid, int64_t* syncCommitIndex) {
SSyncNode* pSyncNode = syncNodeAcquire(rid);
if (pSyncNode != NULL) {
*syncCommitIndex = pSyncNode->commitIndex;
syncNodeRelease(pSyncNode);
}
}
int32_t syncGetArbToken(int64_t rid, char* outToken) {
int32_t code = 0;
SSyncNode* pSyncNode = syncNodeAcquire(rid);

View File

@ -61,11 +61,11 @@ class TDTestCase(TBase):
tdSql.query("show db.vgroups;")
if(tdSql.getData(0, 4) == "follower") and (tdSql.getData(0, 6) == "leader"):
if(tdSql.getData(0, 4) == "follower") and (tdSql.getData(0, 7) == "leader"):
tdLog.info("stop dnode2")
sc.dnodeStop(2)
if(tdSql.getData(0, 6) == "follower") and (tdSql.getData(0, 4) == "leader"):
if(tdSql.getData(0, 7) == "follower") and (tdSql.getData(0, 4) == "leader"):
tdLog.info("stop dnode 3")
sc.dnodeStop(3)
@ -74,7 +74,7 @@ class TDTestCase(TBase):
while count < 100:
tdSql.query("show db.vgroups;")
if(tdSql.getData(0, 4) == "assigned ") or (tdSql.getData(0, 6) == "assigned "):
if(tdSql.getData(0, 4) == "assigned ") or (tdSql.getData(0, 7) == "assigned "):
break
tdLog.info("wait %d seconds for set assigned"%count)

View File

@ -291,9 +291,9 @@ class ClusterComCheck:
return True
elif self.db_replica == 3 :
vgroup_status_first=[tdSql.res[0][4],tdSql.res[0][6],tdSql.res[0][8]]
vgroup_status_first=[tdSql.res[0][4],tdSql.res[0][7],tdSql.res[0][10]]
vgroup_status_last=[tdSql.res[last_number][4],tdSql.res[last_number][6],tdSql.res[last_number][8]]
vgroup_status_last=[tdSql.res[last_number][4],tdSql.res[last_number][7],tdSql.res[last_number][10]]
if vgroup_status_first.count('leader') == 1 and vgroup_status_first.count('follower') == 2:
if vgroup_status_last.count('leader') == 1 and vgroup_status_last.count('follower') == 2:
tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';")
@ -301,6 +301,18 @@ class ClusterComCheck:
if tdSql.res[0][0] == db_replica:
tdLog.success(f"elections of {db_name}.vgroups with replica {self.db_replica} are ready in {count} s")
return True
vgruop_apply_commit_first = [tdSql.res[0][5],tdSql.res[0][8],tdSql.res[0][11]]
vgruop_apply_commit_end = [tdSql.res[last_number][5],tdSql.res[last_number][8],tdSql.res[last_number][11]]
for i in range(3):
v = vgruop_apply_commit_first[i].split('/')
assert (int(v[0]) <= int(v[1])) ,f"apply {v[0]} > commit {v[1]}"
v = vgruop_apply_commit_end[i].split('/')
assert (int(v[0]) <= int(v[1])) ,f"apply {v[0]} > commit {v[1]}"
else:
tdLog.debug(tdSql.res)
tdLog.notice(f"elections of {db_name} all vgroups with replica {self.db_replica} are failed in {count} s ")

View File

@ -70,10 +70,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -98,10 +98,10 @@ endi
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
if $data(3)[7] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
if $data(3)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -75,10 +75,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -105,10 +105,10 @@ endi
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
if $data(3)[7] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
if $data(3)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -135,10 +135,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -165,10 +165,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -247,10 +247,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -307,10 +307,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -337,10 +337,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -70,10 +70,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -100,10 +100,10 @@ endi
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
if $data(3)[7] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
if $data(3)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -130,10 +130,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -160,10 +160,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -256,10 +256,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -286,10 +286,10 @@ endi
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
if $data(3)[7] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
if $data(3)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -316,10 +316,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -346,10 +346,10 @@ endi
if $data(4)[4] == leader then
$leaderExist = 1
endi
if $data(4)[6] == leader then
if $data(4)[7] == leader then
$leaderExist = 1
endi
if $data(4)[8] == leader then
if $data(4)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -73,13 +73,13 @@ if $data(2)[4] == leader then
$follower1 = 3
$follower2 = 4
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
$leaderVnode = 3
$follower1 = 2
$follower2 = 4
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
$leaderVnode = 4
$follower1 = 2
@ -109,10 +109,10 @@ endi
if $data(2)[3] != 2 then
return -1
endi
if $data(2)[5] != 3 then
if $data(2)[6] != 3 then
return -1
endi
if $data(2)[7] != 4 then
if $data(2)[9] != 4 then
return -1
endi
@ -199,10 +199,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -137,13 +137,13 @@ if $data(2)[4] == leader then
$follower1 = 3
$follower2 = 4
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
$leaderVnode = 3
$follower1 = 2
$follower2 = 4
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
$leaderVnode = 4
$follower1 = 2

View File

@ -116,13 +116,13 @@ if $data(2)[4] == leader then
$follower1 = 3
$follower2 = 4
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
$leaderVnode = 3
$follower1 = 2
$follower2 = 4
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
$leaderVnode = 4
$follower1 = 2

View File

@ -122,13 +122,13 @@ if $data(2)[4] == leader then
$follower1 = 3
$follower2 = 4
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
$leaderVnode = 3
$follower1 = 2
$follower2 = 4
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
$leaderVnode = 4
$follower1 = 2

View File

@ -136,13 +136,13 @@ if $data(2)[4] == leader then
$follower1 = 3
$follower2 = 4
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
$leaderVnode = 3
$follower1 = 2
$follower2 = 4
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
$leaderVnode = 4
$follower1 = 2

View File

@ -89,20 +89,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == 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
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi
@ -225,20 +225,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi
endi
elif $data[0][6] == leader then
elif $data[0][7] == leader then
if $data[0][4] == follower then
if $data[0][8] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi
@ -437,20 +437,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi
endi
elif $data[0][6] == leader then
elif $data[0][7] == leader then
if $data[0][4] == follower then
if $data[0][8] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi

View File

@ -92,20 +92,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi
endi
elif $data[0][6] == leader then
elif $data[0][7] == leader then
if $data[0][4] == follower then
if $data[0][8] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi
@ -114,20 +114,20 @@ else
endi
if $data[1][4] == leader then
if $data[1][6] == follower then
if $data[1][8] == follower then
if $data[1][7] == follower then
if $data[1][10] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
endi
endi
elif $data[1][6] == leader then
elif $data[1][7] == leader then
if $data[1][4] == follower then
if $data[1][8] == follower then
if $data[1][10] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
endi
endi
elif $data[1][8] == leader then
elif $data[1][10] == leader then
if $data[1][4] == follower then
if $data[1][6] == follower then
if $data[1][7] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
endi
endi
@ -136,20 +136,20 @@ else
endi
if $data[2][4] == leader then
if $data[2][6] == follower then
if $data[2][8] == follower then
if $data[2][7] == follower then
if $data[2][10] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
endi
endi
elif $data[2][6] == leader then
elif $data[2][7] == leader then
if $data[2][4] == follower then
if $data[2][8] == follower then
if $data[2][10] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
endi
endi
elif $data[2][8] == leader then
elif $data[2][10] == leader then
if $data[2][4] == follower then
if $data[2][6] == follower then
if $data[2][7] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
endi
endi
@ -158,20 +158,20 @@ else
endi
if $data[3][4] == leader then
if $data[3][6] == follower then
if $data[3][8] == follower then
if $data[3][7] == follower then
if $data[3][10] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
endi
endi
elif $data[3][6] == leader then
elif $data[3][7] == leader then
if $data[3][4] == follower then
if $data[3][8] == follower then
if $data[3][10] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
endi
endi
elif $data[3][8] == leader then
elif $data[3][10] == leader then
if $data[3][4] == follower then
if $data[3][6] == follower then
if $data[3][7] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
endi
endi
@ -180,20 +180,20 @@ else
endi
if $data[4][4] == leader then
if $data[4][6] == follower then
if $data[4][8] == follower then
if $data[4][7] == follower then
if $data[4][10] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
endi
endi
elif $data[4][6] == leader then
elif $data[4][7] == leader then
if $data[4][4] == follower then
if $data[4][8] == follower then
if $data[4][10] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
endi
endi
elif $data[4][8] == leader then
elif $data[4][10] == leader then
if $data[4][4] == follower then
if $data[4][6] == follower then
if $data[4][7] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
endi
endi
@ -305,20 +305,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi
endi
elif $data[0][6] == leader then
elif $data[0][7] == leader then
if $data[0][4] == follower then
if $data[0][8] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi
@ -327,20 +327,20 @@ else
endi
if $data[1][4] == leader then
if $data[1][6] == follower then
if $data[1][8] == follower then
if $data[1][7] == follower then
if $data[1][10] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
endi
endi
elif $data[1][6] == leader then
elif $data[1][7] == leader then
if $data[1][4] == follower then
if $data[1][8] == follower then
if $data[1][10] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
endi
endi
elif $data[1][8] == leader then
elif $data[1][10] == leader then
if $data[1][4] == follower then
if $data[1][6] == follower then
if $data[1][7] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
endi
endi
@ -349,20 +349,20 @@ else
endi
if $data[2][4] == leader then
if $data[2][6] == follower then
if $data[2][8] == follower then
if $data[2][7] == follower then
if $data[2][10] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
endi
endi
elif $data[2][6] == leader then
elif $data[2][7] == leader then
if $data[2][4] == follower then
if $data[2][8] == follower then
if $data[2][10] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
endi
endi
elif $data[2][8] == leader then
elif $data[2][10] == leader then
if $data[2][4] == follower then
if $data[2][6] == follower then
if $data[2][7] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
endi
endi
@ -371,20 +371,20 @@ else
endi
if $data[3][4] == leader then
if $data[3][6] == follower then
if $data[3][8] == follower then
if $data[3][7] == follower then
if $data[3][10] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
endi
endi
elif $data[3][6] == leader then
elif $data[3][7] == leader then
if $data[3][4] == follower then
if $data[3][8] == follower then
if $data[3][10] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
endi
endi
elif $data[3][8] == leader then
elif $data[3][10] == leader then
if $data[3][4] == follower then
if $data[3][6] == follower then
if $data[3][7] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
endi
endi
@ -393,20 +393,20 @@ else
endi
if $data[4][4] == leader then
if $data[4][6] == follower then
if $data[4][8] == follower then
if $data[4][7] == follower then
if $data[4][10] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
endi
endi
elif $data[4][6] == leader then
elif $data[4][7] == leader then
if $data[4][4] == follower then
if $data[4][8] == follower then
if $data[4][10] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
endi
endi
elif $data[4][8] == leader then
elif $data[4][10] == leader then
if $data[4][4] == follower then
if $data[4][6] == follower then
if $data[4][7] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
endi
endi
@ -607,20 +607,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi
endi
elif $data[0][6] == leader then
elif $data[0][7] == leader then
if $data[0][4] == follower then
if $data[0][8] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi
@ -629,20 +629,20 @@ else
endi
if $data[1][4] == leader then
if $data[1][6] == follower then
if $data[1][8] == follower then
if $data[1][7] == follower then
if $data[1][10] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][3]
endi
endi
elif $data[1][6] == leader then
elif $data[1][7] == leader then
if $data[1][4] == follower then
if $data[1][8] == follower then
if $data[1][10] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][5]
endi
endi
elif $data[1][8] == leader then
elif $data[1][10] == leader then
if $data[1][4] == follower then
if $data[1][6] == follower then
if $data[1][7] == follower then
print ---- vgroup $data[1][0] leader locate on dnode $data[1][7]
endi
endi
@ -651,20 +651,20 @@ else
endi
if $data[2][4] == leader then
if $data[2][6] == follower then
if $data[2][8] == follower then
if $data[2][7] == follower then
if $data[2][10] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][3]
endi
endi
elif $data[2][6] == leader then
elif $data[2][7] == leader then
if $data[2][4] == follower then
if $data[2][8] == follower then
if $data[2][10] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][5]
endi
endi
elif $data[2][8] == leader then
elif $data[2][10] == leader then
if $data[2][4] == follower then
if $data[2][6] == follower then
if $data[2][7] == follower then
print ---- vgroup $data[2][0] leader locate on dnode $data[2][7]
endi
endi
@ -673,20 +673,20 @@ else
endi
if $data[3][4] == leader then
if $data[3][6] == follower then
if $data[3][8] == follower then
if $data[3][7] == follower then
if $data[3][10] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][3]
endi
endi
elif $data[3][6] == leader then
elif $data[3][7] == leader then
if $data[3][4] == follower then
if $data[3][8] == follower then
if $data[3][10] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][5]
endi
endi
elif $data[3][8] == leader then
elif $data[3][10] == leader then
if $data[3][4] == follower then
if $data[3][6] == follower then
if $data[3][7] == follower then
print ---- vgroup $data[3][0] leader locate on dnode $data[3][7]
endi
endi
@ -695,20 +695,20 @@ else
endi
if $data[4][4] == leader then
if $data[4][6] == follower then
if $data[4][8] == follower then
if $data[4][7] == follower then
if $data[4][10] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][3]
endi
endi
elif $data[4][6] == leader then
elif $data[4][7] == leader then
if $data[4][4] == follower then
if $data[4][8] == follower then
if $data[4][10] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][5]
endi
endi
elif $data[4][8] == leader then
elif $data[4][10] == leader then
if $data[4][4] == follower then
if $data[4][6] == follower then
if $data[4][7] == follower then
print ---- vgroup $data[4][0] leader locate on dnode $data[4][7]
endi
endi

View File

@ -90,20 +90,20 @@ if $rows != $vgroups then
endi
if $data[0][4] == leader then
if $data[0][6] == follower then
if $data[0][8] == follower then
if $data[0][7] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][3]
endi
endi
elif $data[0][6] == leader then
elif $data[0][7] == leader then
if $data[0][4] == follower then
if $data[0][8] == follower then
if $data[0][10] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][5]
endi
endi
elif $data[0][8] == leader then
elif $data[0][10] == leader then
if $data[0][4] == follower then
if $data[0][6] == follower then
if $data[0][7] == follower then
print ---- vgroup $data[0][0] leader locate on dnode $data[0][7]
endi
endi

View File

@ -96,10 +96,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -141,10 +141,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -180,10 +180,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -220,10 +220,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -260,10 +260,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -300,10 +300,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -340,10 +340,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -71,10 +71,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -157,10 +157,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -227,10 +227,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -275,10 +275,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -313,10 +313,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -68,10 +68,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -96,10 +96,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -121,10 +121,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -146,10 +146,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -62,10 +62,10 @@ endi
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -70,10 +70,10 @@ $leaderExist = 0
if $data(2)[4] == leader then
$leaderExist = 1
endi
if $data(2)[6] == leader then
if $data(2)[7] == leader then
$leaderExist = 1
endi
if $data(2)[8] == leader then
if $data(2)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then
@ -83,10 +83,10 @@ $leaderExist = 0
if $data(3)[4] == leader then
$leaderExist = 1
endi
if $data(3)[6] == leader then
if $data(3)[7] == leader then
$leaderExist = 1
endi
if $data(3)[8] == leader then
if $data(3)[10] == leader then
$leaderExist = 1
endi
if $leaderExist != 1 then

View File

@ -222,8 +222,7 @@ class TDTestCase:
tdSql.query("select * from information_schema.ins_columns where db_name ='information_schema'")
tdLog.info(len(tdSql.queryResult))
tdSql.checkEqual(True, len(tdSql.queryResult) in range(314, 315))
tdSql.checkEqual(True, len(tdSql.queryResult) in range(320, 321))
tdSql.query("select * from information_schema.ins_columns where db_name ='performance_schema'")
tdSql.checkEqual(61, len(tdSql.queryResult))

View File

@ -27,8 +27,8 @@ class TDTestCase:
flag = 0
for vgid in range (vgNum) :
v1_status = tdSql.queryResult[vgid][4]
v2_status = tdSql.queryResult[vgid][6]
v3_status = tdSql.queryResult[vgid][8]
v2_status = tdSql.queryResult[vgid][7]
v3_status = tdSql.queryResult[vgid][10]
if ((v1_status == 'leader') and (v2_status == 'follower') and (v3_status == 'follower')) \
or ((v2_status == 'leader') and (v1_status == 'follower') and (v3_status == 'follower')) \
or ((v3_status == 'leader') and (v2_status == 'follower') and (v1_status == 'follower')):

View File

@ -80,7 +80,7 @@ class RestoreBasic:
for i in range(8):
leader = False
for j in range(3):
status = tdSql.getData(i, 4 + j*2)
status = tdSql.getData(i, 4 + j*3)
if status == "leader":
leader = True
elif status == "follower":

View File

@ -251,9 +251,9 @@ class ClusterComCheck:
return True
elif self.db_replica == 3 :
vgroup_status_first=[tdSql.queryResult[0][4],tdSql.queryResult[0][6],tdSql.queryResult[0][8]]
vgroup_status_first=[tdSql.queryResult[0][4],tdSql.queryResult[0][7],tdSql.queryResult[0][10]]
vgroup_status_last=[tdSql.queryResult[last_number][4],tdSql.queryResult[last_number][6],tdSql.queryResult[last_number][8]]
vgroup_status_last=[tdSql.queryResult[last_number][4],tdSql.queryResult[last_number][7],tdSql.queryResult[last_number][10]]
if vgroup_status_first.count('leader') == 1 and vgroup_status_first.count('follower') == 2:
if vgroup_status_last.count('leader') == 1 and vgroup_status_last.count('follower') == 2:
tdSql.query(f"select `replica` from information_schema.ins_databases where `name`='{db_name}';")

View File

@ -135,11 +135,9 @@ class TDTestCase:
vgroup_id = vgroup_info[0]
vgroup_status = []
for ind , role in enumerate(vgroup_info[3:-4]):
if ind%2==0:
continue
else:
if role in ['leader', 'leader*', 'leader**', 'follower']:
vgroup_status.append(role)
if vgroup_status.count("leader")!=1 or vgroup_status.count("follower")!=2:
status = False
return status