diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index b3e9f53a5a9c6459fbc6451ba84e32db20d9af51..e4385037802045e39c08941b2f747653d8925396 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -281,8 +281,9 @@ int32_t vnodeProcessQueryMsg(SVnode *pVnode, SRpcMsg *pMsg) { int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { vTrace("message in fetch queue is processing"); - if ((pMsg->msgType == TDMT_SCH_FETCH || pMsg->msgType == TDMT_VND_TABLE_META || pMsg->msgType == TDMT_VND_TABLE_CFG) - && !vnodeIsLeader(pVnode)) { + if ((pMsg->msgType == TDMT_SCH_FETCH || pMsg->msgType == TDMT_VND_TABLE_META || + pMsg->msgType == TDMT_VND_TABLE_CFG) && + !vnodeIsLeader(pVnode)) { vnodeRedirectRpcMsg(pVnode, pMsg); return 0; } @@ -389,10 +390,14 @@ static int32_t vnodeProcessCreateStbReq(SVnode *pVnode, int64_t version, void *p goto _err; } + taosMemoryFree(req.schemaRow.pSchema); + taosMemoryFree(req.schemaTag.pSchema); tDecoderClear(&coder); return 0; _err: + taosMemoryFree(req.schemaRow.pSchema); + taosMemoryFree(req.schemaTag.pSchema); tDecoderClear(&coder); return -1; } @@ -811,7 +816,8 @@ _exit: taosArrayDestroy(submitRsp.pArray); // TODO: the partial success scenario and the error case - // => If partial success, extract the success submitted rows and reconstruct a new submit msg, and push to level 1/level 2. + // => If partial success, extract the success submitted rows and reconstruct a new submit msg, and push to level + // 1/level 2. // TODO: refactor if ((terrno == TSDB_CODE_SUCCESS) && (pRsp->code == TSDB_CODE_SUCCESS)) { tdProcessRSmaSubmit(pVnode->pSma, pReq, STREAM_INPUT__DATA_SUBMIT); @@ -915,4 +921,4 @@ static int32_t vnodeProcessDeleteReq(SVnode *pVnode, int64_t version, void *pReq _err: return code; -} \ No newline at end of file +} diff --git a/source/libs/executor/inc/executorimpl.h b/source/libs/executor/inc/executorimpl.h index 816b080fd7adeec563389baaabacb21a73917b21..8994c9d192490722c9883c9641c1a14df8b5a786 100644 --- a/source/libs/executor/inc/executorimpl.h +++ b/source/libs/executor/inc/executorimpl.h @@ -527,6 +527,7 @@ typedef struct SFillOperatorInfo { void** p; SSDataBlock* existNewGroupBlock; bool multigroupResult; + STimeWindow win; } SFillOperatorInfo; typedef struct SGroupbyOperatorInfo { diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 9ea77935907ade5d4cdc87233fc6c5ae1eea7836..3bf6c9fa0a33d14f1ef51f9d61604cfa034472d7 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1340,6 +1340,8 @@ void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock) { extractQualifiedTupleByFilterResult(pBlock, rowRes, keep); blockDataUpdateTsWindow(pBlock, 0); + + taosMemoryFree(rowRes); } void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowRes, bool keep) { @@ -3334,7 +3336,7 @@ static void doHandleRemainBlockForNewGroupImpl(SFillOperatorInfo* pInfo, SResult SExecTaskInfo* pTaskInfo) { pInfo->totalInputRows = pInfo->existNewGroupBlock->info.rows; - int64_t ekey = Q_STATUS_EQUAL(pTaskInfo->status, TASK_COMPLETED) ? pTaskInfo->window.ekey + int64_t ekey = Q_STATUS_EQUAL(pTaskInfo->status, TASK_COMPLETED) ? pInfo->win.ekey : pInfo->existNewGroupBlock->info.window.ekey; taosResetFillInfo(pInfo->pFillInfo, getFillInfoStart(pInfo->pFillInfo)); @@ -3395,7 +3397,7 @@ static SSDataBlock* doFill(SOperatorInfo* pOperator) { // Fill the previous group data block, before handle the data block of new group. // Close the fill operation for previous group data block - taosFillSetStartInfo(pInfo->pFillInfo, 0, pTaskInfo->window.ekey); + taosFillSetStartInfo(pInfo->pFillInfo, 0, pInfo->win.ekey); } else { if (pBlock == NULL) { if (pInfo->totalInputRows == 0) { @@ -3403,7 +3405,7 @@ static SSDataBlock* doFill(SOperatorInfo* pOperator) { return NULL; } - taosFillSetStartInfo(pInfo->pFillInfo, 0, pTaskInfo->window.ekey); + taosFillSetStartInfo(pInfo->pFillInfo, 0, pInfo->win.ekey); } else { pInfo->totalInputRows += pBlock->info.rows; taosFillSetStartInfo(pInfo->pFillInfo, pBlock->info.rows, pBlock->info.window.ekey); @@ -3920,7 +3922,8 @@ static int32_t initFillInfo(SFillOperatorInfo* pInfo, SExprInfo* pExpr, int32_t int32_t order = TSDB_ORDER_ASC; pInfo->pFillInfo = taosCreateFillInfo(order, w.skey, 0, capacity, numOfCols, pInterval, fillType, pColInfo, id); - pInfo->p = taosMemoryCalloc(numOfCols, POINTER_BYTES); + pInfo->win = win; + pInfo->p = taosMemoryCalloc(numOfCols, POINTER_BYTES); if (pInfo->pFillInfo == NULL || pInfo->p == NULL) { taosMemoryFree(pInfo->pFillInfo); taosMemoryFree(pInfo->p); diff --git a/tests/script/tsim/valgrind/basic1.sim b/tests/script/tsim/valgrind/basic1.sim index adcc92594b7cbd96f26035576cc9a4855f0f071a..1827e8d3c0b32382d36544eef9e2ee01238b9246 100644 --- a/tests/script/tsim/valgrind/basic1.sim +++ b/tests/script/tsim/valgrind/basic1.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start -v sql connect @@ -33,9 +34,10 @@ sql drop dnode 2 sql alter dnode 1 'debugflag 143' print =============== step4: create show database -sql create database d1 vgroups 1 +sql create database d1 vgroups 1 buffer 3 sql show databases -sql show d1.vgroups +sql use d1 +sql show vgroups print =============== step5: create show stable sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) @@ -44,8 +46,6 @@ if $rows != 1 then return -1 endi - -goto _OVER print =============== step6: create show table sql create table ct1 using stb tags(1000) sql show tables diff --git a/tests/script/tsim/valgrind/basic2.sim b/tests/script/tsim/valgrind/basic2.sim index 8781acd6987b384b4e6d8f72b4ebe29f00da8463..a592d48d66826a3b8d2a7fea73de0ec74d18fc43 100644 --- a/tests/script/tsim/valgrind/basic2.sim +++ b/tests/script/tsim/valgrind/basic2.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start -v sql connect @@ -19,7 +20,7 @@ if $rows != 1 then endi print =============== step2: create db -sql create database db vgroups 1 +sql create database db vgroups 1 buffer 3 sql use db sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) diff --git a/tests/script/tsim/valgrind/checkError1.sim b/tests/script/tsim/valgrind/checkError1.sim index 654180f722f9aa943d91fecdb4afccb9893f6605..edbb28de4b61ed4152ae3623fa01744dd5bcffe6 100644 --- a/tests/script/tsim/valgrind/checkError1.sim +++ b/tests/script/tsim/valgrind/checkError1.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start -v sql connect @@ -28,7 +29,10 @@ sql alter user u1 pass 'taosdata' sql drop user u1 sql_error alter user u2 sysinfo 0 -print =============== step3: +print =============== step3: create drop dnode +sql create dnode $hostname port 7200 +sql drop dnode 2 +sql alter dnode 1 'debugflag 143' print =============== stop system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/valgrind/checkError2.sim b/tests/script/tsim/valgrind/checkError2.sim index b3d57d7fdbbcd67a1bbc72b038e2422f060c94e0..31cd40cc1500b5d80c76d818c060eb9f9d2f47ed 100644 --- a/tests/script/tsim/valgrind/checkError2.sim +++ b/tests/script/tsim/valgrind/checkError2.sim @@ -1,5 +1,6 @@ system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c debugflag -v 131 system sh/exec.sh -n dnode1 -s start -v sql connect @@ -19,7 +20,17 @@ if $rows != 1 then endi print =============== step2: create db -sql create database db vgroups 1 +sql create database d1 vgroups 1 buffer 3 +sql show databases +sql use d1 +sql show vgroups + +print =============== step3: create show stable +sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) +sql show stables +if $rows != 1 then + return -1 +endi _OVER: system sh/exec.sh -n dnode1 -s stop -x SIGINT @@ -29,7 +40,7 @@ print ----> start to check if there are ERRORS in vagrind log file for each dnod system_content sh/checkValgrind.sh -n dnode1 print cmd return result ----> [ $system_content ] -if $system_content <= 8 then +if $system_content <= 6 then return 0 endi