diff --git a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c index 639d706668a2f5f8e76dbdf89f58c4ac280a3637..76e5897e53de3ce6135701333e8d89682bb1cbdc 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCacheRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbCacheRead.c @@ -250,7 +250,11 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 return code; } - if (h == NULL || taosArrayGetSize(pRow) <= 0) { + if (h == NULL) { + continue; + } + if (taosArrayGetSize(pRow) <= 0) { + tsdbCacheRelease(lruCache, h); continue; } @@ -319,7 +323,11 @@ int32_t tsdbRetrieveCacheRows(void* pReader, SSDataBlock* pResBlock, const int32 return code; } - if (h == NULL || taosArrayGetSize(pRow) <= 0) { + if (h == NULL) { + continue; + } + if (taosArrayGetSize(pRow) <= 0) { + tsdbCacheRelease(lruCache, h); continue; }