Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
31a90129
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
31a90129
编写于
4年前
作者:
S
slguan
提交者:
GitHub
4年前
浏览文件
操作
浏览文件
下载
差异文件
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
无相关合并请求
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
96 addition
and
48 deletion
+96
-48
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+19
-19
src/client/src/tscSql.c
src/client/src/tscSql.c
+9
-9
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+6
-6
src/dnode/src/dnodeMClient.c
src/dnode/src/dnodeMClient.c
+6
-0
src/mnode/inc/mgmtMnode.h
src/mnode/inc/mgmtMnode.h
+1
-1
src/mnode/src/mgmtDServer.c
src/mnode/src/mgmtDServer.c
+14
-0
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+1
-1
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+4
-3
tests/script/test.sh
tests/script/test.sh
+12
-4
tests/script/unique/mnode/mgmt22.sim
tests/script/unique/mnode/mgmt22.sim
+4
-0
tests/script/unique/mnode/mgmt24.sim
tests/script/unique/mnode/mgmt24.sim
+5
-1
tests/script/unique/mnode/mgmt25.sim
tests/script/unique/mnode/mgmt25.sim
+4
-0
tests/script/unique/mnode/mgmt26.sim
tests/script/unique/mnode/mgmt26.sim
+3
-0
tests/script/unique/mnode/mgmtr2.sim
tests/script/unique/mnode/mgmtr2.sim
+4
-0
tests/script/unique/mnode/secondIp.sim
tests/script/unique/mnode/secondIp.sim
+3
-2
tests/script/unique/mnode/testSuite.sim
tests/script/unique/mnode/testSuite.sim
+0
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
31a90129
...
@@ -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
tscMgmtIp
Lis
t
;
extern
SRpcIpSet
tscMgmtIp
Se
t
;
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
);
...
...
This diff is collapsed.
Click to expand it.
src/client/src/tscServer.c
浏览文件 @
31a90129
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define TSC_MGMT_VNODE 999
#define TSC_MGMT_VNODE 999
SRpcIpSet
tscMgmtIp
Lis
t
;
SRpcIpSet
tscMgmtIp
Se
t
;
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
(
tscMgmtIp
Lis
t
.
numOfIps
<=
0
)
{
if
(
tscMgmtIp
Se
t
.
numOfIps
<=
0
)
{
tscError
(
"invalid mgmt IP list:%d"
,
tscMgmtIp
Lis
t
.
numOfIps
);
tscError
(
"invalid mgmt IP list:%d"
,
tscMgmtIp
Se
t
.
numOfIps
);
}
else
{
}
else
{
for
(
int
i
=
0
;
i
<
tscMgmtIp
Lis
t
.
numOfIps
;
++
i
)
{
for
(
int
i
=
0
;
i
<
tscMgmtIp
Se
t
.
numOfIps
;
++
i
)
{
tscTrace
(
"mgmt index:%d ip:%d"
,
i
,
tscMgmtIp
Lis
t
.
ip
[
i
]);
tscTrace
(
"mgmt index:%d ip:%d"
,
i
,
tscMgmtIp
Se
t
.
ip
[
i
]);
}
}
}
}
}
}
void
tscSetMgmtIpListFromCluster
(
SRpcIpSet
*
pIpList
)
{
void
tscSetMgmtIpListFromCluster
(
SRpcIpSet
*
pIpList
)
{
tscMgmtIp
Lis
t
.
numOfIps
=
pIpList
->
numOfIps
;
tscMgmtIp
Se
t
.
numOfIps
=
pIpList
->
numOfIps
;
tscMgmtIp
Lis
t
.
inUse
=
pIpList
->
inUse
;
tscMgmtIp
Se
t
.
inUse
=
pIpList
->
inUse
;
tscMgmtIp
Lis
t
.
port
=
htons
(
pIpList
->
port
);
tscMgmtIp
Se
t
.
port
=
htons
(
pIpList
->
port
);
for
(
int32_t
i
=
0
;
i
<
tscMgmtIp
Lis
t
.
numOfIps
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
tscMgmtIp
Se
t
.
numOfIps
;
++
i
)
{
tscMgmtIp
Lis
t
.
ip
[
i
]
=
htonl
(
pIpList
->
ip
[
i
]);
tscMgmtIp
Se
t
.
ip
[
i
]
=
htonl
(
pIpList
->
ip
[
i
]);
}
}
}
}
void
tscSetMgmtIpListFromEdge
()
{
void
tscSetMgmtIpListFromEdge
()
{
if
(
tscMgmtIp
Lis
t
.
numOfIps
!=
1
)
{
if
(
tscMgmtIp
Se
t
.
numOfIps
!=
1
)
{
tscMgmtIp
Lis
t
.
numOfIps
=
1
;
tscMgmtIp
Se
t
.
numOfIps
=
1
;
tscMgmtIp
Lis
t
.
inUse
=
0
;
tscMgmtIp
Se
t
.
inUse
=
0
;
tscMgmtIp
Lis
t
.
port
=
tsMnodeShellPort
;
tscMgmtIp
Se
t
.
port
=
tsMnodeShellPort
;
tscMgmtIp
Lis
t
.
ip
[
0
]
=
inet_addr
(
tsMasterIp
);
tscMgmtIp
Se
t
.
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"
);
tsc
SetMgmtIpListFromCluster
(
pIpSet
)
;
tsc
MgmtIpSet
=
*
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
tscMgmtIp
Lis
t
.
numOfIps
*
factor
;
return
tscMgmtIp
Se
t
.
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
=
tscMgmtIp
Lis
t
;
pSql
->
ipList
=
tscMgmtIp
Se
t
;
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
=
tscMgmtIp
Lis
t
;
pSql
->
ipList
=
tscMgmtIp
Se
t
;
}
else
{
// local handler
}
else
{
// local handler
return
(
*
tscProcessMsgRsp
[
pCmd
->
command
])(
pSql
);
return
(
*
tscProcessMsgRsp
[
pCmd
->
command
])(
pSql
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/client/src/tscSql.c
浏览文件 @
31a90129
...
@@ -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
])
{
tscMgmtIp
Lis
t
.
inUse
=
0
;
tscMgmtIp
Se
t
.
inUse
=
0
;
tscMgmtIp
Lis
t
.
port
=
tsMnodeShellPort
;
tscMgmtIp
Se
t
.
port
=
tsMnodeShellPort
;
tscMgmtIp
Lis
t
.
numOfIps
=
1
;
tscMgmtIp
Se
t
.
numOfIps
=
1
;
tscMgmtIp
Lis
t
.
ip
[
0
]
=
inet_addr
(
ip
);
tscMgmtIp
Se
t
.
ip
[
0
]
=
inet_addr
(
ip
);
if
(
tsMasterIp
[
0
]
&&
strcmp
(
ip
,
tsMasterIp
)
!=
0
)
{
if
(
tsMasterIp
[
0
]
&&
strcmp
(
ip
,
tsMasterIp
)
!=
0
)
{
tscMgmtIp
Lis
t
.
numOfIps
=
2
;
tscMgmtIp
Se
t
.
numOfIps
=
2
;
tscMgmtIp
Lis
t
.
ip
[
1
]
=
inet_addr
(
tsMasterIp
);
tscMgmtIp
Se
t
.
ip
[
1
]
=
inet_addr
(
tsMasterIp
);
}
}
if
(
tsSecondIp
[
0
]
&&
strcmp
(
tsSecondIp
,
tsMasterIp
)
!=
0
)
{
if
(
tsSecondIp
[
0
]
&&
strcmp
(
tsSecondIp
,
tsMasterIp
)
!=
0
)
{
tscMgmtIp
Lis
t
.
numOfIps
=
3
;
tscMgmtIp
Se
t
.
numOfIps
=
3
;
tscMgmtIp
Lis
t
.
ip
[
2
]
=
inet_addr
(
tsSecondIp
);
tscMgmtIp
Se
t
.
ip
[
2
]
=
inet_addr
(
tsSecondIp
);
}
}
}
}
tscMgmtIp
Lis
t
.
port
=
port
?
port
:
tsMnodeShellPort
;
tscMgmtIp
Se
t
.
port
=
port
?
port
:
tsMnodeShellPort
;
STscObj
*
pObj
=
(
STscObj
*
)
calloc
(
1
,
sizeof
(
STscObj
));
STscObj
*
pObj
=
(
STscObj
*
)
calloc
(
1
,
sizeof
(
STscObj
));
if
(
NULL
==
pObj
)
{
if
(
NULL
==
pObj
)
{
...
...
This diff is collapsed.
Click to expand it.
src/client/src/tscSystem.c
浏览文件 @
31a90129
...
@@ -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"
);
}
}
tscMgmtIp
Lis
t
.
inUse
=
0
;
tscMgmtIp
Se
t
.
inUse
=
0
;
tscMgmtIp
Lis
t
.
port
=
tsMnodeShellPort
;
tscMgmtIp
Se
t
.
port
=
tsMnodeShellPort
;
tscMgmtIp
Lis
t
.
numOfIps
=
1
;
tscMgmtIp
Se
t
.
numOfIps
=
1
;
tscMgmtIp
Lis
t
.
ip
[
0
]
=
inet_addr
(
tsMasterIp
);
tscMgmtIp
Se
t
.
ip
[
0
]
=
inet_addr
(
tsMasterIp
);
if
(
tsSecondIp
[
0
]
&&
strcmp
(
tsSecondIp
,
tsMasterIp
)
!=
0
)
{
if
(
tsSecondIp
[
0
]
&&
strcmp
(
tsSecondIp
,
tsMasterIp
)
!=
0
)
{
tscMgmtIp
Lis
t
.
numOfIps
=
2
;
tscMgmtIp
Se
t
.
numOfIps
=
2
;
tscMgmtIp
Lis
t
.
ip
[
1
]
=
inet_addr
(
tsSecondIp
);
tscMgmtIp
Se
t
.
ip
[
1
]
=
inet_addr
(
tsSecondIp
);
}
}
tscInitMsgsFp
();
tscInitMsgsFp
();
...
...
This diff is collapsed.
Click to expand it.
src/dnode/src/dnodeMClient.c
浏览文件 @
31a90129
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/mnode/inc/mgmtMnode.h
浏览文件 @
31a90129
...
@@ -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
mgmtGetMnodeIp
Lis
t
(
SRpcIpSet
*
ipSet
,
bool
usePublicIp
);
void
mgmtGetMnodeIp
Se
t
(
SRpcIpSet
*
ipSet
,
bool
usePublicIp
);
void
mgmtGetMnodeInfos
(
void
*
mnodes
);
void
mgmtGetMnodeInfos
(
void
*
mnodes
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
This diff is collapsed.
Click to expand it.
src/mnode/src/mgmtDServer.c
浏览文件 @
31a90129
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
src/mnode/src/mgmtMnode.c
浏览文件 @
31a90129
...
@@ -171,7 +171,7 @@ char *mgmtGetMnodeRoleStr(int32_t role) {
...
@@ -171,7 +171,7 @@ char *mgmtGetMnodeRoleStr(int32_t role) {
}
}
}
}
void
mgmtGetMnodeIp
Lis
t
(
SRpcIpSet
*
ipSet
,
bool
usePublicIp
)
{
void
mgmtGetMnodeIp
Se
t
(
SRpcIpSet
*
ipSet
,
bool
usePublicIp
)
{
void
*
pNode
=
NULL
;
void
*
pNode
=
NULL
;
while
(
1
)
{
while
(
1
)
{
SMnodeObj
*
pMnode
=
NULL
;
SMnodeObj
*
pMnode
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
src/mnode/src/mgmtShell.c
浏览文件 @
31a90129
...
@@ -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
};
mgmtGetMnodeIp
Lis
t
(
&
ipSet
,
usePublicIp
);
mgmtGetMnodeIp
Se
t
(
&
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
;
}
}
mgmtGetMnodeIp
Lis
t
(
&
pHBRsp
->
ipList
,
pMsg
->
usePublicIp
);
mgmtGetMnodeIp
Se
t
(
&
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
;
mgmtGetMnodeIp
Lis
t
(
&
pConnectRsp
->
ipList
,
pMsg
->
usePublicIp
);
mgmtGetMnodeIp
Se
t
(
&
pConnectRsp
->
ipList
,
pMsg
->
usePublicIp
);
connect_over:
connect_over:
rpcRsp
.
code
=
code
;
rpcRsp
.
code
=
code
;
...
...
This diff is collapsed.
Click to expand it.
tests/script/test.sh
浏览文件 @
31a90129
...
@@ -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
"------------------------------------------------------------------------"
...
...
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/mgmt22.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/mgmt24.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/mgmt25.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/mgmt26.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/mgmtr2.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/secondIp.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
tests/script/unique/mnode/testSuite.sim
浏览文件 @
31a90129
...
@@ -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
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部