From 05baf88df8bedf1bafb70f533ded77f0492941bd Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sat, 25 Dec 2021 15:50:12 +0800 Subject: [PATCH] more --- source/dnode/mgmt/impl/src/dndVnodes.c | 4 ++-- source/dnode/mnode/impl/src/mndStb.c | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/source/dnode/mgmt/impl/src/dndVnodes.c b/source/dnode/mgmt/impl/src/dndVnodes.c index 351fc20784..bfefee7c78 100644 --- a/source/dnode/mgmt/impl/src/dndVnodes.c +++ b/source/dnode/mgmt/impl/src/dndVnodes.c @@ -822,12 +822,12 @@ static void dndProcessVnodeWriteQueue(SVnodeObj *pVnode, taos_qall qall, int32_t assert(ptr != NULL); } - vnodeProcessWMsgs(pVnode->pImpl, pArray); + // vnodeProcessWMsgs(pVnode->pImpl, pArray); for (size_t i = 0; i < numOfMsgs; i++) { SRpcMsg *pRsp = NULL; SRpcMsg *pMsg = *(SRpcMsg **)taosArrayGet(pArray, i); - int32_t code = vnodeApplyWMsg(pVnode->pImpl, pMsg, &pRsp); + int32_t code = 0; //vnodeApplyWMsg(pVnode->pImpl, pMsg, &pRsp); if (pRsp != NULL) { pRsp->ahandle = pMsg->ahandle; rpcSendResponse(pRsp); diff --git a/source/dnode/mnode/impl/src/mndStb.c b/source/dnode/mnode/impl/src/mndStb.c index 3981219636..7105ed486e 100644 --- a/source/dnode/mnode/impl/src/mndStb.c +++ b/source/dnode/mnode/impl/src/mndStb.c @@ -200,10 +200,12 @@ static SDbObj *mndAcquireDbByStb(SMnode *pMnode, char *stbName) { return mndAcquireDb(pMnode, db); } -static void *mndBuildCreateStbMsg(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb, int *contLen) { +static void *mndBuildCreateStbMsg(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb, int *pContLen) { +#if 0 SVCreateTbReq req; void * buf; int bsize; + SMsgHead * pMsgHead; req.ver = 0; req.name = pStb->name; @@ -217,19 +219,24 @@ static void *mndBuildCreateStbMsg(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb req.stbCfg.pTagSchema = pStb->pSchema + pStb->numOfColumns; bsize = tSerializeSVCreateTbReq(NULL, &req); - buf = malloc(bsize); + buf = malloc(sizeof(SMsgHead) + bsize); if (buf == NULL) { terrno = TSDB_CODE_OUT_OF_MEMORY; return NULL; } - void *pBuf = buf; + pMsgHead = (SMsgHead *)buf; + + pMsgHead->contLen = htonl(sizeof(SMsgHead) + bsize); + pMsgHead->vgId = htonl(pVgroup->vgId); + + void *pBuf = POINTER_SHIFT(buf, sizeof(SMsgHead)); tSerializeSVCreateTbReq(&pBuf, &req); - *contLen = bsize; + *pContLen = sizeof(SMsgHead) + bsize; return buf; -#if 0 +#else int32_t totalCols = pStb->numOfTags + pStb->numOfColumns; int32_t contLen = totalCols * sizeof(SSchema) + sizeof(SCreateStbInternalMsg); @@ -255,7 +262,9 @@ static void *mndBuildCreateStbMsg(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb pSchema->bytes = htonl(pSchema->bytes); pSchema->colId = htonl(pSchema->colId); } - return pCreate; + + *pContLen = contLen; + return pCreate; #endif } -- GitLab