sync refactor

This commit is contained in:
Minghao Li 2022-03-24 19:40:37 +08:00
parent 61f227816d
commit 83ecb8dd30
2 changed files with 19 additions and 16 deletions

View File

@ -75,6 +75,7 @@ int32_t syncIOSendMsg(void *clientRpc, const SEpSet *pEpSet, SRpcMsg *pMsg) {
syncRpcMsgPrint2(logBuf, pMsg); syncRpcMsgPrint2(logBuf, pMsg);
pMsg->handle = NULL; pMsg->handle = NULL;
pMsg->noResp = 1;
rpcSendRequest(clientRpc, pEpSet, pMsg, NULL); rpcSendRequest(clientRpc, pEpSet, pMsg, NULL);
return ret; return ret;
} }
@ -324,6 +325,7 @@ static void *syncIOConsumerFunc(void *param) {
taosGetQitem(qall, (void **)&pRpcMsg); taosGetQitem(qall, (void **)&pRpcMsg);
rpcFreeCont(pRpcMsg->pCont); rpcFreeCont(pRpcMsg->pCont);
/*
if (pRpcMsg->handle != NULL) { if (pRpcMsg->handle != NULL) {
int msgSize = 32; int msgSize = 32;
memset(&rpcMsg, 0, sizeof(rpcMsg)); memset(&rpcMsg, 0, sizeof(rpcMsg));
@ -337,6 +339,7 @@ static void *syncIOConsumerFunc(void *param) {
syncRpcMsgPrint2((char *)"syncIOConsumerFunc rpcSendResponse --> ", &rpcMsg); syncRpcMsgPrint2((char *)"syncIOConsumerFunc rpcSendResponse --> ", &rpcMsg);
rpcSendResponse(&rpcMsg); rpcSendResponse(&rpcMsg);
} }
*/
taosFreeQitem(pRpcMsg); taosFreeQitem(pRpcMsg);
} }

View File

@ -111,7 +111,7 @@ SyncTerm logStoreLastTerm(SSyncLogStore* pLogStore) {
int32_t logStoreUpdateCommitIndex(SSyncLogStore* pLogStore, SyncIndex index) { int32_t logStoreUpdateCommitIndex(SSyncLogStore* pLogStore, SyncIndex index) {
SSyncLogStoreData* pData = pLogStore->data; SSyncLogStoreData* pData = pLogStore->data;
SWal* pWal = pData->pWal; SWal* pWal = pData->pWal;
walCommit(pWal, index); assert(walCommit(pWal, index) == 0);
return 0; // to avoid compiler error return 0; // to avoid compiler error
} }