From e0f951e668f3c7cced572627124ff0491a520c1f Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 28 Mar 2023 19:15:38 +0800 Subject: [PATCH] fix: memory rows issue --- source/dnode/vnode/src/tsdb/tsdbMemTable.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 46d0509c38..23c5ddcf4c 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -300,12 +300,16 @@ void tsdbMemTableCountRows(SMemTable *pMemTable, SHashObj* pTableMap, int taosRLockLatch(&pMemTable->latch); for (int32_t i = 0; i < pMemTable->nBucket; ++i) { STbData *pTbData = pMemTable->aBucket[i]; - - void* p = taosHashGet(pTableMap, &pTbData->uid, sizeof(pTbData->uid)); - if (p == NULL) { - continue; + while (pTbData) { + void* p = taosHashGet(pTableMap, &pTbData->uid, sizeof(pTbData->uid)); + if (p == NULL) { + pTbData = pTbData->next; + continue; + } + + rowsNum += tsdbCountTbDataRows(pTbData); + pTbData = pTbData->next; } - rowsNum += tsdbCountTbDataRows(pTbData); } taosRUnLockLatch(&pMemTable->latch); } -- GitLab