From 81439ba0cff01c6d2fdcaf1ad57d6fa5e8501a03 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 9 Aug 2023 13:31:38 +0800 Subject: [PATCH] fix: memory invalid read and perf issue --- source/dnode/vnode/src/tsdb/tsdbMergeTree.c | 2 ++ source/libs/executor/src/groupcacheoperator.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 1d0995427e..175ed4e83f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -483,12 +483,14 @@ int32_t tLDataIterOpen2(struct SLDataIter *pIter, SSttFileReader *pSttFileReader tsdbDebug("load the stt file info completed, elapsed time:%.2fms, %s", el, idStr); } +/* bool exists = existsFromSttBlkStatis(pBlockLoadInfo->pSttStatisBlkArray, suid, uid, pIter->pReader); if (!exists) { pIter->iSttBlk = -1; pIter->pSttBlk = NULL; return TSDB_CODE_SUCCESS; } +*/ // find the start block, actually we could load the position to avoid repeatly searching for the start position when // the skey is updated. diff --git a/source/libs/executor/src/groupcacheoperator.c b/source/libs/executor/src/groupcacheoperator.c index 2651373010..e904cc7ab8 100755 --- a/source/libs/executor/src/groupcacheoperator.c +++ b/source/libs/executor/src/groupcacheoperator.c @@ -1079,8 +1079,8 @@ static int32_t getBlkFromGroupCache(struct SOperatorInfo* pOperator, SSDataBlock code = getBlkFromSessionCache(pOperator, pGcParam->sessionId, pSession, ppRes); if (NULL == *ppRes) { - taosHashRemove(pCtx->pSessions, &pGcParam->sessionId, sizeof(pGcParam->sessionId)); qError("session %" PRId64 " in downstream %d total got %" PRId64 " rows", pGcParam->sessionId, pCtx->id, pSession->resRows); + taosHashRemove(pCtx->pSessions, &pGcParam->sessionId, sizeof(pGcParam->sessionId)); } else { pSession->resRows += (*ppRes)->info.rows; qError("session %" PRId64 " in downstream %d got %" PRId64 " rows in one block", pGcParam->sessionId, pCtx->id, (*ppRes)->info.rows);