Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fd152f00
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看板
提交
fd152f00
编写于
11月 11, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact: adjust head file and sync log
上级
b4f8e454
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
36 addition
and
20 deletion
+36
-20
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+24
-1
source/libs/sync/inc/syncMessage.h
source/libs/sync/inc/syncMessage.h
+4
-18
source/libs/sync/src/syncAppendEntries.c
source/libs/sync/src/syncAppendEntries.c
+1
-0
source/libs/sync/src/syncAppendEntriesReply.c
source/libs/sync/src/syncAppendEntriesReply.c
+1
-0
source/libs/sync/src/syncElection.c
source/libs/sync/src/syncElection.c
+2
-1
source/libs/sync/src/syncMessage.c
source/libs/sync/src/syncMessage.c
+1
-0
source/libs/sync/src/syncRequestVote.c
source/libs/sync/src/syncRequestVote.c
+1
-0
source/libs/sync/src/syncRequestVoteReply.c
source/libs/sync/src/syncRequestVoteReply.c
+1
-0
source/libs/sync/src/syncVoteMgr.c
source/libs/sync/src/syncVoteMgr.c
+1
-0
未找到文件。
source/libs/sync/inc/syncInt.h
浏览文件 @
fd152f00
...
...
@@ -21,7 +21,6 @@ extern "C" {
#endif
#include "sync.h"
#include "syncTools.h"
#include "taosdef.h"
#include "tlog.h"
#include "trpc.h"
...
...
@@ -85,9 +84,33 @@ typedef struct SSyncSnapshotSender SSyncSnapshotSender;
typedef
struct
SSyncSnapshotReceiver
SSyncSnapshotReceiver
;
typedef
struct
SSyncTimer
SSyncTimer
;
typedef
struct
SSyncHbTimerData
SSyncHbTimerData
;
typedef
struct
SyncSnapshotSend
SyncSnapshotSend
;
typedef
struct
SyncSnapshotRsp
SyncSnapshotRsp
;
typedef
struct
SyncLocalCmd
SyncLocalCmd
;
typedef
struct
SyncAppendEntriesBatch
SyncAppendEntriesBatch
;
typedef
struct
SyncPreSnapshotReply
SyncPreSnapshotReply
;
typedef
struct
SyncHeartbeatReply
SyncHeartbeatReply
;
typedef
struct
SyncHeartbeat
SyncHeartbeat
;
typedef
struct
SyncPreSnapshot
SyncPreSnapshot
;
typedef
int32_t
(
*
FpOnPingCb
)(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
typedef
int32_t
(
*
FpOnPingReplyCb
)(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
typedef
int32_t
(
*
FpOnClientRequestCb
)(
SSyncNode
*
ths
,
SRpcMsg
*
pMsg
,
SyncIndex
*
pRetIndex
);
typedef
int32_t
(
*
FpOnRequestVoteCb
)(
SSyncNode
*
ths
,
SyncRequestVote
*
pMsg
);
typedef
int32_t
(
*
FpOnRequestVoteReplyCb
)(
SSyncNode
*
ths
,
SyncRequestVoteReply
*
pMsg
);
typedef
int32_t
(
*
FpOnAppendEntriesCb
)(
SSyncNode
*
ths
,
SyncAppendEntries
*
pMsg
);
typedef
int32_t
(
*
FpOnAppendEntriesReplyCb
)(
SSyncNode
*
ths
,
SyncAppendEntriesReply
*
pMsg
);
typedef
int32_t
(
*
FpOnTimeoutCb
)(
SSyncNode
*
pSyncNode
,
SyncTimeout
*
pMsg
);
typedef
int32_t
(
*
FpOnSnapshotCb
)(
SSyncNode
*
ths
,
SyncSnapshotSend
*
pMsg
);
typedef
int32_t
(
*
FpOnSnapshotReplyCb
)(
SSyncNode
*
ths
,
SyncSnapshotRsp
*
pMsg
);
extern
bool
gRaftDetailLog
;
typedef
struct
SRaftId
{
SyncNodeId
addr
;
SyncGroupId
vgId
;
}
SRaftId
;
typedef
struct
SSyncHbTimerData
{
SSyncNode
*
pSyncNode
;
SSyncTimer
*
pTimer
;
...
...
source/libs/sync/inc/sync
Tools
.h
→
source/libs/sync/inc/sync
Message
.h
浏览文件 @
fd152f00
...
...
@@ -13,18 +13,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_LIBS_SYNC_
TOOLS
_H
#define _TD_LIBS_SYNC_
TOOLS
_H
#ifndef _TD_LIBS_SYNC_
MESSAGE
_H
#define _TD_LIBS_SYNC_
MESSAGE
_H
#ifdef __cplusplus
extern
"C"
{
#endif
// ------------------ ds -------------------
typedef
struct
SRaftId
{
SyncNodeId
addr
;
SyncGroupId
vgId
;
}
SRaftId
;
#include "syncInt.h"
// ------------------ for debug -------------------
void
syncRpcMsgPrint
(
SRpcMsg
*
pMsg
);
...
...
@@ -731,16 +727,6 @@ int32_t syncNodeOnClientRequest(SSyncNode* ths, SRpcMsg* pMsg, SyncIndex* pRetIn
int32_t
syncNodeOnLocalCmd
(
SSyncNode
*
ths
,
SyncLocalCmd
*
pMsg
);
// -----------------------------------------
typedef
int32_t
(
*
FpOnPingCb
)(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
typedef
int32_t
(
*
FpOnPingReplyCb
)(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
typedef
int32_t
(
*
FpOnClientRequestCb
)(
SSyncNode
*
ths
,
SRpcMsg
*
pMsg
,
SyncIndex
*
pRetIndex
);
typedef
int32_t
(
*
FpOnRequestVoteCb
)(
SSyncNode
*
ths
,
SyncRequestVote
*
pMsg
);
typedef
int32_t
(
*
FpOnRequestVoteReplyCb
)(
SSyncNode
*
ths
,
SyncRequestVoteReply
*
pMsg
);
typedef
int32_t
(
*
FpOnAppendEntriesCb
)(
SSyncNode
*
ths
,
SyncAppendEntries
*
pMsg
);
typedef
int32_t
(
*
FpOnAppendEntriesReplyCb
)(
SSyncNode
*
ths
,
SyncAppendEntriesReply
*
pMsg
);
typedef
int32_t
(
*
FpOnTimeoutCb
)(
SSyncNode
*
pSyncNode
,
SyncTimeout
*
pMsg
);
typedef
int32_t
(
*
FpOnSnapshotCb
)(
SSyncNode
*
ths
,
SyncSnapshotSend
*
pMsg
);
typedef
int32_t
(
*
FpOnSnapshotReplyCb
)(
SSyncNode
*
ths
,
SyncSnapshotRsp
*
pMsg
);
// option ----------------------------------
bool
syncNodeSnapshotEnable
(
SSyncNode
*
pSyncNode
);
...
...
@@ -752,4 +738,4 @@ ESyncStrategy syncNodeStrategy(SSyncNode* pSyncNode);
}
#endif
#endif
/*_TD_LIBS_SYNC_
TOOLS
_H*/
#endif
/*_TD_LIBS_SYNC_
MESSAGE
_H*/
source/libs/sync/src/syncAppendEntries.c
浏览文件 @
fd152f00
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "syncAppendEntries.h"
#include "syncMessage.h"
#include "syncRaftLog.h"
#include "syncRaftStore.h"
...
...
source/libs/sync/src/syncAppendEntriesReply.c
浏览文件 @
fd152f00
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "syncAppendEntriesReply.h"
#include "syncMessage.h"
#include "syncCommit.h"
#include "syncIndexMgr.h"
#include "syncRaftStore.h"
...
...
source/libs/sync/src/syncElection.c
浏览文件 @
fd152f00
...
...
@@ -15,10 +15,11 @@
#define _DEFAULT_SOURCE
#include "syncElection.h"
#include "syncMessage.h"
#include "syncRaftCfg.h"
#include "syncRaftStore.h"
#include "syncVoteMgr.h"
#include "syncUtil.h"
#include "syncVoteMgr.h"
// TLA+ Spec
// RequestVote(i, j) ==
...
...
source/libs/sync/src/syncMessage.c
浏览文件 @
fd152f00
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "syncMessage.h"
#include "syncRaftCfg.h"
#include "syncRaftEntry.h"
...
...
source/libs/sync/src/syncRequestVote.c
浏览文件 @
fd152f00
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "syncRequestVote.h"
#include "syncMessage.h"
#include "syncRaftCfg.h"
#include "syncRaftStore.h"
#include "syncUtil.h"
...
...
source/libs/sync/src/syncRequestVoteReply.c
浏览文件 @
fd152f00
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "syncRequestVoteReply.h"
#include "syncMessage.h"
#include "syncRaftStore.h"
#include "syncVoteMgr.h"
...
...
source/libs/sync/src/syncVoteMgr.c
浏览文件 @
fd152f00
...
...
@@ -15,6 +15,7 @@
#define _DEFAULT_SOURCE
#include "syncVoteMgr.h"
#include "syncMessage.h"
#include "syncUtil.h"
static
void
voteGrantedClearVotes
(
SVotesGranted
*
pVotesGranted
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录