提交 20e2acba 编写于 作者: M Minghao Li

refactor(sync): add reserved field in message

上级 b30e411f
...@@ -46,6 +46,7 @@ typedef struct SyncClientRequest { ...@@ -46,6 +46,7 @@ typedef struct SyncClientRequest {
uint32_t originalRpcType; // origin RpcMsg msgType uint32_t originalRpcType; // origin RpcMsg msgType
uint64_t seqNum; uint64_t seqNum;
bool isWeak; bool isWeak;
int16_t reserved;
uint32_t dataLen; // origin RpcMsg.contLen uint32_t dataLen; // origin RpcMsg.contLen
char data[]; // origin RpcMsg.pCont char data[]; // origin RpcMsg.pCont
} SyncClientRequest; } SyncClientRequest;
...@@ -56,6 +57,7 @@ typedef struct SyncClientRequestReply { ...@@ -56,6 +57,7 @@ typedef struct SyncClientRequestReply {
uint32_t msgType; uint32_t msgType;
int32_t errCode; int32_t errCode;
SRaftId leaderHint; SRaftId leaderHint;
int16_t reserved;
} SyncClientRequestReply; } SyncClientRequestReply;
typedef struct SyncRequestVote { typedef struct SyncRequestVote {
...@@ -68,6 +70,7 @@ typedef struct SyncRequestVote { ...@@ -68,6 +70,7 @@ typedef struct SyncRequestVote {
SyncTerm term; SyncTerm term;
SyncIndex lastLogIndex; SyncIndex lastLogIndex;
SyncTerm lastLogTerm; SyncTerm lastLogTerm;
int16_t reserved;
} SyncRequestVote; } SyncRequestVote;
typedef struct SyncRequestVoteReply { typedef struct SyncRequestVoteReply {
...@@ -79,6 +82,7 @@ typedef struct SyncRequestVoteReply { ...@@ -79,6 +82,7 @@ typedef struct SyncRequestVoteReply {
// private data // private data
SyncTerm term; SyncTerm term;
bool voteGranted; bool voteGranted;
int16_t reserved;
} SyncRequestVoteReply; } SyncRequestVoteReply;
typedef struct SyncAppendEntries { typedef struct SyncAppendEntries {
...@@ -94,6 +98,7 @@ typedef struct SyncAppendEntries { ...@@ -94,6 +98,7 @@ typedef struct SyncAppendEntries {
SyncTerm prevLogTerm; SyncTerm prevLogTerm;
SyncIndex commitIndex; SyncIndex commitIndex;
SyncTerm privateTerm; SyncTerm privateTerm;
int16_t reserved;
uint32_t dataLen; uint32_t dataLen;
char data[]; char data[];
} SyncAppendEntries; } SyncAppendEntries;
...@@ -111,6 +116,7 @@ typedef struct SyncAppendEntriesReply { ...@@ -111,6 +116,7 @@ typedef struct SyncAppendEntriesReply {
SyncIndex matchIndex; SyncIndex matchIndex;
SyncIndex lastSendIndex; SyncIndex lastSendIndex;
int64_t startTime; int64_t startTime;
int16_t reserved;
} SyncAppendEntriesReply; } SyncAppendEntriesReply;
typedef struct SyncHeartbeat { typedef struct SyncHeartbeat {
...@@ -126,6 +132,7 @@ typedef struct SyncHeartbeat { ...@@ -126,6 +132,7 @@ typedef struct SyncHeartbeat {
SyncTerm privateTerm; SyncTerm privateTerm;
SyncTerm minMatchIndex; SyncTerm minMatchIndex;
int64_t timeStamp; int64_t timeStamp;
int16_t reserved;
} SyncHeartbeat; } SyncHeartbeat;
typedef struct SyncHeartbeatReply { typedef struct SyncHeartbeatReply {
...@@ -140,6 +147,7 @@ typedef struct SyncHeartbeatReply { ...@@ -140,6 +147,7 @@ typedef struct SyncHeartbeatReply {
SyncTerm privateTerm; SyncTerm privateTerm;
int64_t startTime; int64_t startTime;
int64_t timeStamp; int64_t timeStamp;
int16_t reserved;
} SyncHeartbeatReply; } SyncHeartbeatReply;
typedef struct SyncPreSnapshot { typedef struct SyncPreSnapshot {
...@@ -151,6 +159,7 @@ typedef struct SyncPreSnapshot { ...@@ -151,6 +159,7 @@ typedef struct SyncPreSnapshot {
// private data // private data
SyncTerm term; SyncTerm term;
int16_t reserved;
} SyncPreSnapshot; } SyncPreSnapshot;
typedef struct SyncPreSnapshotReply { typedef struct SyncPreSnapshotReply {
...@@ -163,6 +172,7 @@ typedef struct SyncPreSnapshotReply { ...@@ -163,6 +172,7 @@ typedef struct SyncPreSnapshotReply {
// private data // private data
SyncTerm term; SyncTerm term;
SyncIndex snapStart; SyncIndex snapStart;
int16_t reserved;
} SyncPreSnapshotReply; } SyncPreSnapshotReply;
typedef struct SyncApplyMsg { typedef struct SyncApplyMsg {
...@@ -190,6 +200,7 @@ typedef struct SyncSnapshotSend { ...@@ -190,6 +200,7 @@ typedef struct SyncSnapshotSend {
SSyncCfg lastConfig; SSyncCfg lastConfig;
int64_t startTime; int64_t startTime;
int32_t seq; int32_t seq;
int16_t reserved;
uint32_t dataLen; uint32_t dataLen;
char data[]; char data[];
} SyncSnapshotSend; } SyncSnapshotSend;
...@@ -208,6 +219,7 @@ typedef struct SyncSnapshotRsp { ...@@ -208,6 +219,7 @@ typedef struct SyncSnapshotRsp {
int32_t ack; int32_t ack;
int32_t code; int32_t code;
SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid SyncIndex snapBeginIndex; // when ack = SYNC_SNAPSHOT_SEQ_BEGIN, it's valid
int16_t reserved;
} SyncSnapshotRsp; } SyncSnapshotRsp;
typedef struct SyncLeaderTransfer { typedef struct SyncLeaderTransfer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册