sync refactor
This commit is contained in:
parent
5e1e65ca30
commit
b8aa420e3a
|
@ -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);
|
||||||
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*
|
||||||
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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue