Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a6f33ba0
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看板
提交
a6f33ba0
编写于
6月 25, 2022
作者:
M
Minghao Li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(sync): optimized one replica
上级
77b365f0
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
92 addition
and
47 deletion
+92
-47
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
+5
-5
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+32
-28
source/libs/sync/inc/syncIO.h
source/libs/sync/inc/syncIO.h
+1
-1
source/libs/sync/inc/syncInt.h
source/libs/sync/inc/syncInt.h
+2
-1
source/libs/sync/src/syncCommit.c
source/libs/sync/src/syncCommit.c
+1
-0
source/libs/sync/src/syncIO.c
source/libs/sync/src/syncIO.c
+1
-1
source/libs/sync/src/syncMain.c
source/libs/sync/src/syncMain.c
+48
-9
未找到文件。
include/libs/sync/syncTools.h
浏览文件 @
a6f33ba0
...
...
@@ -524,7 +524,7 @@ void syncReconfigFinishLog2(char* s, const SyncReconfigFinish* pMsg);
int32_t
syncNodeOnPingCb
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
int32_t
syncNodeOnPingReplyCb
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
int32_t
syncNodeOnTimeoutCb
(
SSyncNode
*
ths
,
SyncTimeout
*
pMsg
);
int32_t
syncNodeOnClientRequestCb
(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
);
int32_t
syncNodeOnClientRequestCb
(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
,
SyncIndex
*
pRetIndex
);
int32_t
syncNodeOnRequestVoteCb
(
SSyncNode
*
ths
,
SyncRequestVote
*
pMsg
);
int32_t
syncNodeOnRequestVoteReplyCb
(
SSyncNode
*
ths
,
SyncRequestVoteReply
*
pMsg
);
int32_t
syncNodeOnAppendEntriesCb
(
SSyncNode
*
ths
,
SyncAppendEntries
*
pMsg
);
...
...
@@ -541,7 +541,7 @@ int32_t syncNodeOnSnapshotRspCb(SSyncNode* ths, SyncSnapshotRsp* pMsg);
// -----------------------------------------
typedef
int32_t
(
*
FpOnPingCb
)(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
typedef
int32_t
(
*
FpOnPingReplyCb
)(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
typedef
int32_t
(
*
FpOnClientRequestCb
)(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
);
typedef
int32_t
(
*
FpOnClientRequestCb
)(
SSyncNode
*
ths
,
SyncClientRequest
*
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
);
...
...
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
a6f33ba0
...
...
@@ -442,7 +442,7 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
syncPingReplyDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_CLIENT_REQUEST
)
{
SyncClientRequest
*
pSyncMsg
=
syncClientRequestFromRpcMsg2
(
pMsg
);
code
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
);
code
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
,
NULL
);
syncClientRequestDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_REQUEST_VOTE
)
{
SyncRequestVote
*
pSyncMsg
=
syncRequestVoteFromRpcMsg2
(
pMsg
);
...
...
@@ -491,7 +491,7 @@ int32_t mndProcessSyncMsg(SRpcMsg *pMsg) {
syncPingReplyDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_CLIENT_REQUEST
)
{
SyncClientRequest
*
pSyncMsg
=
syncClientRequestFromRpcMsg2
(
pMsg
);
code
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
);
code
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
,
NULL
);
syncClientRequestDestroy
(
pSyncMsg
);
}
else
if
(
pMsg
->
msgType
==
TDMT_SYNC_REQUEST_VOTE
)
{
SyncRequestVote
*
pSyncMsg
=
syncRequestVoteFromRpcMsg2
(
pMsg
);
...
...
@@ -555,10 +555,10 @@ static int32_t mndCheckMnodeState(SRpcMsg *pMsg) {
static
int32_t
mndCheckMsgContent
(
SRpcMsg
*
pMsg
)
{
if
(
!
IsReq
(
pMsg
))
return
0
;
if
(
pMsg
->
contLen
!=
0
&&
pMsg
->
pCont
!=
NULL
)
return
0
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
mGError
(
"msg:%p, failed to check msg, cont:%p contLen:%d, app:%p type:%s"
,
pMsg
,
pMsg
->
pCont
,
pMsg
->
contLen
,
pMsg
->
info
.
ahandle
,
TMSG_INFO
(
pMsg
->
msgType
));
pMsg
->
info
.
ahandle
,
TMSG_INFO
(
pMsg
->
msgType
));
terrno
=
TSDB_CODE_INVALID_MSG_LEN
;
return
-
1
;
}
...
...
@@ -723,7 +723,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
pIter
=
sdbFetch
(
pSdb
,
SDB_STB
,
pIter
,
(
void
**
)
&
pStb
);
if
(
pIter
==
NULL
)
break
;
SMonStbDesc
desc
=
{
0
};
SMonStbDesc
desc
=
{
0
};
SName
name1
=
{
0
};
tNameFromString
(
&
name1
,
pStb
->
db
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
a6f33ba0
...
...
@@ -137,6 +137,26 @@ void vnodeProposeMsg(SQueueInfo *pInfo, STaosQall *qall, int32_t numOfMsgs) {
vError
(
"vgId:%d, failed to pre-process msg:%p since %s"
,
vgId
,
pMsg
,
terrstr
());
}
else
{
code
=
syncPropose
(
pVnode
->
sync
,
pMsg
,
vnodeIsMsgWeak
(
pMsg
->
msgType
));
if
(
code
==
1
)
{
do
{
static
int32_t
cnt
=
0
;
if
(
cnt
++
%
1000
==
1
)
{
vInfo
(
"vgId:%d, msg:%p apply right now, apply index:%ld, msgtype:%s,%d"
,
vgId
,
pMsg
,
pMsg
->
info
.
conn
.
applyIndex
,
TMSG_INFO
(
pMsg
->
msgType
),
pMsg
->
msgType
);
}
}
while
(
0
);
SRpcMsg
rsp
=
{.
code
=
pMsg
->
code
,
.
info
=
pMsg
->
info
};
if
(
vnodeProcessWriteReq
(
pVnode
,
pMsg
,
pMsg
->
info
.
conn
.
applyIndex
,
&
rsp
)
<
0
)
{
rsp
.
code
=
terrno
;
vInfo
(
"vgId:%d, msg:%p failed to apply right now since %s"
,
vgId
,
pMsg
,
terrstr
());
}
if
(
rsp
.
info
.
handle
!=
NULL
)
{
tmsgSendRsp
(
&
rsp
);
}
code
=
0
;
}
}
}
...
...
@@ -260,7 +280,7 @@ int32_t vnodeProcessSyncReq(SVnode *pVnode, SRpcMsg *pMsg, SRpcMsg **pRsp) {
SyncClientRequest
*
pSyncMsg
=
syncClientRequestFromRpcMsg2
(
pRpcMsg
);
assert
(
pSyncMsg
!=
NULL
);
ret
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
);
ret
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
,
NULL
);
syncClientRequestDestroy
(
pSyncMsg
);
}
else
if
(
pRpcMsg
->
msgType
==
TDMT_SYNC_REQUEST_VOTE
)
{
...
...
@@ -359,34 +379,18 @@ static void vnodeSyncCommitMsg(SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta c
SyncIndex
beginIndex
=
SYNC_INDEX_INVALID
;
char
logBuf
[
256
]
=
{
0
};
if
(
pFsm
->
FpGetSnapshotInfo
!=
NULL
)
{
(
*
pFsm
->
FpGetSnapshotInfo
)(
pFsm
,
&
snapshot
);
beginIndex
=
snapshot
.
lastApplyIndex
;
}
if
(
cbMeta
.
index
>
beginIndex
)
{
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"==callback== ==CommitCb== execute, pFsm:%p, index:%ld, isWeak:%d, code:%d, state:%d %s, beginIndex :%ld
\n
"
,
pFsm
,
cbMeta
.
index
,
cbMeta
.
isWeak
,
cbMeta
.
code
,
cbMeta
.
state
,
syncUtilState2String
(
cbMeta
.
state
),
beginIndex
);
syncRpcMsgLog2
(
logBuf
,
(
SRpcMsg
*
)
pMsg
);
SRpcMsg
rpcMsg
=
{.
msgType
=
pMsg
->
msgType
,
.
contLen
=
pMsg
->
contLen
};
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
memcpy
(
rpcMsg
.
pCont
,
pMsg
->
pCont
,
pMsg
->
contLen
);
syncGetAndDelRespRpc
(
pVnode
->
sync
,
cbMeta
.
seqNum
,
&
rpcMsg
.
info
);
rpcMsg
.
info
.
conn
.
applyIndex
=
cbMeta
.
index
;
tmsgPutToQueue
(
&
pVnode
->
msgCb
,
APPLY_QUEUE
,
&
rpcMsg
);
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"==callback== ==CommitCb== execute, pFsm:%p, index:%ld, isWeak:%d, code:%d, state:%d %s, beginIndex :%ld
\n
"
,
pFsm
,
cbMeta
.
index
,
cbMeta
.
isWeak
,
cbMeta
.
code
,
cbMeta
.
state
,
syncUtilState2String
(
cbMeta
.
state
),
beginIndex
);
syncRpcMsgLog2
(
logBuf
,
(
SRpcMsg
*
)
pMsg
);
}
else
{
char
logBuf
[
256
]
=
{
0
};
snprintf
(
logBuf
,
sizeof
(
logBuf
),
"==callback== ==CommitCb== do not execute, pFsm:%p, index:%ld, isWeak:%d, code:%d, state:%d %s, "
"beginIndex :%ld
\n
"
,
pFsm
,
cbMeta
.
index
,
cbMeta
.
isWeak
,
cbMeta
.
code
,
cbMeta
.
state
,
syncUtilState2String
(
cbMeta
.
state
),
beginIndex
);
syncRpcMsgLog2
(
logBuf
,
(
SRpcMsg
*
)
pMsg
);
}
SRpcMsg
rpcMsg
=
{.
msgType
=
pMsg
->
msgType
,
.
contLen
=
pMsg
->
contLen
};
rpcMsg
.
pCont
=
rpcMallocCont
(
rpcMsg
.
contLen
);
memcpy
(
rpcMsg
.
pCont
,
pMsg
->
pCont
,
pMsg
->
contLen
);
syncGetAndDelRespRpc
(
pVnode
->
sync
,
cbMeta
.
seqNum
,
&
rpcMsg
.
info
);
rpcMsg
.
info
.
conn
.
applyIndex
=
cbMeta
.
index
;
tmsgPutToQueue
(
&
pVnode
->
msgCb
,
APPLY_QUEUE
,
&
rpcMsg
);
}
static
void
vnodeSyncPreCommitMsg
(
SSyncFSM
*
pFsm
,
const
SRpcMsg
*
pMsg
,
SFsmCbMeta
cbMeta
)
{
...
...
source/libs/sync/inc/syncIO.h
浏览文件 @
a6f33ba0
...
...
@@ -50,7 +50,7 @@ typedef struct SSyncIO {
void
*
pSyncNode
;
int32_t
(
*
FpOnSyncPing
)(
SSyncNode
*
pSyncNode
,
SyncPing
*
pMsg
);
int32_t
(
*
FpOnSyncPingReply
)(
SSyncNode
*
pSyncNode
,
SyncPingReply
*
pMsg
);
int32_t
(
*
FpOnSyncClientRequest
)(
SSyncNode
*
pSyncNode
,
SyncClientRequest
*
pMsg
);
int32_t
(
*
FpOnSyncClientRequest
)(
SSyncNode
*
pSyncNode
,
SyncClientRequest
*
pMsg
,
SyncIndex
*
pRetIndex
);
int32_t
(
*
FpOnSyncRequestVote
)(
SSyncNode
*
pSyncNode
,
SyncRequestVote
*
pMsg
);
int32_t
(
*
FpOnSyncRequestVoteReply
)(
SSyncNode
*
pSyncNode
,
SyncRequestVoteReply
*
pMsg
);
int32_t
(
*
FpOnSyncAppendEntries
)(
SSyncNode
*
pSyncNode
,
SyncAppendEntries
*
pMsg
);
...
...
source/libs/sync/inc/syncInt.h
浏览文件 @
a6f33ba0
...
...
@@ -169,7 +169,7 @@ SSyncNode* syncNodeOpen(const SSyncInfo* pSyncInfo);
void
syncNodeStart
(
SSyncNode
*
pSyncNode
);
void
syncNodeStartStandBy
(
SSyncNode
*
pSyncNode
);
void
syncNodeClose
(
SSyncNode
*
pSyncNode
);
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
const
SRpcMsg
*
pMsg
,
bool
isWeak
);
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
);
// option
bool
syncNodeSnapshotEnable
(
SSyncNode
*
pSyncNode
);
...
...
@@ -233,6 +233,7 @@ SyncIndex syncNodeGetPreIndex(SSyncNode* pSyncNode, SyncIndex index);
SyncTerm
syncNodeGetPreTerm
(
SSyncNode
*
pSyncNode
,
SyncIndex
index
);
int32_t
syncNodeGetPreIndexTerm
(
SSyncNode
*
pSyncNode
,
SyncIndex
index
,
SyncIndex
*
pPreIndex
,
SyncTerm
*
pPreTerm
);
bool
syncNodeIsOptimizedOneReplica
(
SSyncNode
*
ths
,
SRpcMsg
*
pMsg
);
int32_t
syncNodeCommit
(
SSyncNode
*
ths
,
SyncIndex
beginIndex
,
SyncIndex
endIndex
,
uint64_t
flag
);
int32_t
syncNodeUpdateNewConfigIndex
(
SSyncNode
*
ths
,
SSyncCfg
*
pNewCfg
);
...
...
source/libs/sync/src/syncCommit.c
浏览文件 @
a6f33ba0
...
...
@@ -102,6 +102,7 @@ void syncMaybeAdvanceCommitIndex(SSyncNode* pSyncNode) {
}
}
// maybe execute fsm
if
(
newCommitIndex
>
pSyncNode
->
commitIndex
)
{
SyncIndex
beginIndex
=
pSyncNode
->
commitIndex
+
1
;
SyncIndex
endIndex
=
newCommitIndex
;
...
...
source/libs/sync/src/syncIO.c
浏览文件 @
a6f33ba0
...
...
@@ -281,7 +281,7 @@ static void *syncIOConsumerFunc(void *param) {
if
(
io
->
FpOnSyncClientRequest
!=
NULL
)
{
SyncClientRequest
*
pSyncMsg
=
syncClientRequestFromRpcMsg2
(
pRpcMsg
);
ASSERT
(
pSyncMsg
!=
NULL
);
io
->
FpOnSyncClientRequest
(
io
->
pSyncNode
,
pSyncMsg
);
io
->
FpOnSyncClientRequest
(
io
->
pSyncNode
,
pSyncMsg
,
NULL
);
syncClientRequestDestroy
(
pSyncMsg
);
}
...
...
source/libs/sync/src/syncMain.c
浏览文件 @
a6f33ba0
...
...
@@ -50,7 +50,7 @@ static int32_t syncNodeAppendNoop(SSyncNode* ths);
// process message ----
int32_t
syncNodeOnPingCb
(
SSyncNode
*
ths
,
SyncPing
*
pMsg
);
int32_t
syncNodeOnPingReplyCb
(
SSyncNode
*
ths
,
SyncPingReply
*
pMsg
);
int32_t
syncNodeOnClientRequestCb
(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
);
int32_t
syncNodeOnClientRequestCb
(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
,
SyncIndex
*
pRetIndex
);
// life cycle
static
void
syncFreeNode
(
void
*
param
);
...
...
@@ -627,7 +627,7 @@ int32_t syncPropose(int64_t rid, SRpcMsg* pMsg, bool isWeak) {
return
ret
;
}
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
const
SRpcMsg
*
pMsg
,
bool
isWeak
)
{
int32_t
syncNodePropose
(
SSyncNode
*
pSyncNode
,
SRpcMsg
*
pMsg
,
bool
isWeak
)
{
int32_t
ret
=
0
;
char
eventLog
[
128
];
...
...
@@ -664,13 +664,34 @@ int32_t syncNodePropose(SSyncNode* pSyncNode, const SRpcMsg* pMsg, bool isWeak)
SRpcMsg
rpcMsg
;
syncClientRequest2RpcMsg
(
pSyncMsg
,
&
rpcMsg
);
if
(
pSyncNode
->
FpEqMsg
!=
NULL
&&
(
*
pSyncNode
->
FpEqMsg
)(
pSyncNode
->
msgcb
,
&
rpcMsg
)
==
0
)
{
ret
=
0
;
// optimized one replica
if
(
syncNodeIsOptimizedOneReplica
(
pSyncNode
,
pMsg
))
{
SyncIndex
retIndex
;
int32_t
code
=
syncNodeOnClientRequestCb
(
pSyncNode
,
pSyncMsg
,
&
retIndex
);
if
(
code
==
0
)
{
pMsg
->
info
.
conn
.
applyIndex
=
retIndex
;
rpcFreeCont
(
rpcMsg
.
pCont
);
syncRespMgrDel
(
pSyncNode
->
pSyncRespMgr
,
seqNum
);
ret
=
1
;
sDebug
(
"vgId:%d optimized index:%ld success, msgtype:%s,%d"
,
pSyncNode
->
vgId
,
retIndex
,
TMSG_INFO
(
pMsg
->
msgType
),
pMsg
->
msgType
);
}
else
{
ret
=
-
1
;
terrno
=
TSDB_CODE_SYN_INTERNAL_ERROR
;
sError
(
"vgId:%d optimized index:%ld error, msgtype:%s,%d"
,
pSyncNode
->
vgId
,
retIndex
,
TMSG_INFO
(
pMsg
->
msgType
),
pMsg
->
msgType
);
}
}
else
{
ret
=
-
1
;
terrno
=
TSDB_CODE_SYN_INTERNAL_ERROR
;
sError
(
"syncPropose pSyncNode->FpEqMsg is NULL"
);
if
(
pSyncNode
->
FpEqMsg
!=
NULL
&&
(
*
pSyncNode
->
FpEqMsg
)(
pSyncNode
->
msgcb
,
&
rpcMsg
)
==
0
)
{
ret
=
0
;
}
else
{
ret
=
-
1
;
terrno
=
TSDB_CODE_SYN_INTERNAL_ERROR
;
sError
(
"enqueue msg error, FpEqMsg is NULL"
);
}
}
syncClientRequestDestroy
(
pSyncMsg
);
goto
_END
;
...
...
@@ -2377,7 +2398,7 @@ int32_t syncNodeOnPingReplyCb(SSyncNode* ths, SyncPingReply* pMsg) {
// /\ UNCHANGED <<messages, serverVars, candidateVars,
// leaderVars, commitIndex>>
//
int32_t
syncNodeOnClientRequestCb
(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
)
{
int32_t
syncNodeOnClientRequestCb
(
SSyncNode
*
ths
,
SyncClientRequest
*
pMsg
,
SyncIndex
*
pRetIndex
)
{
int32_t
ret
=
0
;
syncClientRequestLog2
(
"==syncNodeOnClientRequestCb=="
,
pMsg
);
...
...
@@ -2436,6 +2457,14 @@ int32_t syncNodeOnClientRequestCb(SSyncNode* ths, SyncClientRequest* pMsg) {
rpcFreeCont
(
rpcMsg
.
pCont
);
}
if
(
pRetIndex
!=
NULL
)
{
if
(
ret
==
0
&&
pEntry
!=
NULL
)
{
*
pRetIndex
=
pEntry
->
index
;
}
else
{
*
pRetIndex
=
SYNC_INDEX_INVALID
;
}
}
syncEntryDestory
(
pEntry
);
return
ret
;
}
...
...
@@ -2600,6 +2629,10 @@ static int32_t syncNodeProposeConfigChangeFinish(SSyncNode* ths, SyncReconfigFin
return
0
;
}
bool
syncNodeIsOptimizedOneReplica
(
SSyncNode
*
ths
,
SRpcMsg
*
pMsg
)
{
return
(
ths
->
replicaNum
==
1
&&
syncUtilUserCommit
(
pMsg
->
msgType
)
&&
ths
->
vgId
!=
1
);
}
int32_t
syncNodeCommit
(
SSyncNode
*
ths
,
SyncIndex
beginIndex
,
SyncIndex
endIndex
,
uint64_t
flag
)
{
int32_t
code
=
0
;
ESyncState
state
=
flag
;
...
...
@@ -2621,7 +2654,13 @@ int32_t syncNodeCommit(SSyncNode* ths, SyncIndex beginIndex, SyncIndex endIndex,
syncEntry2OriginalRpc
(
pEntry
,
&
rpcMsg
);
// user commit
if
(
ths
->
pFsm
->
FpCommitCb
!=
NULL
&&
syncUtilUserCommit
(
pEntry
->
originalRpcType
))
{
bool
internalExecute
=
(
ths
->
pFsm
->
FpCommitCb
!=
NULL
)
&&
syncUtilUserCommit
(
pEntry
->
originalRpcType
);
if
(
ths
->
replicaNum
==
1
)
{
internalExecute
=
syncNodeIsOptimizedOneReplica
(
ths
,
&
rpcMsg
)
&&
!
(
ths
->
restoreFinish
);
}
// execute fsm in apply thread, or execute outside syncPropose
if
(
internalExecute
)
{
SFsmCbMeta
cbMeta
=
{
0
};
cbMeta
.
index
=
pEntry
->
index
;
cbMeta
.
lastConfigIndex
=
syncNodeGetSnapshotConfigIndex
(
ths
,
cbMeta
.
index
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录