From d7edb105f263538b0dee13abbff3838845bccd75 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Wed, 20 Apr 2022 15:05:14 +0800 Subject: [PATCH] add SyncApplyMsg into vmProcessApplyQueue --- source/dnode/mgmt/mgmt_vnode/src/vmWorker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c index 9e42f8dfb6..b3afba51c0 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmWorker.c @@ -190,6 +190,7 @@ static void vmProcessApplyQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO taosGetQitem(qall, (void **)&pMsg); + // init response rpc msg rsp.code = 0; rsp.pCont = NULL; rsp.contLen = 0; @@ -201,6 +202,7 @@ static void vmProcessApplyQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO SRpcMsg originalRpcMsg; syncApplyMsg2OriginalRpcMsg(pSyncApplyMsg, &originalRpcMsg); + // apply data into tsdb if (vnodeProcessWriteReq(pVnode->pImpl, &originalRpcMsg, pSyncApplyMsg->fsmMeta.index, &rsp) < 0) { rsp.code = terrno; dTrace("vnodeProcessWriteReq error, code:%d", terrno); @@ -209,6 +211,7 @@ static void vmProcessApplyQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numO syncApplyMsgDestroy(pSyncApplyMsg); rpcFreeCont(originalRpcMsg.pCont); + // if leader, send response if (pMsg->rpcMsg.handle != NULL && pMsg->rpcMsg.ahandle != NULL) { rsp.ahandle = pMsg->rpcMsg.ahandle; rsp.handle = pMsg->rpcMsg.handle; -- GitLab