sync index
This commit is contained in:
parent
7d897369d5
commit
a471152b96
|
@ -40,7 +40,7 @@ static void syncNodeEqHeartbeatTimer(void* param, void* tmrId);
|
||||||
static int32_t syncNodeOnPingCb(SSyncNode* ths, SyncPing* pMsg);
|
static int32_t syncNodeOnPingCb(SSyncNode* ths, SyncPing* pMsg);
|
||||||
static int32_t syncNodeOnPingReplyCb(SSyncNode* ths, SyncPingReply* pMsg);
|
static int32_t syncNodeOnPingReplyCb(SSyncNode* ths, SyncPingReply* pMsg);
|
||||||
|
|
||||||
// raft algorithm ----
|
// raft state change ----
|
||||||
static void UpdateTerm(SSyncNode* pSyncNode, SyncTerm term);
|
static void UpdateTerm(SSyncNode* pSyncNode, SyncTerm term);
|
||||||
static void syncNodeBecomeFollower(SSyncNode* pSyncNode);
|
static void syncNodeBecomeFollower(SSyncNode* pSyncNode);
|
||||||
static void syncNodeBecomeLeader(SSyncNode* pSyncNode);
|
static void syncNodeBecomeLeader(SSyncNode* pSyncNode);
|
||||||
|
@ -595,7 +595,7 @@ static int32_t syncNodeOnPingReplyCb(SSyncNode* ths, SyncPingReply* pMsg) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// raft algorithm ----
|
// raft state change ----
|
||||||
static void UpdateTerm(SSyncNode* pSyncNode, SyncTerm term) {
|
static void UpdateTerm(SSyncNode* pSyncNode, SyncTerm term) {
|
||||||
if (term > pSyncNode->pRaftStore->currentTerm) {
|
if (term > pSyncNode->pRaftStore->currentTerm) {
|
||||||
pSyncNode->pRaftStore->currentTerm = term;
|
pSyncNode->pRaftStore->currentTerm = term;
|
||||||
|
|
Loading…
Reference in New Issue