diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index 663427cf2020d644188d3aee44811ca533e2ee2b..25bf097faf007573b691224475b62b97fc8d6696 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -115,17 +115,6 @@ void syncAppendEntriesPrint2(char* s, const SyncAppendEntries* pMsg); void syncAppendEntriesLog(const SyncAppendEntries* pMsg); void syncAppendEntriesLog2(char* s, const SyncAppendEntries* pMsg); -// --------------------------------------------- - -typedef struct SOffsetAndContLen { - int32_t offset; - int32_t contLen; -} SOffsetAndContLen; - -// data: -// block1: SOffsetAndContLen Array -// block2: entry Array - typedef struct SyncAppendEntriesReply { uint32_t bytes; int32_t vgId; diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 6e8a927e3fdf1a2d732104b3bac6493c21da5536..636bf9410e85819006d0608adead88ea14885be2 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -1654,7 +1654,7 @@ void syncNodeVoteForSelf(SSyncNode* pSyncNode) { SRpcMsg rpcMsg = {0}; int32_t ret = syncBuildRequestVoteReply(&rpcMsg, pSyncNode->vgId); - if (ret == 0) return; + if (ret != 0) return; SyncRequestVoteReply* pMsg = rpcMsg.pCont; pMsg->srcId = pSyncNode->myRaftId; diff --git a/source/libs/sync/src/syncRequestVote.c b/source/libs/sync/src/syncRequestVote.c index 9085572ebe05da991c16f56cab65666c1f089dfc..e2cce286719270817c9d43352b65cffafd7f5717 100644 --- a/source/libs/sync/src/syncRequestVote.c +++ b/source/libs/sync/src/syncRequestVote.c @@ -141,7 +141,7 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) { // send msg SRpcMsg rpcMsg = {0}; ret = syncBuildRequestVoteReply(&rpcMsg, ths->vgId); - ASSERT(ret); + ASSERT(ret == 0 ); SyncRequestVoteReply* pReply = rpcMsg.pCont; pReply->srcId = ths->myRaftId; diff --git a/source/libs/sync/test/sync_test_lib/inc/syncBatch.h b/source/libs/sync/test/sync_test_lib/inc/syncBatch.h index 8d8859fc1fce65e717add00777d0773c4b2d9730..9ea9da8d695a7e0a19d1776ca1648cd903bada49 100644 --- a/source/libs/sync/test/sync_test_lib/inc/syncBatch.h +++ b/source/libs/sync/test/sync_test_lib/inc/syncBatch.h @@ -58,6 +58,15 @@ void syncClientRequestBatchPrint2(char* s, const SyncClientRequestBatch* pMsg); void syncClientRequestBatchLog(const SyncClientRequestBatch* pMsg); void syncClientRequestBatchLog2(char* s, const SyncClientRequestBatch* pMsg); +typedef struct SOffsetAndContLen { + int32_t offset; + int32_t contLen; +} SOffsetAndContLen; + +// data: +// block1: SOffsetAndContLen Array +// block2: entry Array + typedef struct SyncAppendEntriesBatch { uint32_t bytes; int32_t vgId;