From 47a7664e2c8fe67aee5ed371703e78a96e803fe9 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 16 Nov 2022 14:52:38 +0800 Subject: [PATCH] refactor: add some logs. --- source/common/src/tglobal.c | 2 +- source/dnode/vnode/src/meta/metaCache.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 41be026a4c..0db3e99863 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -120,7 +120,7 @@ int32_t tsMinIntervalTime = 1; int32_t tsMaxMemUsedByInsert = 1024; float tsSelectivityRatio = 1.0; -int32_t tsTagFilterResCacheSize = 4096; +int32_t tsTagFilterResCacheSize = 1024*10; // the maximum allowed query buffer size during query processing for each data node. // -1 no limit (default) diff --git a/source/dnode/vnode/src/meta/metaCache.c b/source/dnode/vnode/src/meta/metaCache.c index e448c6e7c6..17c99e34bf 100644 --- a/source/dnode/vnode/src/meta/metaCache.c +++ b/source/dnode/vnode/src/meta/metaCache.c @@ -476,10 +476,16 @@ int32_t metaGetCachedTableUidList(SMeta* pMeta, tb_uid_t suid, const uint8_t* pK // check both the payload size and selectivity ratio int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int32_t keyLen, void* pPayload, int32_t payloadLen, double selectivityRatio) { if (selectivityRatio > tsSelectivityRatio) { + metaDebug("vgId:%d, suid:%" PRIu64 + " failed to add to uid list cache, due to selectivity ratio %.2f less than threshold %.2f", + TD_VID(pMeta->pVnode), suid, selectivityRatio, tsSelectivityRatio); return TSDB_CODE_SUCCESS; } if (payloadLen > tsTagFilterResCacheSize) { + metaDebug("vgId:%d, suid:%" PRIu64 + " failed to add to uid list cache, due to payload length %d greater than threshold %d", + TD_VID(pMeta->pVnode), suid, payloadLen, tsTagFilterResCacheSize); return TSDB_CODE_SUCCESS; } @@ -506,6 +512,9 @@ int32_t metaUidFilterCachePut(SMeta* pMeta, uint64_t suid, const void* pKey, int // add to cache. taosLRUCacheInsert(pCache, pBuf, sizeof(uint64_t) + keyLen, pPayload, payloadLen, NULL, NULL, TAOS_LRU_PRIORITY_LOW); + metaDebug("vgId:%d, suid:%"PRIu64" list cache added into cache, total:%d, tables:%d", TD_VID(pMeta->pVnode), + suid, (int32_t) taosLRUCacheGetUsage(pCache), taosHashGetSize(pTableEntry)); + return TSDB_CODE_SUCCESS; }