Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
33012d3d
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
33012d3d
编写于
11月 17, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2051
上级
5342c811
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
4 deletion
+15
-4
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+12
-1
src/util/src/tsocket.c
src/util/src/tsocket.c
+3
-3
未找到文件。
src/sync/src/syncMain.c
浏览文件 @
33012d3d
...
...
@@ -179,6 +179,13 @@ int64_t syncStart(const SSyncInfo *pInfo) {
for
(
int32_t
i
=
0
;
i
<
pCfg
->
replica
;
++
i
)
{
const
SNodeInfo
*
pNodeInfo
=
pCfg
->
nodeInfo
+
i
;
pNode
->
peerInfo
[
i
]
=
syncAddPeer
(
pNode
,
pNodeInfo
);
if
(
pNode
->
peerInfo
[
i
]
==
NULL
)
{
sError
(
"vgId:%d, node:%d fqdn:%s port:%u is not configured, stop taosd"
,
pNode
->
vgId
,
pNodeInfo
->
nodeId
,
pNodeInfo
->
nodeFqdn
,
pNodeInfo
->
nodePort
);
syncStop
(
pNode
->
rid
);
exit
(
1
);
}
if
((
strcmp
(
pNodeInfo
->
nodeFqdn
,
tsNodeFqdn
)
==
0
)
&&
(
pNodeInfo
->
nodePort
==
tsSyncPort
))
{
pNode
->
selfIndex
=
i
;
}
...
...
@@ -476,7 +483,11 @@ static void syncRemovePeer(SSyncPeer *pPeer) {
static
SSyncPeer
*
syncAddPeer
(
SSyncNode
*
pNode
,
const
SNodeInfo
*
pInfo
)
{
uint32_t
ip
=
taosGetIpFromFqdn
(
pInfo
->
nodeFqdn
);
if
(
ip
==
-
1
)
return
NULL
;
if
(
ip
==
0xFFFFFFFF
)
{
sError
(
"failed to add peer, can resolve fqdn:%s since %s"
,
pInfo
->
nodeFqdn
,
strerror
(
errno
));
terrno
=
TSDB_CODE_RPC_FQDN_ERROR
;
return
NULL
;
}
SSyncPeer
*
pPeer
=
calloc
(
1
,
sizeof
(
SSyncPeer
));
if
(
pPeer
==
NULL
)
return
NULL
;
...
...
src/util/src/tsocket.c
浏览文件 @
33012d3d
...
...
@@ -58,13 +58,13 @@ uint32_t taosGetIpFromFqdn(const char *fqdn) {
}
else
{
#ifdef EAI_SYSTEM
if
(
ret
==
EAI_SYSTEM
)
{
uError
(
"failed to get the ip address, fqdn:%s,
code:%d, reason:%s"
,
fqdn
,
ret
,
strerror
(
errno
));
uError
(
"failed to get the ip address, fqdn:%s,
since:%s"
,
fqdn
,
strerror
(
errno
));
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
}
else
{
uError
(
"failed to get the ip address, fqdn:%s,
code:%d, reason:%s"
,
fqdn
,
ret
,
gai_strerror
(
ret
));
uError
(
"failed to get the ip address, fqdn:%s,
since:%s"
,
fqdn
,
gai_strerror
(
ret
));
}
#else
uError
(
"failed to get the ip address, fqdn:%s,
code:%d, reason:%s"
,
fqdn
,
ret
,
gai_strerror
(
ret
));
uError
(
"failed to get the ip address, fqdn:%s,
since:%s"
,
fqdn
,
gai_strerror
(
ret
));
#endif
return
0xFFFFFFFF
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录