From c79b63ab13eb122f816652e79dff6cad72f66016 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Mon, 20 Feb 2023 15:44:36 +0800 Subject: [PATCH] fix: wal compatibility of normal tables --- source/dnode/vnode/src/vnd/vnodeSvr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index e057eeaace..9cff64b9b1 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -987,7 +987,8 @@ typedef struct SSubmitReqConvertCxt { static int32_t vnodeResetTableCxt(SMeta *pMeta, SSubmitReqConvertCxt *pCxt) { taosMemoryFreeClear(pCxt->pTbSchema); - pCxt->pTbSchema = metaGetTbTSchema(pMeta, pCxt->msgIter.suid, pCxt->msgIter.sversion, 1); + pCxt->pTbSchema = metaGetTbTSchema(pMeta, pCxt->msgIter.suid > 0 ? pCxt->msgIter.suid : pCxt->msgIter.uid, + pCxt->msgIter.sversion, 1); if (NULL == pCxt->pTbSchema) { return TSDB_CODE_INVALID_MSG; } @@ -1166,12 +1167,16 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq pRsp->code = TSDB_CODE_SUCCESS; + void *pAllocMsg = NULL; SSubmitReq2Msg *pMsg = (SSubmitReq2Msg *)pReq; if (0 == pMsg->version) { code = vnodeSubmitReqConvertToSubmitReq2(pVnode, (SSubmitReq *)pMsg, pSubmitReq); if (TSDB_CODE_SUCCESS == code) { code = vnodeRebuildSubmitReqMsg(pSubmitReq, &pReq); } + if (TSDB_CODE_SUCCESS == code) { + pAllocMsg = pReq; + } if (TSDB_CODE_SUCCESS != code) { goto _exit; } @@ -1331,9 +1336,7 @@ _exit: if (code) terrno = code; - if (0 == pMsg->version) { - taosMemoryFree(pReq); - } + taosMemoryFree(pAllocMsg); return code; } -- GitLab