This commit is contained in:
Hongze Cheng 2021-12-25 15:50:12 +08:00
parent 67cc6839b2
commit 05baf88df8
2 changed files with 17 additions and 8 deletions

View File

@ -822,12 +822,12 @@ static void dndProcessVnodeWriteQueue(SVnodeObj *pVnode, taos_qall qall, int32_t
assert(ptr != NULL); assert(ptr != NULL);
} }
vnodeProcessWMsgs(pVnode->pImpl, pArray); // vnodeProcessWMsgs(pVnode->pImpl, pArray);
for (size_t i = 0; i < numOfMsgs; i++) { for (size_t i = 0; i < numOfMsgs; i++) {
SRpcMsg *pRsp = NULL; SRpcMsg *pRsp = NULL;
SRpcMsg *pMsg = *(SRpcMsg **)taosArrayGet(pArray, i); 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) { if (pRsp != NULL) {
pRsp->ahandle = pMsg->ahandle; pRsp->ahandle = pMsg->ahandle;
rpcSendResponse(pRsp); rpcSendResponse(pRsp);

View File

@ -200,10 +200,12 @@ static SDbObj *mndAcquireDbByStb(SMnode *pMnode, char *stbName) {
return mndAcquireDb(pMnode, db); 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; SVCreateTbReq req;
void * buf; void * buf;
int bsize; int bsize;
SMsgHead * pMsgHead;
req.ver = 0; req.ver = 0;
req.name = pStb->name; req.name = pStb->name;
@ -217,19 +219,24 @@ static void *mndBuildCreateStbMsg(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStb
req.stbCfg.pTagSchema = pStb->pSchema + pStb->numOfColumns; req.stbCfg.pTagSchema = pStb->pSchema + pStb->numOfColumns;
bsize = tSerializeSVCreateTbReq(NULL, &req); bsize = tSerializeSVCreateTbReq(NULL, &req);
buf = malloc(bsize); buf = malloc(sizeof(SMsgHead) + bsize);
if (buf == NULL) { if (buf == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY; terrno = TSDB_CODE_OUT_OF_MEMORY;
return NULL; 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); tSerializeSVCreateTbReq(&pBuf, &req);
*contLen = bsize; *pContLen = sizeof(SMsgHead) + bsize;
return buf; return buf;
#if 0 #else
int32_t totalCols = pStb->numOfTags + pStb->numOfColumns; int32_t totalCols = pStb->numOfTags + pStb->numOfColumns;
int32_t contLen = totalCols * sizeof(SSchema) + sizeof(SCreateStbInternalMsg); 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->bytes = htonl(pSchema->bytes);
pSchema->colId = htonl(pSchema->colId); pSchema->colId = htonl(pSchema->colId);
} }
return pCreate;
*pContLen = contLen;
return pCreate;
#endif #endif
} }