Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
53480b07
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看板
未验证
提交
53480b07
编写于
7月 27, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
7月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7005 from taosdata/fix/TD-5512
[TD-5512]<fix>: fix arbitrator offline caused by vnode destroying
上级
10956b4a
fa756766
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
9 deletion
+10
-9
src/sync/inc/syncTcp.h
src/sync/inc/syncTcp.h
+1
-1
src/sync/src/syncArbitrator.c
src/sync/src/syncArbitrator.c
+3
-3
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+5
-4
src/sync/src/syncTcp.c
src/sync/src/syncTcp.c
+1
-1
未找到文件。
src/sync/inc/syncTcp.h
浏览文件 @
53480b07
...
...
@@ -25,7 +25,7 @@ typedef struct {
uint32_t
serverIp
;
int16_t
port
;
int32_t
bufferSize
;
void
(
*
processBrokenLink
)(
int64_t
handleId
);
void
(
*
processBrokenLink
)(
int64_t
handleId
,
int32_t
closedByApp
);
int32_t
(
*
processIncomingMsg
)(
int64_t
handleId
,
void
*
buffer
);
void
(
*
processIncomingConn
)(
SOCKET
fd
,
uint32_t
ip
);
}
SPoolInfo
;
...
...
src/sync/src/syncArbitrator.c
浏览文件 @
53480b07
...
...
@@ -30,7 +30,7 @@
extern
void
syncProcessTestMsg
(
SSyncMsg
*
pMsg
,
SOCKET
connFd
);
static
void
arbSignalHandler
(
int32_t
signum
,
void
*
sigInfo
,
void
*
context
);
static
void
arbProcessIncommingConnection
(
SOCKET
connFd
,
uint32_t
sourceIp
);
static
void
arbProcessBrokenLink
(
int64_t
rid
);
static
void
arbProcessBrokenLink
(
int64_t
rid
,
int32_t
closedByApp
);
static
int32_t
arbProcessPeerMsg
(
int64_t
rid
,
void
*
buffer
);
static
tsem_t
tsArbSem
;
static
void
*
tsArbTcpPool
;
...
...
@@ -147,10 +147,10 @@ static void arbProcessIncommingConnection(SOCKET connFd, uint32_t sourceIp) {
return
;
}
static
void
arbProcessBrokenLink
(
int64_t
rid
)
{
static
void
arbProcessBrokenLink
(
int64_t
rid
,
int32_t
closedByApp
)
{
SNodeConn
*
pNode
=
(
SNodeConn
*
)
rid
;
sDebug
(
"%s, TCP link is broken since %s, close
connection"
,
pNode
->
id
,
strerror
(
errno
)
);
sDebug
(
"%s, TCP link is broken since %s, close
dByApp:%d"
,
pNode
->
id
,
strerror
(
errno
),
closedByApp
);
tfree
(
pNode
);
}
...
...
src/sync/src/syncMain.c
浏览文件 @
53480b07
...
...
@@ -43,7 +43,7 @@ static void syncProcessSyncRequest(char *pMsg, SSyncPeer *pPeer);
static
void
syncRecoverFromMaster
(
SSyncPeer
*
pPeer
);
static
void
syncCheckPeerConnection
(
void
*
param
,
void
*
tmrId
);
static
int32_t
syncSendPeersStatusMsgToPeer
(
SSyncPeer
*
pPeer
,
char
ack
,
int8_t
type
,
uint16_t
tranId
);
static
void
syncProcessBrokenLink
(
int64_t
rid
);
static
void
syncProcessBrokenLink
(
int64_t
rid
,
int32_t
closedByApp
);
static
int32_t
syncProcessPeerMsg
(
int64_t
rid
,
void
*
buffer
);
static
void
syncProcessIncommingConnection
(
SOCKET
connFd
,
uint32_t
sourceIp
);
static
void
syncRemovePeer
(
SSyncPeer
*
pPeer
);
...
...
@@ -1308,7 +1308,7 @@ static void syncProcessIncommingConnection(SOCKET connFd, uint32_t sourceIp) {
pthread_mutex_unlock
(
&
pNode
->
mutex
);
}
static
void
syncProcessBrokenLink
(
int64_t
rid
)
{
static
void
syncProcessBrokenLink
(
int64_t
rid
,
int32_t
closedByApp
)
{
SSyncPeer
*
pPeer
=
syncAcquirePeer
(
rid
);
if
(
pPeer
==
NULL
)
return
;
...
...
@@ -1316,9 +1316,10 @@ static void syncProcessBrokenLink(int64_t rid) {
pthread_mutex_lock
(
&
pNode
->
mutex
);
sDebug
(
"%s, TCP link is broken since %s, pfd:%d sfd:%d"
,
pPeer
->
id
,
strerror
(
errno
),
pPeer
->
peerFd
,
pPeer
->
syncFd
);
sDebug
(
"%s, TCP link is broken since %s, pfd:%d sfd:%d closedByApp:%d"
,
pPeer
->
id
,
strerror
(
errno
),
pPeer
->
peerFd
,
pPeer
->
syncFd
,
closedByApp
);
pPeer
->
peerFd
=
-
1
;
if
(
pPeer
->
isArb
)
{
if
(
!
closedByApp
&&
pPeer
->
isArb
)
{
tsArbOnline
=
0
;
}
...
...
src/sync/src/syncTcp.c
浏览文件 @
53480b07
...
...
@@ -177,7 +177,7 @@ static void taosProcessBrokenLink(SConnObj *pConn) {
SPoolInfo
*
pInfo
=
&
pPool
->
info
;
if
(
pConn
->
closedByApp
==
0
)
shutdown
(
pConn
->
fd
,
SHUT_WR
);
(
*
pInfo
->
processBrokenLink
)(
pConn
->
handleId
);
(
*
pInfo
->
processBrokenLink
)(
pConn
->
handleId
,
pConn
->
closedByApp
);
pThread
->
numOfFds
--
;
epoll_ctl
(
pThread
->
pollFd
,
EPOLL_CTL_DEL
,
pConn
->
fd
,
NULL
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录