Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7cb3112d
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看板
提交
7cb3112d
编写于
10月 27, 2022
作者:
M
Minghao Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(sync): modify function name
上级
a8109b7f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
20 deletion
+21
-20
include/libs/sync/syncTools.h
include/libs/sync/syncTools.h
+2
-2
source/dnode/mnode/impl/src/mndMain.c
source/dnode/mnode/impl/src/mndMain.c
+2
-2
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+2
-2
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+14
-13
source/libs/sync/src/syncReplication.c
source/libs/sync/src/syncReplication.c
+1
-1
未找到文件。
include/libs/sync/syncTools.h
浏览文件 @
7cb3112d
...
...
@@ -679,8 +679,8 @@ void syncReconfigFinishLog(const SyncReconfigFinish* pMsg);
void
syncReconfigFinishLog2
(
char
*
s
,
const
SyncReconfigFinish
*
pMsg
);
// on message ----------------------
int32_t
syncNodeOnPing
Cb
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
int32_t
syncNodeOnPingReply
Cb
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
int32_t
syncNodeOnPing
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
int32_t
syncNodeOnPingReply
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
int32_t
syncNodeOnTimer
(
SSyncNode
*
ths
,
SyncTimeout
*
pMsg
);
int32_t
syncNodeOnHeartbeat
(
SSyncNode
*
ths
,
SyncHeartbeat
*
pMsg
);
...
...
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
7cb3112d
...
...
@@ -540,12 +540,12 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_PING
)
{
SyncPing
*
pSyncMsg
=
syncPingFromRpcMsg2
(
pMsg
);
code
=
syncNodeOnPing
Cb
(
pSyncNode
,
pSyncMsg
);
code
=
syncNodeOnPing
(
pSyncNode
,
pSyncMsg
);
syncPingDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_PING_REPLY
)
{
SyncPingReply
*
pSyncMsg
=
syncPingReplyFromRpcMsg2
(
pMsg
);
code
=
syncNodeOnPingReply
Cb
(
pSyncNode
,
pSyncMsg
);
code
=
syncNodeOnPingReply
(
pSyncNode
,
pSyncMsg
);
syncPingReplyDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_CLIENT_REQUEST
)
{
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
7cb3112d
...
...
@@ -301,13 +301,13 @@ int32_t vnodeProcessSyncMsg(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_PING
)
{
SyncPing
*
pSyncMsg
=
syncPingFromRpcMsg2
(
pMsg
);
ASSERT
(
pSyncMsg
!=
NULL
);
code
=
syncNodeOnPing
Cb
(
pSyncNode
,
pSyncMsg
);
code
=
syncNodeOnPing
(
pSyncNode
,
pSyncMsg
);
syncPingDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_PING_REPLY
)
{
SyncPingReply
*
pSyncMsg
=
syncPingReplyFromRpcMsg2
(
pMsg
);
ASSERT
(
pSyncMsg
!=
NULL
);
code
=
syncNodeOnPingReply
Cb
(
pSyncNode
,
pSyncMsg
);
code
=
syncNodeOnPingReply
(
pSyncNode
,
pSyncMsg
);
syncPingReplyDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_CLIENT_REQUEST
)
{
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
7cb3112d
...
...
@@ -49,8 +49,8 @@ static int32_t syncNodeAppendNoop(SSyncNode* ths);
static
void
syncNodeEqPeerHeartbeatTimer
(
void
*
param
,
void
*
tmrId
);
// process message ----
int32_t
syncNodeOnPing
Cb
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
int32_t
syncNodeOnPingReply
Cb
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
int32_t
syncNodeOnPing
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
int32_t
syncNodeOnPingReply
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
// ---------------------------------
static
void
syncNodeFreeCb
(
void
*
param
)
{
...
...
@@ -1327,8 +1327,8 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo) {
}
// init callback
pSyncNode
->
FpOnPing
=
syncNodeOnPing
Cb
;
pSyncNode
->
FpOnPingReply
=
syncNodeOnPingReply
Cb
;
pSyncNode
->
FpOnPing
=
syncNodeOnPing
;
pSyncNode
->
FpOnPingReply
=
syncNodeOnPingReply
;
pSyncNode
->
FpOnClientRequest
=
syncNodeOnClientRequest
;
pSyncNode
->
FpOnTimeout
=
syncNodeOnTimer
;
pSyncNode
->
FpOnSnapshot
=
syncNodeOnSnapshot
;
...
...
@@ -3003,18 +3003,19 @@ static int32_t syncNodeAppendNoop(SSyncNode* ths) {
}
// on message ----
int32_t
syncNodeOnPingCb
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
)
{
// log state
int32_t
syncNodeOnPing
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
)
{
sTrace
(
"vgId:%d, recv sync-ping"
,
ths
->
vgId
);
SyncPingReply
*
pMsgReply
=
syncPingReplyBuild3
(
&
ths
->
myRaftId
,
&
pMsg
->
srcId
,
ths
->
vgId
);
SRpcMsg
rpcMsg
;
syncPingReply2RpcMsg
(
pMsgReply
,
&
rpcMsg
);
/*
// htonl
SMsgHead* pHead = rpcMsg.pCont;
pHead->contLen = htonl(pHead->contLen);
pHead->vgId = htonl(pHead->vgId);
*/
// htonl
SMsgHead* pHead = rpcMsg.pCont;
pHead->contLen = htonl(pHead->contLen);
pHead->vgId = htonl(pHead->vgId);
*/
syncNodeSendMsgById
(
&
pMsgReply
->
destId
,
ths
,
&
rpcMsg
);
syncPingReplyDestroy
(
pMsgReply
);
...
...
@@ -3022,9 +3023,9 @@ int32_t syncNodeOnPingCb(SSyncNode* ths, SyncPing* pMsg) {
return
0
;
}
int32_t
syncNodeOnPingReply
Cb
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
)
{
int32_t
syncNodeOnPingReply
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
)
{
int32_t
ret
=
0
;
s
yncPingReplyLog2
(
"==syncNodeOnPingReplyCb=="
,
pMsg
);
s
Trace
(
"vgId:%d, recv sync-ping-reply"
,
ths
->
vgId
);
return
ret
;
}
...
...
source/libs/sync/src/syncReplication.c
浏览文件 @
7cb3112d
...
...
@@ -57,7 +57,7 @@ int32_t syncNodeReplicateOne(SSyncNode* pSyncNode, SRaftId* pDestId) {
SyncIndex
logEndIndex
=
pSyncNode
->
pLogStore
->
syncLogEndIndex
(
pSyncNode
->
pLogStore
);
if
(
nextIndex
<
logStartIndex
||
nextIndex
-
1
>
logEndIndex
)
{
char
logBuf
[
128
];
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"start snapshot for next-index:%"
PRId64
", start:%"
PRId64
", end:%"
PRId64
,
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"
maybe
start snapshot for next-index:%"
PRId64
", start:%"
PRId64
", end:%"
PRId64
,
nextIndex
,
logStartIndex
,
logEndIndex
);
syncNodeEventLog
(
pSyncNode
,
logBuf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录