Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dgr6878
TDengine
提交
3e0bd397
T
TDengine
项目概览
dgr6878
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3e0bd397
编写于
4月 24, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-52] [TD-148] add cluster test script
上级
0c23737d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
50 addition
and
20 deletion
+50
-20
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-0
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+1
-1
src/dnode/src/dnodeMClient.c
src/dnode/src/dnodeMClient.c
+16
-1
src/dnode/src/dnodeMnode.c
src/dnode/src/dnodeMnode.c
+1
-1
src/inc/dnode.h
src/inc/dnode.h
+2
-1
src/mnode/src/mgmtDClient.c
src/mnode/src/mgmtDClient.c
+3
-1
src/mnode/src/mgmtDServer.c
src/mnode/src/mgmtDServer.c
+8
-3
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+10
-5
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+1
-1
tests/script/unique/mnode/mgmt33.sim
tests/script/unique/mnode/mgmt33.sim
+3
-3
tests/script/unique/mnode/mgmt34.sim
tests/script/unique/mnode/mgmt34.sim
+3
-3
未找到文件。
src/client/src/tscServer.c
浏览文件 @
3e0bd397
...
@@ -163,11 +163,13 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
...
@@ -163,11 +163,13 @@ void tscProcessActivityTimer(void *handle, void *tmrId) {
tscGetQueryInfoDetailSafely
(
&
pSql
->
cmd
,
0
,
&
pQueryInfo
);
tscGetQueryInfoDetailSafely
(
&
pSql
->
cmd
,
0
,
&
pQueryInfo
);
pQueryInfo
->
command
=
TSDB_SQL_HB
;
pQueryInfo
->
command
=
TSDB_SQL_HB
;
pSql
->
cmd
.
command
=
TSDB_SQL_HB
;
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
&
(
pSql
->
cmd
),
TSDB_DEFAULT_PAYLOAD_SIZE
))
{
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
&
(
pSql
->
cmd
),
TSDB_DEFAULT_PAYLOAD_SIZE
))
{
tfree
(
pSql
);
tfree
(
pSql
);
return
;
return
;
}
}
pSql
->
cmd
.
command
=
TSDB_SQL_HB
;
pSql
->
param
=
pObj
;
pSql
->
param
=
pObj
;
pSql
->
pTscObj
=
pObj
;
pSql
->
pTscObj
=
pObj
;
pSql
->
signature
=
pSql
;
pSql
->
signature
=
pSql
;
...
...
src/client/src/tscSystem.c
浏览文件 @
3e0bd397
...
@@ -67,7 +67,6 @@ int32_t tscInitRpc(const char *user, const char *secret) {
...
@@ -67,7 +67,6 @@ int32_t tscInitRpc(const char *user, const char *secret) {
rpcInit
.
label
=
"TSC-vnode"
;
rpcInit
.
label
=
"TSC-vnode"
;
rpcInit
.
numOfThreads
=
tscNumOfThreads
;
rpcInit
.
numOfThreads
=
tscNumOfThreads
;
rpcInit
.
cfp
=
tscProcessMsgFromServer
;
rpcInit
.
cfp
=
tscProcessMsgFromServer
;
rpcInit
.
ufp
=
tscUpdateIpSet
;
rpcInit
.
sessions
=
tsMaxVnodeConnections
;
rpcInit
.
sessions
=
tsMaxVnodeConnections
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
user
=
(
char
*
)
user
;
rpcInit
.
user
=
(
char
*
)
user
;
...
@@ -96,6 +95,7 @@ int32_t tscInitRpc(const char *user, const char *secret) {
...
@@ -96,6 +95,7 @@ int32_t tscInitRpc(const char *user, const char *secret) {
rpcInit
.
label
=
"TSC-mgmt"
;
rpcInit
.
label
=
"TSC-mgmt"
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
numOfThreads
=
1
;
rpcInit
.
cfp
=
tscProcessMsgFromServer
;
rpcInit
.
cfp
=
tscProcessMsgFromServer
;
rpcInit
.
ufp
=
tscUpdateIpSet
;
rpcInit
.
sessions
=
tsMaxMgmtConnections
;
rpcInit
.
sessions
=
tsMaxMgmtConnections
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
idleTime
=
2000
;
rpcInit
.
idleTime
=
2000
;
...
...
src/dnode/src/dnodeMClient.c
浏览文件 @
3e0bd397
...
@@ -59,6 +59,19 @@ void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
...
@@ -59,6 +59,19 @@ void dnodeUpdateIpSet(void *ahandle, SRpcIpSet *pIpSet) {
tsMnodeIpSet
=
*
pIpSet
;
tsMnodeIpSet
=
*
pIpSet
;
}
}
void
dnodeGetMnodeIpSet
(
void
*
ipSetRaw
,
bool
usePublicIp
)
{
SRpcIpSet
*
ipSet
=
ipSetRaw
;
ipSet
->
numOfIps
=
tsMnodeInfos
.
nodeNum
;
ipSet
->
inUse
=
tsMnodeInfos
.
inUse
;
for
(
int32_t
i
=
0
;
i
<
tsMnodeInfos
.
nodeNum
;
++
i
)
{
if
(
usePublicIp
)
{
ipSet
->
ip
[
i
]
=
tsMnodeInfos
.
nodeInfos
[
i
].
nodeIp
;
}
else
{
ipSet
->
ip
[
i
]
=
tsMnodeInfos
.
nodeInfos
[
i
].
nodeIp
;
}
}
}
int32_t
dnodeInitMClient
()
{
int32_t
dnodeInitMClient
()
{
dnodeReadDnodeCfg
();
dnodeReadDnodeCfg
();
tsRebootTime
=
taosGetTimestampSec
();
tsRebootTime
=
taosGetTimestampSec
();
...
@@ -138,7 +151,9 @@ static void dnodeProcessRspFromMnode(SRpcMsg *pMsg) {
...
@@ -138,7 +151,9 @@ static void dnodeProcessRspFromMnode(SRpcMsg *pMsg) {
if
(
tsDnodeProcessMgmtRspFp
[
pMsg
->
msgType
])
{
if
(
tsDnodeProcessMgmtRspFp
[
pMsg
->
msgType
])
{
(
*
tsDnodeProcessMgmtRspFp
[
pMsg
->
msgType
])(
pMsg
);
(
*
tsDnodeProcessMgmtRspFp
[
pMsg
->
msgType
])(
pMsg
);
}
else
{
}
else
{
dError
(
"%s is not processed in mnode rpc client"
,
taosMsg
[
pMsg
->
msgType
]);
dError
(
"%s is not processed in dnode mclient"
,
taosMsg
[
pMsg
->
msgType
]);
SRpcMsg
rpcRsp
=
{.
pCont
=
0
,
.
contLen
=
0
,
.
code
=
TSDB_CODE_OPS_NOT_SUPPORT
,
.
handle
=
pMsg
->
handle
};
rpcSendResponse
(
&
rpcRsp
);
}
}
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
...
...
src/dnode/src/dnodeMnode.c
浏览文件 @
3e0bd397
...
@@ -88,7 +88,7 @@ static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg) {
...
@@ -88,7 +88,7 @@ static void dnodeProcessMsgFromMnode(SRpcMsg *pMsg) {
if
(
dnodeProcessMgmtMsgFp
[
pMsg
->
msgType
])
{
if
(
dnodeProcessMgmtMsgFp
[
pMsg
->
msgType
])
{
(
*
dnodeProcessMgmtMsgFp
[
pMsg
->
msgType
])(
pMsg
);
(
*
dnodeProcessMgmtMsgFp
[
pMsg
->
msgType
])(
pMsg
);
}
else
{
}
else
{
dError
(
"%s is not processed in mserver"
,
taosMsg
[
pMsg
->
msgType
]);
dError
(
"%s is not processed in
dnode
mserver"
,
taosMsg
[
pMsg
->
msgType
]);
rspMsg
.
code
=
TSDB_CODE_MSG_NOT_PROCESSED
;
rspMsg
.
code
=
TSDB_CODE_MSG_NOT_PROCESSED
;
rpcSendResponse
(
&
rspMsg
);
rpcSendResponse
(
&
rspMsg
);
rpcFreeCont
(
pMsg
->
pCont
);
rpcFreeCont
(
pMsg
->
pCont
);
...
...
src/inc/dnode.h
浏览文件 @
3e0bd397
...
@@ -41,8 +41,9 @@ void *dnodeAllocateRqueue(void *pVnode);
...
@@ -41,8 +41,9 @@ void *dnodeAllocateRqueue(void *pVnode);
void
dnodeFreeRqueue
(
void
*
rqueue
);
void
dnodeFreeRqueue
(
void
*
rqueue
);
void
dnodeSendRpcWriteRsp
(
void
*
pVnode
,
void
*
param
,
int32_t
code
);
void
dnodeSendRpcWriteRsp
(
void
*
pVnode
,
void
*
param
,
int32_t
code
);
bool
dnodeIsFirstDeploy
();
bool
dnodeIsFirstDeploy
();
uint32_t
dnodeGetMnodeMasteIp
();
uint32_t
dnodeGetMnodeMasteIp
();
void
dnodeGetMnodeIpSet
(
void
*
ipSet
,
bool
usePublicIp
);
void
*
dnodeGetMnodeInfos
();
void
*
dnodeGetMnodeInfos
();
int32_t
dnodeGetDnodeId
();
int32_t
dnodeGetDnodeId
();
...
...
src/mnode/src/mgmtDClient.c
浏览文件 @
3e0bd397
...
@@ -79,7 +79,9 @@ static void mgmtProcessRspFromDnode(SRpcMsg *rpcMsg) {
...
@@ -79,7 +79,9 @@ static void mgmtProcessRspFromDnode(SRpcMsg *rpcMsg) {
if
(
mgmtProcessDnodeRspFp
[
rpcMsg
->
msgType
])
{
if
(
mgmtProcessDnodeRspFp
[
rpcMsg
->
msgType
])
{
(
*
mgmtProcessDnodeRspFp
[
rpcMsg
->
msgType
])(
rpcMsg
);
(
*
mgmtProcessDnodeRspFp
[
rpcMsg
->
msgType
])(
rpcMsg
);
}
else
{
}
else
{
mError
(
"%s is not processed in dclient"
,
taosMsg
[
rpcMsg
->
msgType
]);
mError
(
"%s is not processed in mgmt dclient"
,
taosMsg
[
rpcMsg
->
msgType
]);
SRpcMsg
rpcRsp
=
{.
pCont
=
0
,
.
contLen
=
0
,
.
code
=
TSDB_CODE_OPS_NOT_SUPPORT
,
.
handle
=
rpcMsg
->
handle
};
rpcSendResponse
(
&
rpcRsp
);
}
}
rpcFreeCont
(
rpcMsg
->
pCont
);
rpcFreeCont
(
rpcMsg
->
pCont
);
...
...
src/mnode/src/mgmtDServer.c
浏览文件 @
3e0bd397
...
@@ -108,8 +108,12 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
...
@@ -108,8 +108,12 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
bool
usePublicIp
=
false
;
bool
usePublicIp
=
false
;
SRpcIpSet
ipSet
=
{
0
};
SRpcIpSet
ipSet
=
{
0
};
mgmtGetMnodeIpSet
(
&
ipSet
,
usePublicIp
);
ipSet
.
port
=
tsMnodeDnodePort
;
mTrace
(
"conn from dnode ip:%s redirect msg"
,
taosIpStr
(
connInfo
.
clientIp
));
dnodeGetMnodeIpSet
(
&
ipSet
,
usePublicIp
);
mTrace
(
"conn from dnode ip:%s user:%s redirect msg, inUse:%d"
,
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
,
ipSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
.
numOfIps
;
++
i
)
{
mTrace
(
"index:%d ip:%s"
,
i
,
taosIpStr
(
ipSet
.
ip
[
i
]));
}
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
ipSet
);
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
ipSet
);
return
;
return
;
}
}
...
@@ -119,7 +123,8 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
...
@@ -119,7 +123,8 @@ static void mgmtProcessMsgFromDnode(SRpcMsg *rpcMsg) {
memcpy
(
pMsg
,
rpcMsg
,
sizeof
(
SRpcMsg
));
memcpy
(
pMsg
,
rpcMsg
,
sizeof
(
SRpcMsg
));
mgmtAddToDServerQueue
(
pMsg
);
mgmtAddToDServerQueue
(
pMsg
);
}
else
{
}
else
{
mError
(
"%s is not processed in dserver"
,
taosMsg
[
rpcMsg
->
msgType
]);
mError
(
"%s is not processed in mgmt dserver"
,
taosMsg
[
rpcMsg
->
msgType
]);
mgmtSendSimpleResp
(
rpcMsg
->
handle
,
TSDB_CODE_MSG_NOT_PROCESSED
);
rpcFreeCont
(
rpcMsg
->
pCont
);
rpcFreeCont
(
rpcMsg
->
pCont
);
}
}
}
}
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
3e0bd397
...
@@ -151,8 +151,13 @@ static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
...
@@ -151,8 +151,13 @@ static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
bool
usePublicIp
=
(
connInfo
.
serverIp
==
tsPublicIpInt
);
bool
usePublicIp
=
(
connInfo
.
serverIp
==
tsPublicIpInt
);
SRpcIpSet
ipSet
=
{
0
};
SRpcIpSet
ipSet
=
{
0
};
mgmtGetMnodeIpSet
(
&
ipSet
,
usePublicIp
);
ipSet
.
port
=
tsMnodeShellPort
;
mTrace
(
"conn from ip:%s user:%s redirect msg"
,
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
);
dnodeGetMnodeIpSet
(
&
ipSet
,
usePublicIp
);
mTrace
(
"conn from shell ip:%s user:%s redirect msg, inUse:%d"
,
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
,
ipSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
.
numOfIps
;
++
i
)
{
mTrace
(
"index:%d ip:%s"
,
i
,
taosIpStr
(
ipSet
.
ip
[
i
]));
}
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
ipSet
);
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
ipSet
);
return
;
return
;
}
}
...
@@ -429,9 +434,9 @@ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) {
...
@@ -429,9 +434,9 @@ static void mgmtProcessConnectMsg(SQueuedMsg *pMsg) {
connect_over:
connect_over:
rpcRsp
.
code
=
code
;
rpcRsp
.
code
=
code
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mLError
(
"user:%s login from %s,
code:%d"
,
connInfo
.
user
,
taosIpStr
(
connInfo
.
clientIp
),
code
);
mLError
(
"user:%s login from %s,
result:%s"
,
connInfo
.
user
,
taosIpStr
(
connInfo
.
clientIp
),
tstrerror
(
code
)
);
}
else
{
}
else
{
mLPrint
(
"user:%s login from %s,
code:%d"
,
connInfo
.
user
,
taosIpStr
(
connInfo
.
clientIp
),
code
);
mLPrint
(
"user:%s login from %s,
result:%s"
,
connInfo
.
user
,
taosIpStr
(
connInfo
.
clientIp
),
tstrerror
(
code
)
);
rpcRsp
.
pCont
=
pConnectRsp
;
rpcRsp
.
pCont
=
pConnectRsp
;
rpcRsp
.
contLen
=
sizeof
(
SCMConnectRsp
);
rpcRsp
.
contLen
=
sizeof
(
SCMConnectRsp
);
}
}
...
@@ -488,7 +493,7 @@ static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg) {
...
@@ -488,7 +493,7 @@ static bool mgmtCheckMsgReadOnly(SQueuedMsg *pMsg) {
}
}
static
void
mgmtProcessUnSupportMsg
(
SRpcMsg
*
rpcMsg
)
{
static
void
mgmtProcessUnSupportMsg
(
SRpcMsg
*
rpcMsg
)
{
mError
(
"%s is not processed in shell"
,
taosMsg
[
rpcMsg
->
msgType
]);
mError
(
"%s is not processed in
mnode
shell"
,
taosMsg
[
rpcMsg
->
msgType
]);
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
0
,
.
msgType
=
0
,
.
pCont
=
0
,
.
pCont
=
0
,
...
...
tests/script/sh/deploy.sh
浏览文件 @
3e0bd397
...
@@ -93,7 +93,7 @@ echo "privateIp $NODE_IP" >> $TAOS_CFG
...
@@ -93,7 +93,7 @@ echo "privateIp $NODE_IP" >> $TAOS_CFG
echo
"dDebugFlag 199"
>>
$TAOS_CFG
echo
"dDebugFlag 199"
>>
$TAOS_CFG
echo
"mDebugFlag 199"
>>
$TAOS_CFG
echo
"mDebugFlag 199"
>>
$TAOS_CFG
echo
"sdbDebugFlag 199"
>>
$TAOS_CFG
echo
"sdbDebugFlag 199"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"httpDebugFlag 131"
>>
$TAOS_CFG
echo
"httpDebugFlag 131"
>>
$TAOS_CFG
...
...
tests/script/unique/mnode/mgmt33.sim
浏览文件 @
3e0bd397
...
@@ -116,7 +116,7 @@ sleep 8000
...
@@ -116,7 +116,7 @@ sleep 8000
sql show mnodes
sql show mnodes
$dnode1Role = $data3_1
$dnode1Role = $data3_1
$dnode2Role = $data3_
2
$dnode2Role = $data3_
4
$dnode3Role = $data3_3
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.2 ==> $dnode2Role
...
@@ -138,13 +138,13 @@ sleep 10000
...
@@ -138,13 +138,13 @@ sleep 10000
sql show mnodes
sql show mnodes
$dnode1Role = $data3_1
$dnode1Role = $data3_1
$dnode2Role = $data3_
2
$dnode2Role = $data3_
4
$dnode3Role = $data3_3
$dnode3Role = $data3_3
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
print 192.168.0.3 ==> $dnode3Role
if $dnode1Role !=
undecided
then
if $dnode1Role !=
offline
then
return -1
return -1
endi
endi
#if $dnode2Role != master then
#if $dnode2Role != master then
...
...
tests/script/unique/mnode/mgmt34.sim
浏览文件 @
3e0bd397
...
@@ -183,7 +183,7 @@ endi
...
@@ -183,7 +183,7 @@ endi
print ============== step7
print ============== step7
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode1 -s stop
sleep
10
000
sleep
4
000
sql show mnodes
sql show mnodes
$dnode1Role = $data3_1
$dnode1Role = $data3_1
...
@@ -195,7 +195,7 @@ print 192.168.0.2 ==> $dnode2Role
...
@@ -195,7 +195,7 @@ print 192.168.0.2 ==> $dnode2Role
print 192.168.0.3 ==> $dnode3Role
print 192.168.0.3 ==> $dnode3Role
print 192.168.0.4 ==> $dnode4Role
print 192.168.0.4 ==> $dnode4Role
if $dnode1Role !=
undecided
then
if $dnode1Role !=
offline
then
return -1
return -1
endi
endi
...
@@ -205,7 +205,7 @@ sleep 8000
...
@@ -205,7 +205,7 @@ sleep 8000
sql show mnodes
sql show mnodes
$dnode1Role = $data3_1
$dnode1Role = $data3_1
$dnode2Role = $data3_
2
$dnode2Role = $data3_
5
$dnode3Role = $data3_3
$dnode3Role = $data3_3
$dnode4Role = $data3_4
$dnode4Role = $data3_4
print 192.168.0.1 ==> $dnode1Role
print 192.168.0.1 ==> $dnode1Role
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录