Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a568425b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
a568425b
编写于
12月 11, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
12月 11, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4545 from taosdata/feature/wal
Feature/wal
上级
5a210085
236295b8
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
5 deletion
+9
-5
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+8
-4
src/sync/src/syncRetrieve.c
src/sync/src/syncRetrieve.c
+1
-1
未找到文件。
src/sync/src/syncMain.c
浏览文件 @
a568425b
...
@@ -793,7 +793,7 @@ void syncRestartConnection(SSyncPeer *pPeer) {
...
@@ -793,7 +793,7 @@ void syncRestartConnection(SSyncPeer *pPeer) {
static
void
syncProcessSyncRequest
(
char
*
msg
,
SSyncPeer
*
pPeer
)
{
static
void
syncProcessSyncRequest
(
char
*
msg
,
SSyncPeer
*
pPeer
)
{
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
s
Debug
(
"%s, sync-req is received"
,
pPeer
->
id
);
s
Info
(
"%s, sync-req is received"
,
pPeer
->
id
);
if
(
pPeer
->
ip
==
0
)
return
;
if
(
pPeer
->
ip
==
0
)
return
;
...
@@ -879,8 +879,7 @@ static void syncRecoverFromMaster(SSyncPeer *pPeer) {
...
@@ -879,8 +879,7 @@ static void syncRecoverFromMaster(SSyncPeer *pPeer) {
if
(
taosWriteMsg
(
pPeer
->
peerFd
,
&
firstPkt
,
sizeof
(
firstPkt
))
!=
sizeof
(
firstPkt
))
{
if
(
taosWriteMsg
(
pPeer
->
peerFd
,
&
firstPkt
,
sizeof
(
firstPkt
))
!=
sizeof
(
firstPkt
))
{
sError
(
"%s, failed to send sync-req to peer"
,
pPeer
->
id
);
sError
(
"%s, failed to send sync-req to peer"
,
pPeer
->
id
);
}
else
{
}
else
{
nodeSStatus
=
TAOS_SYNC_STATUS_START
;
sInfo
(
"%s, sync-req is sent to peer, tranId:%u, sstatus:%s"
,
pPeer
->
id
,
firstPkt
.
tranId
,
syncStatus
[
nodeSStatus
]);
sInfo
(
"%s, sync-req is sent to peer, tranId:%u, set sstatus:%s"
,
pPeer
->
id
,
firstPkt
.
tranId
,
syncStatus
[
nodeSStatus
]);
}
}
}
}
...
@@ -1092,7 +1091,9 @@ static void syncCreateRestoreDataThread(SSyncPeer *pPeer) {
...
@@ -1092,7 +1091,9 @@ static void syncCreateRestoreDataThread(SSyncPeer *pPeer) {
pthread_attr_destroy
(
&
thattr
);
pthread_attr_destroy
(
&
thattr
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
sError
(
"%s, failed to create sync thread"
,
pPeer
->
id
);
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
nodeSStatus
=
TAOS_SYNC_STATUS_INIT
;
sError
(
"%s, failed to create sync thread, set sstatus:%s"
,
pPeer
->
id
,
syncStatus
[
nodeSStatus
]);
taosClose
(
pPeer
->
syncFd
);
taosClose
(
pPeer
->
syncFd
);
syncDecPeerRef
(
pPeer
);
syncDecPeerRef
(
pPeer
);
}
else
{
}
else
{
...
@@ -1142,6 +1143,9 @@ static void syncProcessIncommingConnection(int32_t connFd, uint32_t sourceIp) {
...
@@ -1142,6 +1143,9 @@ static void syncProcessIncommingConnection(int32_t connFd, uint32_t sourceIp) {
// first packet tells what kind of link
// first packet tells what kind of link
if
(
firstPkt
.
syncHead
.
type
==
TAOS_SMSG_SYNC_DATA
)
{
if
(
firstPkt
.
syncHead
.
type
==
TAOS_SMSG_SYNC_DATA
)
{
pPeer
->
syncFd
=
connFd
;
pPeer
->
syncFd
=
connFd
;
nodeSStatus
=
TAOS_SYNC_STATUS_START
;
sInfo
(
"%s, sync-data pkt from master is received, tranId:%u, set sstatus:%s"
,
pPeer
->
id
,
firstPkt
.
tranId
,
syncStatus
[
nodeSStatus
]);
syncCreateRestoreDataThread
(
pPeer
);
syncCreateRestoreDataThread
(
pPeer
);
}
else
{
}
else
{
sDebug
(
"%s, TCP connection is up, pfd:%d sfd:%d, old pfd:%d"
,
pPeer
->
id
,
connFd
,
pPeer
->
syncFd
,
pPeer
->
peerFd
);
sDebug
(
"%s, TCP connection is up, pfd:%d sfd:%d, old pfd:%d"
,
pPeer
->
id
,
connFd
,
pPeer
->
syncFd
,
pPeer
->
peerFd
);
...
...
src/sync/src/syncRetrieve.c
浏览文件 @
a568425b
...
@@ -417,7 +417,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) {
...
@@ -417,7 +417,7 @@ static int32_t syncRetrieveFirstPkt(SSyncPeer *pPeer) {
sError
(
"%s, failed to send sync firstPkt since %s, tranId:%u"
,
pPeer
->
id
,
strerror
(
errno
),
firstPkt
.
tranId
);
sError
(
"%s, failed to send sync firstPkt since %s, tranId:%u"
,
pPeer
->
id
,
strerror
(
errno
),
firstPkt
.
tranId
);
return
-
1
;
return
-
1
;
}
}
sDebug
(
"%s, send
firstP
kt to peer, tranId:%u"
,
pPeer
->
id
,
firstPkt
.
tranId
);
sDebug
(
"%s, send
sync-data p
kt to peer, tranId:%u"
,
pPeer
->
id
,
firstPkt
.
tranId
);
SFirstPktRsp
firstPktRsp
;
SFirstPktRsp
firstPktRsp
;
if
(
taosReadMsg
(
pPeer
->
syncFd
,
&
firstPktRsp
,
sizeof
(
SFirstPktRsp
))
!=
sizeof
(
SFirstPktRsp
))
{
if
(
taosReadMsg
(
pPeer
->
syncFd
,
&
firstPktRsp
,
sizeof
(
SFirstPktRsp
))
!=
sizeof
(
SFirstPktRsp
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录