Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
fe22dcf9
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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,发现更多精彩内容 >>
提交
fe22dcf9
编写于
5月 28, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-335] fix bug while get mnode ipset
上级
ad721970
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
36 deletion
+40
-36
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+10
-3
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+22
-24
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+1
-1
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+3
-4
tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
...t/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
+4
-4
未找到文件。
src/dnode/src/dnodeMgmt.c
浏览文件 @
fe22dcf9
...
...
@@ -284,7 +284,7 @@ static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg) {
}
void
dnodeUpdateMnodeIpSetForPeer
(
SRpcIpSet
*
pIpSet
)
{
dPrint
(
"mnode IP list is changed, numOfIps:%d inUse:%d"
,
pIpSet
->
numOfIps
,
pIpSet
->
inUse
);
dPrint
(
"mnode IP list
for peer
is changed, numOfIps:%d inUse:%d"
,
pIpSet
->
numOfIps
,
pIpSet
->
inUse
);
for
(
int
i
=
0
;
i
<
pIpSet
->
numOfIps
;
++
i
)
{
dPrint
(
"mnode index:%d %s:%u"
,
i
,
pIpSet
->
fqdn
[
i
],
pIpSet
->
port
[
i
])
}
...
...
@@ -344,17 +344,24 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
if
(
!
(
mnodesChanged
||
mnodesNotInit
))
return
;
memcpy
(
&
tsDMnodeInfos
,
pMnodes
,
sizeof
(
SDMMnodeInfos
));
dPrint
(
"mnode infos is changed, nodeNum:%d inUse:%d"
,
tsDMnodeInfos
.
nodeNum
,
tsDMnodeInfos
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
dPrint
(
"mnode index:%d, %s"
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
);
}
tsDMnodeIpSetForPeer
.
inUse
=
tsDMnodeInfos
.
inUse
;
tsDMnodeIpSetForPeer
.
numOfIps
=
tsDMnodeInfos
.
nodeNum
;
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
taosGetFqdnPortFromEp
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
tsDMnodeIpSetForPeer
.
fqdn
[
i
],
&
tsDMnodeIpSetForPeer
.
port
[
i
]);
tsDMnodeIpSetForPeer
.
port
[
i
]
+=
TSDB_PORT_DNODEDNODE
;
dPrint
(
"mnode index:%d, for peer %s %d"
,
i
,
tsDMnodeIpSetForPeer
.
fqdn
[
i
],
tsDMnodeIpSetForPeer
.
port
[
i
]);
}
dPrint
(
"mnodes is changed, nodeNum:%d inUse:%d"
,
tsDMnodeInfos
.
nodeNum
,
tsDMnodeInfos
.
inUse
);
tsDMnodeIpSetForShell
.
inUse
=
tsDMnodeInfos
.
inUse
;
tsDMnodeIpSetForShell
.
numOfIps
=
tsDMnodeInfos
.
nodeNum
;
for
(
int32_t
i
=
0
;
i
<
tsDMnodeInfos
.
nodeNum
;
i
++
)
{
dPrint
(
"mnode:%d, %s"
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeId
,
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
);
taosGetFqdnPortFromEp
(
tsDMnodeInfos
.
nodeInfos
[
i
].
nodeEp
,
tsDMnodeIpSetForShell
.
fqdn
[
i
],
&
tsDMnodeIpSetForShell
.
port
[
i
]);
dPrint
(
"mnode index:%d, for shell %s %d"
,
i
,
tsDMnodeIpSetForShell
.
fqdn
[
i
],
tsDMnodeIpSetForShell
.
port
[
i
]);
}
dnodeSaveMnodeInfos
();
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
fe22dcf9
...
...
@@ -33,8 +33,8 @@
static
void
*
tsMnodeSdb
=
NULL
;
static
int32_t
tsMnodeUpdateSize
=
0
;
static
SRpcIpSet
tsMnode
Rpc
IpSetForShell
;
static
SRpcIpSet
tsMnode
Rpc
IpSetForPeer
;
static
SRpcIpSet
tsMnodeIpSetForShell
;
static
SRpcIpSet
tsMnodeIpSetForPeer
;
static
SDMMnodeInfos
tsMnodeInfos
;
static
int32_t
mnodeGetMnodeMeta
(
STableMetaMsg
*
pMeta
,
SShowObj
*
pShow
,
void
*
pConn
);
static
int32_t
mnodeRetrieveMnodes
(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
...
...
@@ -202,17 +202,13 @@ char *mnodeGetMnodeRoleStr(int32_t role) {
}
void
mnodeUpdateMnodeIpSet
()
{
SRpcIpSet
*
ipSetForShell
=
&
tsMnodeRpcIpSetForShell
;
SRpcIpSet
*
ipSetForPeer
=
&
tsMnodeRpcIpSetForPeer
;
SDMMnodeInfos
*
mnodes
=
&
tsMnodeInfos
;
mPrint
(
"update mnodes ipset, numOfIps:%d "
,
mnodeGetMnodesNum
());
mnodeMnodeWrLock
();
memset
(
i
pSetForShell
,
0
,
sizeof
(
SRpcIpSet
));
memset
(
i
pSetForPeer
,
0
,
sizeof
(
SRpcIpSet
));
memset
(
mnode
s
,
0
,
sizeof
(
SDMMnodeInfos
));
memset
(
&
tsMnodeI
pSetForShell
,
0
,
sizeof
(
SRpcIpSet
));
memset
(
&
tsMnodeI
pSetForPeer
,
0
,
sizeof
(
SRpcIpSet
));
memset
(
&
tsMnodeInfo
s
,
0
,
sizeof
(
SDMMnodeInfos
));
int32_t
index
=
0
;
void
*
pIter
=
NULL
;
...
...
@@ -223,22 +219,24 @@ void mnodeUpdateMnodeIpSet() {
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pMnode
->
mnodeId
);
if
(
pDnode
!=
NULL
)
{
strcpy
(
ipSetForShell
->
fqdn
[
ipSetForShell
->
numOfIps
],
pDnode
->
dnodeFqdn
);
ipSetForShell
->
port
[
ipSetForShell
->
numOfIps
]
=
htons
(
pDnode
->
dnodePort
);
strcpy
(
tsMnodeIpSetForShell
.
fqdn
[
index
],
pDnode
->
dnodeFqdn
);
tsMnodeIpSetForShell
.
port
[
index
]
=
htons
(
pDnode
->
dnodePort
);
mTrace
(
"mnode:%d, for shell fqdn:%s %d"
,
pDnode
->
dnodeId
,
tsMnodeIpSetForShell
.
fqdn
[
index
],
htons
(
tsMnodeIpSetForShell
.
port
[
index
]));
strcpy
(
ipSetForPeer
->
fqdn
[
ipSetForPeer
->
numOfIps
],
pDnode
->
dnodeFqdn
);
ipSetForPeer
->
port
[
ipSetForPeer
->
numOfIps
]
=
htons
(
pDnode
->
dnodePort
+
TSDB_PORT_DNODEDNODE
);
strcpy
(
tsMnodeIpSetForPeer
.
fqdn
[
index
],
pDnode
->
dnodeFqdn
);
tsMnodeIpSetForPeer
.
port
[
index
]
=
htons
(
pDnode
->
dnodePort
+
TSDB_PORT_DNODEDNODE
);
mTrace
(
"mnode:%d, for peer fqdn:%s %d"
,
pDnode
->
dnodeId
,
tsMnodeIpSetForPeer
.
fqdn
[
index
],
htons
(
tsMnodeIpSetForPeer
.
port
[
index
]));
mnodes
->
nodeInfos
[
index
].
nodeId
=
htonl
(
pMnode
->
mnodeId
);
strcpy
(
mnodes
->
nodeInfos
[
index
].
nodeEp
,
pDnode
->
dnodeEp
);
tsMnodeInfos
.
nodeInfos
[
index
].
nodeId
=
htonl
(
pMnode
->
mnodeId
);
strcpy
(
tsMnodeInfos
.
nodeInfos
[
index
].
nodeEp
,
pDnode
->
dnodeEp
);
if
(
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
ipSetForShell
->
inUse
=
index
;
ipSetForPeer
->
inUse
=
index
;
mnodes
->
inUse
=
index
;
tsMnodeIpSetForShell
.
inUse
=
index
;
tsMnodeIpSetForPeer
.
inUse
=
index
;
tsMnodeInfos
.
inUse
=
index
;
}
mPrint
(
"mnode:%d, ep:%s %s"
,
index
,
pDnode
->
dnodeEp
,
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
?
"master"
:
""
);
mPrint
(
"mnode:%d, ep:%s %s"
,
pDnode
->
dnodeId
,
pDnode
->
dnodeEp
,
pMnode
->
role
==
TAOS_SYNC_ROLE_MASTER
?
"master"
:
""
);
index
++
;
}
...
...
@@ -246,9 +244,9 @@ void mnodeUpdateMnodeIpSet() {
mnodeDecMnodeRef
(
pMnode
);
}
mnodes
->
nodeNum
=
index
;
ipSetForPeer
->
numOfIps
=
index
;
ipSetForPeer
->
numOfIps
=
index
;
tsMnodeInfos
.
nodeNum
=
index
;
tsMnodeIpSetForShell
.
numOfIps
=
index
;
tsMnodeIpSetForPeer
.
numOfIps
=
index
;
sdbFreeIter
(
pIter
);
...
...
@@ -257,13 +255,13 @@ void mnodeUpdateMnodeIpSet() {
void
mnodeGetMnodeIpSetForPeer
(
SRpcIpSet
*
ipSet
)
{
mnodeMnodeRdLock
();
*
ipSet
=
tsMnode
RpcIpSetForShell
;
*
ipSet
=
tsMnode
IpSetForPeer
;
mnodeMnodeUnLock
();
}
void
mnodeGetMnodeIpSetForShell
(
SRpcIpSet
*
ipSet
)
{
mnodeMnodeRdLock
();
*
ipSet
=
tsMnode
Rpc
IpSetForShell
;
*
ipSet
=
tsMnodeIpSetForShell
;
mnodeMnodeUnLock
();
}
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
fe22dcf9
...
...
@@ -186,7 +186,7 @@ void sdbUpdateMnodeRoles() {
SNodesRole
roles
=
{
0
};
syncGetNodesRole
(
tsSdbObj
.
sync
,
&
roles
);
sdbPrint
(
"update mnodes
:%d sync roles
"
,
tsSdbObj
.
cfg
.
replica
);
sdbPrint
(
"update mnodes
sync roles, total:%d
"
,
tsSdbObj
.
cfg
.
replica
);
for
(
int32_t
i
=
0
;
i
<
tsSdbObj
.
cfg
.
replica
;
++
i
)
{
SMnodeObj
*
pMnode
=
mnodeGetMnode
(
roles
.
nodeId
[
i
]);
if
(
pMnode
!=
NULL
)
{
...
...
tests/script/sh/deploy.sh
浏览文件 @
fe22dcf9
...
...
@@ -96,17 +96,16 @@ echo "second ${HOSTNAME}:7200" >> $TAOS_CFG
echo
"serverPort
${
NODE
}
"
>>
$TAOS_CFG
echo
"dataDir
$DATA_DIR
"
>>
$TAOS_CFG
echo
"logDir
$LOG_DIR
"
>>
$TAOS_CFG
echo
"debugFlag 135"
>>
$TAOS_CFG
echo
"dDebugFlag 135"
>>
$TAOS_CFG
echo
"mDebugFlag 1
35
"
>>
$TAOS_CFG
echo
"mDebugFlag 1
99
"
>>
$TAOS_CFG
echo
"sdbDebugFlag 135"
>>
$TAOS_CFG
echo
"rpcDebugFlag 135"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"httpDebugFlag 135"
>>
$TAOS_CFG
echo
"monitorDebugFlag 131"
>>
$TAOS_CFG
echo
"udebugFlag 13
1
"
>>
$TAOS_CFG
echo
"jnidebugFlag 13
1
"
>>
$TAOS_CFG
echo
"udebugFlag 13
5
"
>>
$TAOS_CFG
echo
"jnidebugFlag 13
5
"
>>
$TAOS_CFG
echo
"sdebugFlag 135"
>>
$TAOS_CFG
echo
"qdebugFlag 135"
>>
$TAOS_CFG
echo
"monitor 0"
>>
$TAOS_CFG
...
...
tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
浏览文件 @
fe22dcf9
...
...
@@ -29,10 +29,10 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c m
gmt
EqualVnodeNum -v 200
#system sh/cfg.sh -n dnode2 -c m
gmt
EqualVnodeNum -v 200
#system sh/cfg.sh -n dnode3 -c m
gmt
EqualVnodeNum -v 200
#system sh/cfg.sh -n dnode4 -c m
gmt
EqualVnodeNum -v 200
system sh/cfg.sh -n dnode1 -c m
node
EqualVnodeNum -v 200
#system sh/cfg.sh -n dnode2 -c m
node
EqualVnodeNum -v 200
#system sh/cfg.sh -n dnode3 -c m
node
EqualVnodeNum -v 200
#system sh/cfg.sh -n dnode4 -c m
node
EqualVnodeNum -v 200
system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator
system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录