未验证 提交 31a90129 编写于 作者: S slguan 提交者: GitHub

Merge pull request #1675 from taosdata/feature/mpeer

[TD-148] change ip sets
上级 0c21848b 273cc322
Branches不可用
ver ver-3.1.0.2 ver-3.1.0.1 ver-3.1.0.0 ver-3.0.7.8 ver-3.0.7.1 ver-3.0.7.0 ver-3.0.6.1 ver-3.0.6.0 ver-3.0.5.1 ver-3.0.5.0 ver-3.0.4.2 ver-3.0.4.1 ver-3.0.4.0 ver-3.0.3.2 ver-3.0.3.1 ver-3.0.3.0 ver-3.0.2.220221228 ver-3.0.2.20221226 ver-3.0.2.20105 ver-3.0.2.6 ver-3.0.2.5 ver-3.0.2.4 ver-3.0.2.3 ver-3.0.2.2 ver-3.0.2.1 ver-3.0.2.0 ver-3.0.1.8 ver-3.0.1.7 ver-3.0.1.6 ver-3.0.1.5 ver-3.0.1.4 ver-3.0.1.3 ver-3.0.1.2 ver-3.0.1.1 ver-3.0.1.0 ver-3.0.0.2 ver-3.0.0.1 ver-3.0.0.0 ver-2.6.0.99 ver-2.6.0.63 ver-2.6.0.61 ver-2.6.0.59 ver-2.6.0.57 ver-2.6.0.55 ver-2.6.0.53 ver-2.6.0.51 ver-2.6.0.49 ver-2.6.0.47 ver-2.6.0.45 ver-2.6.0.44 ver-2.6.0.43 ver-2.6.0.41 ver-2.6.0.39 ver-2.6.0.38 ver-2.6.0.36 ver-2.6.0.35 ver-2.6.0.34 ver-2.6.0.33 ver-2.6.0.32 ver-2.6.0.31 ver-2.6.0.30 ver-2.6.0.28 ver-2.6.0.27 ver-2.6.0.25 ver-2.6.0.24 ver-2.6.0.22 ver-2.6.0.21 ver-2.6.0.19 ver-2.6.0.18 ver-2.6.0.17 ver-2.6.0.16 ver-2.6.0.15 ver-2.6.0.14 ver-2.6.0.12 ver-2.6.0.10 ver-2.6.0.8 ver-2.6.0.7 ver-2.6.0.6 ver-2.6.0.4 ver-2.6.0.3-kh ver-2.6.0.1 ver-2.6.0.0 ver-2.5.0.1 ver-2.5.0.0 ver-2.4.0.43 ver-2.4.0.41 ver-2.4.0.39 ver-2.4.0.38 ver-2.4.0.37 ver-2.4.0.36 ver-2.4.0.35 ver-2.4.0.33 ver-2.4.0.31 ver-2.4.0.30 ver-2.4.0.27 ver-2.4.0.26 ver-2.4.0.25 ver-2.4.0.24 ver-2.4.0.20 ver-2.4.0.18 ver-2.4.0.16 ver-2.4.0.14 ver-2.4.0.12 ver-2.4.0.11 ver-2.4.0.10 ver-2.4.0.9 ver-2.4.0.8 ver-2.4.0.7 ver-2.4.0.6 ver-2.4.0.5 ver-2.4.0.4 ver-2.4.0.3 ver-2.4.0.2 ver-2.4.0.1 ver-2.4.0.0 ver-2.3.6.0 ver-2.3.5.0 ver-2.3.4.0 ver-2.3.3.0 ver-2.3.2.2 ver-2.3.2.1 ver-2.3.2.0 ver-2.3.1.0 ver-2.3.0.0 ver-2.2.2.16 ver-2.2.2.15 ver-2.2.2.14 ver-2.2.2.13 ver-2.2.2.12 ver-2.2.2.11 ver-2.2.2.10 ver-2.2.2.9 ver-2.2.2.8 ver-2.2.2.7 ver-2.2.2.6 ver-2.2.2.5 ver-2.2.2.4 ver-2.2.2.3 ver-2.2.2.1 ver-2.2.2.1-ningsi ver-2.2.2.0 ver-2.2.1.6 ver-2.2.1.5 ver-2.2.1.4 ver-2.2.1.3 ver-2.2.1.2 ver-2.2.1.1 ver-2.2.1.0 ver-2.2.0.1001 ver-2.2.0.7 ver-2.2.0.6 ver-2.2.0.5 ver-2.2.0.4 ver-2.2.0.3 ver-2.2.0.2 ver-2.2.0.1 ver-2.2.0.0 ver-2.1.7.7 ver-2.1.7.6 ver-2.1.7.2 ver-2.1.7.1 ver-2.1.6.0 ver-2.1.5.0 ver-2.1.4.1 ver-2.1.3.2 ver-2.1.3.0 ver-2.1.2.0 ver-2.1.1.0 ver-2.1.0.1 ver-2.1.0.0 ver-2.1.0 ver-2.0.22.3 ver-2.0.22.2 ver-2.0.22.1 ver-2.0.22.0 ver-2.0.21.6 ver-2.0.21.5 ver-2.0.21.4 ver-2.0.21.3 ver-2.0.21.2 ver-2.0.21.1 ver-2.0.21.0 ver-2.0.20.20 ver-2.0.20.19 ver-2.0.20.18 ver-2.0.20.16 ver-2.0.20.13 ver-2.0.20.12 ver-2.0.20.11 ver-2.0.20.10 ver-2.0.20.9 ver-2.0.20.4 ver-2.0.20.3 ver-2.0.20.2 ver-2.0.20.0 ver-2.0.19.1 ver-2.0.19.0 ver-2.0.18.2 ver-2.0.18.0 ver-2.0.17.4 ver-2.0.17.0 ver-2.0.16.0 ver-2.0.15.0 ver-2.0.14.0 ver-2.0.13.0 ver-2.0.12.0 ver-2.0.11.0 ver-2.0.10.0 ver-2.0.9.0 ver-2.0.8.2 ver-2.0.8.0 ver-2.0.7.0 ver-2.0.6.0 ver-2.0.5.2 ver-2.0.5.0 ver-2.0.4.0 ver-2.0.3.2 ver-2.0.3.1 ver-2.0.3.0 ver-2.0.2.2 ver-2.0.2.2-beta ver-2.0.2.1 ver-2.0.2.0 ver-2.0.1.9 ver-2.0.1.1 ver-2.0.1.1-ningsi ver-2.0.1.0 ver-2.0.0.4 ver-2.0.0.3 ver-2.0.0.2 ver-2.0.0.1 ver-2.0.0.0 tq-1.0.0.1 release/ver-2.1.2.0 mac-enter-test autoaddcol_07161651 autoaddcol_07161108 autoaddcol_07150626 autoaddcol_0720_1434 autoaddcol_0719_1122 autoaddcol_0718_2208 TDB-ver0.8 TDB-ver-0.7
无相关合并请求
...@@ -465,7 +465,7 @@ extern void * tscQhandle; ...@@ -465,7 +465,7 @@ extern void * tscQhandle;
extern int tscKeepConn[]; extern int tscKeepConn[];
extern int tsInsertHeadSize; extern int tsInsertHeadSize;
extern int tscNumOfThreads; extern int tscNumOfThreads;
extern SRpcIpSet tscMgmtIpList; extern SRpcIpSet tscMgmtIpSet;
typedef void (*__async_cb_func_t)(void *param, TAOS_RES *tres, int numOfRows); typedef void (*__async_cb_func_t)(void *param, TAOS_RES *tres, int numOfRows);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#define TSC_MGMT_VNODE 999 #define TSC_MGMT_VNODE 999
SRpcIpSet tscMgmtIpList; SRpcIpSet tscMgmtIpSet;
SRpcIpSet tscDnodeIpSet; SRpcIpSet tscDnodeIpSet;
int (*tscBuildMsg[TSDB_SQL_MAX])(SSqlObj *pSql, SSqlInfo *pInfo) = {0}; int (*tscBuildMsg[TSDB_SQL_MAX])(SSqlObj *pSql, SSqlInfo *pInfo) = {0};
...@@ -58,30 +58,30 @@ static void tscSetDnodeIpList(SSqlObj* pSql, STableMeta* pTableMeta) { ...@@ -58,30 +58,30 @@ static void tscSetDnodeIpList(SSqlObj* pSql, STableMeta* pTableMeta) {
} }
void tscPrintMgmtIp() { void tscPrintMgmtIp() {
if (tscMgmtIpList.numOfIps <= 0) { if (tscMgmtIpSet.numOfIps <= 0) {
tscError("invalid mgmt IP list:%d", tscMgmtIpList.numOfIps); tscError("invalid mgmt IP list:%d", tscMgmtIpSet.numOfIps);
} else { } else {
for (int i = 0; i < tscMgmtIpList.numOfIps; ++i) { for (int i = 0; i < tscMgmtIpSet.numOfIps; ++i) {
tscTrace("mgmt index:%d ip:%d", i, tscMgmtIpList.ip[i]); tscTrace("mgmt index:%d ip:%d", i, tscMgmtIpSet.ip[i]);
} }
} }
} }
void tscSetMgmtIpListFromCluster(SRpcIpSet *pIpList) { void tscSetMgmtIpListFromCluster(SRpcIpSet *pIpList) {
tscMgmtIpList.numOfIps = pIpList->numOfIps; tscMgmtIpSet.numOfIps = pIpList->numOfIps;
tscMgmtIpList.inUse = pIpList->inUse; tscMgmtIpSet.inUse = pIpList->inUse;
tscMgmtIpList.port = htons(pIpList->port); tscMgmtIpSet.port = htons(pIpList->port);
for (int32_t i = 0; i < tscMgmtIpList.numOfIps; ++i) { for (int32_t i = 0; i < tscMgmtIpSet.numOfIps; ++i) {
tscMgmtIpList.ip[i] = htonl(pIpList->ip[i]); tscMgmtIpSet.ip[i] = htonl(pIpList->ip[i]);
} }
} }
void tscSetMgmtIpListFromEdge() { void tscSetMgmtIpListFromEdge() {
if (tscMgmtIpList.numOfIps != 1) { if (tscMgmtIpSet.numOfIps != 1) {
tscMgmtIpList.numOfIps = 1; tscMgmtIpSet.numOfIps = 1;
tscMgmtIpList.inUse = 0; tscMgmtIpSet.inUse = 0;
tscMgmtIpList.port = tsMnodeShellPort; tscMgmtIpSet.port = tsMnodeShellPort;
tscMgmtIpList.ip[0] = inet_addr(tsMasterIp); tscMgmtIpSet.ip[0] = inet_addr(tsMasterIp);
tscTrace("edge mgmt IP list:"); tscTrace("edge mgmt IP list:");
tscPrintMgmtIp(); tscPrintMgmtIp();
} }
...@@ -89,7 +89,7 @@ void tscSetMgmtIpListFromEdge() { ...@@ -89,7 +89,7 @@ void tscSetMgmtIpListFromEdge() {
void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) { void tscUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
tscTrace("mgmt IP list is changed for ufp is called"); tscTrace("mgmt IP list is changed for ufp is called");
tscSetMgmtIpListFromCluster(pIpSet); tscMgmtIpSet = *pIpSet;
} }
void tscSetMgmtIpList(SRpcIpSet *pIpList) { void tscSetMgmtIpList(SRpcIpSet *pIpList) {
...@@ -114,7 +114,7 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) { ...@@ -114,7 +114,7 @@ void tscSetMgmtIpList(SRpcIpSet *pIpList) {
UNUSED_FUNC UNUSED_FUNC
static int32_t tscGetMgmtConnMaxRetryTimes() { static int32_t tscGetMgmtConnMaxRetryTimes() {
int32_t factor = 2; int32_t factor = 2;
return tscMgmtIpList.numOfIps * factor; return tscMgmtIpSet.numOfIps * factor;
} }
void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) { void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
...@@ -209,7 +209,7 @@ int tscSendMsgToServer(SSqlObj *pSql) { ...@@ -209,7 +209,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
}; };
rpcSendRequest(pVnodeConn, &pSql->ipList, &rpcMsg); rpcSendRequest(pVnodeConn, &pSql->ipList, &rpcMsg);
} else { } else {
pSql->ipList = tscMgmtIpList; pSql->ipList = tscMgmtIpSet;
pSql->ipList.port = tsMnodeShellPort; pSql->ipList.port = tsMnodeShellPort;
tscTrace("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList.port); tscTrace("%p msg:%s is sent to server %d", pSql, taosMsg[pSql->cmd.msgType], pSql->ipList.port);
...@@ -430,7 +430,7 @@ int tscProcessSql(SSqlObj *pSql) { ...@@ -430,7 +430,7 @@ int tscProcessSql(SSqlObj *pSql) {
return pSql->res.code; return pSql->res.code;
} }
} else if (pSql->cmd.command < TSDB_SQL_LOCAL) { } else if (pSql->cmd.command < TSDB_SQL_LOCAL) {
pSql->ipList = tscMgmtIpList; pSql->ipList = tscMgmtIpSet;
} else { // local handler } else { // local handler
return (*tscProcessMsgRsp[pCmd->command])(pSql); return (*tscProcessMsgRsp[pCmd->command])(pSql);
} }
......
...@@ -72,23 +72,23 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con ...@@ -72,23 +72,23 @@ STscObj *taosConnectImpl(const char *ip, const char *user, const char *pass, con
} }
if (ip && ip[0]) { if (ip && ip[0]) {
tscMgmtIpList.inUse = 0; tscMgmtIpSet.inUse = 0;
tscMgmtIpList.port = tsMnodeShellPort; tscMgmtIpSet.port = tsMnodeShellPort;
tscMgmtIpList.numOfIps = 1; tscMgmtIpSet.numOfIps = 1;
tscMgmtIpList.ip[0] = inet_addr(ip); tscMgmtIpSet.ip[0] = inet_addr(ip);
if (tsMasterIp[0] && strcmp(ip, tsMasterIp) != 0) { if (tsMasterIp[0] && strcmp(ip, tsMasterIp) != 0) {
tscMgmtIpList.numOfIps = 2; tscMgmtIpSet.numOfIps = 2;
tscMgmtIpList.ip[1] = inet_addr(tsMasterIp); tscMgmtIpSet.ip[1] = inet_addr(tsMasterIp);
} }
if (tsSecondIp[0] && strcmp(tsSecondIp, tsMasterIp) != 0) { if (tsSecondIp[0] && strcmp(tsSecondIp, tsMasterIp) != 0) {
tscMgmtIpList.numOfIps = 3; tscMgmtIpSet.numOfIps = 3;
tscMgmtIpList.ip[2] = inet_addr(tsSecondIp); tscMgmtIpSet.ip[2] = inet_addr(tsSecondIp);
} }
} }
tscMgmtIpList.port = port ? port : tsMnodeShellPort; tscMgmtIpSet.port = port ? port : tsMnodeShellPort;
STscObj *pObj = (STscObj *)calloc(1, sizeof(STscObj)); STscObj *pObj = (STscObj *)calloc(1, sizeof(STscObj));
if (NULL == pObj) { if (NULL == pObj) {
......
...@@ -147,14 +147,14 @@ void taos_init_imp() { ...@@ -147,14 +147,14 @@ void taos_init_imp() {
taosInitNote(tsNumOfLogLines / 10, 1, (char*)"tsc_note"); taosInitNote(tsNumOfLogLines / 10, 1, (char*)"tsc_note");
} }
tscMgmtIpList.inUse = 0; tscMgmtIpSet.inUse = 0;
tscMgmtIpList.port = tsMnodeShellPort; tscMgmtIpSet.port = tsMnodeShellPort;
tscMgmtIpList.numOfIps = 1; tscMgmtIpSet.numOfIps = 1;
tscMgmtIpList.ip[0] = inet_addr(tsMasterIp); tscMgmtIpSet.ip[0] = inet_addr(tsMasterIp);
if (tsSecondIp[0] && strcmp(tsSecondIp, tsMasterIp) != 0) { if (tsSecondIp[0] && strcmp(tsSecondIp, tsMasterIp) != 0) {
tscMgmtIpList.numOfIps = 2; tscMgmtIpSet.numOfIps = 2;
tscMgmtIpList.ip[1] = inet_addr(tsSecondIp); tscMgmtIpSet.ip[1] = inet_addr(tsSecondIp);
} }
tscInitMsgsFp(); tscInitMsgsFp();
......
...@@ -54,6 +54,11 @@ static SRpcIpSet tsMnodeIpSet = {0}; ...@@ -54,6 +54,11 @@ static SRpcIpSet tsMnodeIpSet = {0};
static SDMMnodeInfos tsMnodeInfos = {0}; static SDMMnodeInfos tsMnodeInfos = {0};
static SDMDnodeCfg tsDnodeCfg = {0}; static SDMDnodeCfg tsDnodeCfg = {0};
void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
dTrace("mgmt IP list is changed for ufp is called");
tsMnodeIpSet = *pIpSet;
}
int32_t dnodeInitMClient() { int32_t dnodeInitMClient() {
dnodeReadDnodeCfg(); dnodeReadDnodeCfg();
tsRebootTime = taosGetTimestampSec(); tsRebootTime = taosGetTimestampSec();
...@@ -90,6 +95,7 @@ int32_t dnodeInitMClient() { ...@@ -90,6 +95,7 @@ int32_t dnodeInitMClient() {
rpcInit.label = "DND-MC"; rpcInit.label = "DND-MC";
rpcInit.numOfThreads = 1; rpcInit.numOfThreads = 1;
rpcInit.cfp = dnodeProcessRspFromMnode; rpcInit.cfp = dnodeProcessRspFromMnode;
rpcInit.ufp = dnodeUpdateIpSet;
rpcInit.sessions = 100; rpcInit.sessions = 100;
rpcInit.connType = TAOS_CONN_CLIENT; rpcInit.connType = TAOS_CONN_CLIENT;
rpcInit.idleTime = tsShellActivityTimer * 2000; rpcInit.idleTime = tsShellActivityTimer * 2000;
......
...@@ -40,7 +40,7 @@ void * mgmtGetNextMnode(void *pNode, struct SMnodeObj **pMnode); ...@@ -40,7 +40,7 @@ void * mgmtGetNextMnode(void *pNode, struct SMnodeObj **pMnode);
void mgmtReleaseMnode(struct SMnodeObj *pMnode); void mgmtReleaseMnode(struct SMnodeObj *pMnode);
char * mgmtGetMnodeRoleStr(); char * mgmtGetMnodeRoleStr();
void mgmtGetMnodeIpList(SRpcIpSet *ipSet, bool usePublicIp); void mgmtGetMnodeIpSet(SRpcIpSet *ipSet, bool usePublicIp);
void mgmtGetMnodeInfos(void *mnodes); void mgmtGetMnodeInfos(void *mnodes);
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -28,8 +28,10 @@ ...@@ -28,8 +28,10 @@
#include "mgmtLog.h" #include "mgmtLog.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDServer.h" #include "mgmtDServer.h"
#include "mgmtMnode.h"
#include "mgmtProfile.h" #include "mgmtProfile.h"
#include "mgmtShell.h" #include "mgmtShell.h"
#include "mgmtSdb.h"
#include "mgmtTable.h" #include "mgmtTable.h"
#include "mgmtVgroup.h" #include "mgmtVgroup.h"
...@@ -99,6 +101,18 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) { ...@@ -99,6 +101,18 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN); mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
return; return;
} }
if (!sdbIsMaster()) {
SRpcConnInfo connInfo;
rpcGetConnInfo(rpcMsg->handle, &connInfo);
bool usePublicIp = false;
SRpcIpSet ipSet = {0};
mgmtGetMnodeIpSet(&ipSet, usePublicIp);
mTrace("conn from dnode ip:%s redirect msg", taosIpStr(connInfo.clientIp));
rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
return;
}
if (mgmtProcessDnodeMsgFp[rpcMsg->msgType]) { if (mgmtProcessDnodeMsgFp[rpcMsg->msgType]) {
SRpcMsg *pMsg = malloc(sizeof(SRpcMsg)); SRpcMsg *pMsg = malloc(sizeof(SRpcMsg));
......
...@@ -171,7 +171,7 @@ char *mgmtGetMnodeRoleStr(int32_t role) { ...@@ -171,7 +171,7 @@ char *mgmtGetMnodeRoleStr(int32_t role) {
} }
} }
void mgmtGetMnodeIpList(SRpcIpSet *ipSet, bool usePublicIp) { void mgmtGetMnodeIpSet(SRpcIpSet *ipSet, bool usePublicIp) {
void *pNode = NULL; void *pNode = NULL;
while (1) { while (1) {
SMnodeObj *pMnode = NULL; SMnodeObj *pMnode = NULL;
......
...@@ -141,6 +141,7 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) { ...@@ -141,6 +141,7 @@ void mgmtDealyedAddToShellQueue(SQueuedMsg *queuedMsg) {
static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
if (rpcMsg == NULL || rpcMsg->pCont == NULL) { if (rpcMsg == NULL || rpcMsg->pCont == NULL) {
mgmtSendSimpleResp(rpcMsg->handle, TSDB_CODE_INVALID_MSG_LEN);
return; return;
} }
...@@ -150,7 +151,7 @@ static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) { ...@@ -150,7 +151,7 @@ static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
bool usePublicIp = (connInfo.serverIp == tsPublicIpInt); bool usePublicIp = (connInfo.serverIp == tsPublicIpInt);
SRpcIpSet ipSet = {0}; SRpcIpSet ipSet = {0};
mgmtGetMnodeIpList(&ipSet, usePublicIp); mgmtGetMnodeIpSet(&ipSet, usePublicIp);
mTrace("conn from ip:%s user:%s redirect msg", taosIpStr(connInfo.clientIp), connInfo.user); mTrace("conn from ip:%s user:%s redirect msg", taosIpStr(connInfo.clientIp), connInfo.user);
rpcSendRedirectRsp(rpcMsg->handle, &ipSet); rpcSendRedirectRsp(rpcMsg->handle, &ipSet);
return; return;
...@@ -337,7 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) { ...@@ -337,7 +338,7 @@ static void mgmtProcessHeartBeatMsg(SQueuedMsg *pMsg) {
return; return;
} }
mgmtGetMnodeIpList(&pHBRsp->ipList, pMsg->usePublicIp); mgmtGetMnodeIpSet(&pHBRsp->ipList, pMsg->usePublicIp);
/* /*
* TODO * TODO
...@@ -424,7 +425,7 @@ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) { ...@@ -424,7 +425,7 @@ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) {
pConnectRsp->writeAuth = pUser->writeAuth; pConnectRsp->writeAuth = pUser->writeAuth;
pConnectRsp->superAuth = pUser->superAuth; pConnectRsp->superAuth = pUser->superAuth;
mgmtGetMnodeIpList(&pConnectRsp->ipList, pMsg->usePublicIp); mgmtGetMnodeIpSet(&pConnectRsp->ipList, pMsg->usePublicIp);
connect_over: connect_over:
rpcRsp.code = code; rpcRsp.code = code;
......
...@@ -11,7 +11,8 @@ set +e ...@@ -11,7 +11,8 @@ set +e
FILE_NAME= FILE_NAME=
RELEASE=0 RELEASE=0
ASYNC=0 ASYNC=0
while getopts "f:a" arg VALGRIND=0
while getopts "f:av" arg
do do
case $arg in case $arg in
f) f)
...@@ -20,6 +21,9 @@ do ...@@ -20,6 +21,9 @@ do
a) a)
ASYNC=1 ASYNC=1
;; ;;
v)
VALGRIND=1
;;
?) ?)
echo "unknow argument" echo "unknow argument"
;; ;;
...@@ -96,10 +100,14 @@ ulimit -c unlimited ...@@ -96,10 +100,14 @@ ulimit -c unlimited
#sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e #sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
if [ -n "$FILE_NAME" ]; then if [ -n "$FILE_NAME" ]; then
echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f $FILE_NAME
echo "------------------------------------------------------------------------" echo "------------------------------------------------------------------------"
#valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME if [ $VALGRIND -eq 1 ]; then
$PROGRAM -c $CFG_DIR -f $FILE_NAME echo valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME
valgrind --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes --log-file=${CODE_DIR}/../script/valgrind.log $PROGRAM -c $CFG_DIR -f $FILE_NAME
else
echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f $FILE_NAME
$PROGRAM -c $CFG_DIR -f $FILE_NAME
fi
else else
echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f basicSuite.sim echo "ExcuteCmd:" $PROGRAM -c $CFG_DIR -f basicSuite.sim
echo "------------------------------------------------------------------------" echo "------------------------------------------------------------------------"
......
...@@ -109,3 +109,7 @@ endi ...@@ -109,3 +109,7 @@ endi
if $data3_3 != null then if $data3_3 != null then
goto show7 goto show7
endi endi
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
...@@ -77,4 +77,8 @@ if $data3_1 != master then ...@@ -77,4 +77,8 @@ if $data3_1 != master then
endi endi
if $data3_2 != slave then if $data3_2 != slave then
goto step5 goto step5
endi endi
\ No newline at end of file
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
...@@ -93,3 +93,7 @@ endi ...@@ -93,3 +93,7 @@ endi
if $dnode3Role != slave then if $dnode3Role != slave then
return -1 return -1
endi endi
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
...@@ -123,3 +123,6 @@ if $dnode3Role != slave then ...@@ -123,3 +123,6 @@ if $dnode3Role != slave then
return -1 return -1
endi endi
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
...@@ -83,3 +83,7 @@ endi ...@@ -83,3 +83,7 @@ endi
if $dnode3Role != null then if $dnode3Role != null then
return -1 return -1
endi endi
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
...@@ -38,5 +38,6 @@ if $data4_2 != 4 then ...@@ -38,5 +38,6 @@ if $data4_2 != 4 then
return -1 return -1
endi endi
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
\ No newline at end of file
...@@ -7,4 +7,3 @@ run unique/mnode/mgmt33.sim ...@@ -7,4 +7,3 @@ run unique/mnode/mgmt33.sim
run unique/mnode/mgmt34.sim run unique/mnode/mgmt34.sim
run unique/mnode/mgmtr2.sim run unique/mnode/mgmtr2.sim
run unique/mnode/secondIp.sim run unique/mnode/secondIp.sim
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部