提交 b8aa420e 编写于 作者: M Minghao Li

sync refactor

上级 5e1e65ca
...@@ -31,11 +31,11 @@ extern "C" { ...@@ -31,11 +31,11 @@ extern "C" {
typedef struct SSyncIO { typedef struct SSyncIO {
STaosQueue *pMsgQ; STaosQueue *pMsgQ;
STaosQset * pQset; STaosQset *pQset;
pthread_t consumerTid; pthread_t consumerTid;
void * serverRpc; void *serverRpc;
void * clientRpc; void *clientRpc;
SEpSet myAddr; SEpSet myAddr;
void *ioTimerTickQ; void *ioTimerTickQ;
......
...@@ -192,9 +192,9 @@ void syncNodeClose(SSyncNode* pSyncNode); ...@@ -192,9 +192,9 @@ void syncNodeClose(SSyncNode* pSyncNode);
int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRpcMsg* pMsg); int32_t syncNodeSendMsgById(const SRaftId* destRaftId, SSyncNode* pSyncNode, SRpcMsg* pMsg);
int32_t syncNodeSendMsgByInfo(const SNodeInfo* nodeInfo, SSyncNode* pSyncNode, SRpcMsg* pMsg); int32_t syncNodeSendMsgByInfo(const SNodeInfo* nodeInfo, SSyncNode* pSyncNode, SRpcMsg* pMsg);
int32_t syncNodePing(SSyncNode* pSyncNode, const SRaftId* destRaftId, SyncPing* pMsg); int32_t syncNodePing(SSyncNode* pSyncNode, const SRaftId* destRaftId, SyncPing* pMsg);
void syncNodePingAll(SSyncNode* pSyncNode); int32_t syncNodePingAll(SSyncNode* pSyncNode);
void syncNodePingPeers(SSyncNode* pSyncNode); int32_t syncNodePingPeers(SSyncNode* pSyncNode);
void syncNodePingSelf(SSyncNode* pSyncNode); int32_t syncNodePingSelf(SSyncNode* pSyncNode);
int32_t syncNodeStartPingTimer(SSyncNode* pSyncNode); int32_t syncNodeStartPingTimer(SSyncNode* pSyncNode);
int32_t syncNodeStopPingTimer(SSyncNode* pSyncNode); int32_t syncNodeStopPingTimer(SSyncNode* pSyncNode);
......
...@@ -177,7 +177,7 @@ int32_t syncNodePing(SSyncNode* pSyncNode, const SRaftId* destRaftId, SyncPing* ...@@ -177,7 +177,7 @@ int32_t syncNodePing(SSyncNode* pSyncNode, const SRaftId* destRaftId, SyncPing*
return ret; return ret;
} }
void syncNodePingAll(SSyncNode* pSyncNode) { int32_t syncNodePingAll(SSyncNode* pSyncNode) {
sTrace("syncNodePingAll pSyncNode:%p ", pSyncNode); sTrace("syncNodePingAll pSyncNode:%p ", pSyncNode);
int32_t ret = 0; int32_t ret = 0;
for (int i = 0; i < pSyncNode->syncCfg.replicaNum; ++i) { for (int i = 0; i < pSyncNode->syncCfg.replicaNum; ++i) {
...@@ -190,7 +190,7 @@ void syncNodePingAll(SSyncNode* pSyncNode) { ...@@ -190,7 +190,7 @@ void syncNodePingAll(SSyncNode* pSyncNode) {
} }
} }
void syncNodePingPeers(SSyncNode* pSyncNode) { int32_t syncNodePingPeers(SSyncNode* pSyncNode) {
int32_t ret = 0; int32_t ret = 0;
for (int i = 0; i < pSyncNode->peersNum; ++i) { for (int i = 0; i < pSyncNode->peersNum; ++i) {
SRaftId destId; SRaftId destId;
...@@ -202,7 +202,7 @@ void syncNodePingPeers(SSyncNode* pSyncNode) { ...@@ -202,7 +202,7 @@ void syncNodePingPeers(SSyncNode* pSyncNode) {
} }
} }
void syncNodePingSelf(SSyncNode* pSyncNode) { int32_t syncNodePingSelf(SSyncNode* pSyncNode) {
int32_t ret; int32_t ret;
SyncPing* pMsg = syncPingBuild3(&pSyncNode->raftId, &pSyncNode->raftId); SyncPing* pMsg = syncPingBuild3(&pSyncNode->raftId, &pSyncNode->raftId);
ret = syncNodePing(pSyncNode, &pMsg->destId, pMsg); ret = syncNodePing(pSyncNode, &pMsg->destId, pMsg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册