From b90f1f246c5251adfab1a8c0d4a3fff00fc25cc0 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 10 Jun 2022 16:31:33 +0800 Subject: [PATCH] refactor: adjust mnode trace log --- source/dnode/mnode/sdb/src/sdbFile.c | 2 +- source/dnode/mnode/sdb/src/sdbHash.c | 2 ++ source/dnode/mnode/sdb/src/sdbRaw.c | 4 ++++ source/dnode/mnode/sdb/src/sdbRow.c | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/dnode/mnode/sdb/src/sdbFile.c b/source/dnode/mnode/sdb/src/sdbFile.c index f98ecf5343..b32abc3eaa 100644 --- a/source/dnode/mnode/sdb/src/sdbFile.c +++ b/source/dnode/mnode/sdb/src/sdbFile.c @@ -357,7 +357,7 @@ static int32_t sdbWriteFileImp(SSdb *pSdb) { SdbEncodeFp encodeFp = pSdb->encodeFps[i]; if (encodeFp == NULL) continue; - mTrace("write %s to sdb file, total %d rows", sdbTableName(i), sdbGetSize(pSdb, i)); + mDebug("write %s to sdb file, total %d rows", sdbTableName(i), sdbGetSize(pSdb, i)); SHashObj *hash = pSdb->hashObjs[i]; TdThreadRwlock *pLock = &pSdb->locks[i]; diff --git a/source/dnode/mnode/sdb/src/sdbHash.c b/source/dnode/mnode/sdb/src/sdbHash.c index d1b1e31635..71792a2354 100644 --- a/source/dnode/mnode/sdb/src/sdbHash.c +++ b/source/dnode/mnode/sdb/src/sdbHash.c @@ -83,6 +83,7 @@ const char *sdbStatusName(ESdbStatus status) { } void sdbPrintOper(SSdb *pSdb, SSdbRow *pRow, const char *oper) { +#if 0 EKeyType keyType = pSdb->keyTypes[pRow->type]; if (keyType == SDB_KEY_BINARY) { @@ -96,6 +97,7 @@ void sdbPrintOper(SSdb *pSdb, SSdbRow *pRow, const char *oper) { pRow->refCount, oper, pRow->pObj, sdbStatusName(pRow->status)); } else { } +#endif } static SHashObj *sdbGetHash(SSdb *pSdb, int32_t type) { diff --git a/source/dnode/mnode/sdb/src/sdbRaw.c b/source/dnode/mnode/sdb/src/sdbRaw.c index 7720a8e88a..95985cd3d9 100644 --- a/source/dnode/mnode/sdb/src/sdbRaw.c +++ b/source/dnode/mnode/sdb/src/sdbRaw.c @@ -37,13 +37,17 @@ SSdbRaw *sdbAllocRaw(ESdbType type, int8_t sver, int32_t dataLen) { pRaw->sver = sver; pRaw->dataLen = dataLen; +#if 0 mTrace("raw:%p, is created, len:%d table:%s", pRaw, dataLen, sdbTableName(type)); +#endif return pRaw; } void sdbFreeRaw(SSdbRaw *pRaw) { if (pRaw != NULL) { +#if 0 mTrace("raw:%p, is freed", pRaw); +#endif taosMemoryFree(pRaw); } } diff --git a/source/dnode/mnode/sdb/src/sdbRow.c b/source/dnode/mnode/sdb/src/sdbRow.c index e57a6b028b..b362ee3a45 100644 --- a/source/dnode/mnode/sdb/src/sdbRow.c +++ b/source/dnode/mnode/sdb/src/sdbRow.c @@ -23,7 +23,9 @@ SSdbRow *sdbAllocRow(int32_t objSize) { return NULL; } +#if 0 mTrace("row:%p, is created, len:%d", pRow->pObj, objSize); +#endif return pRow; } @@ -45,6 +47,8 @@ void sdbFreeRow(SSdb *pSdb, SSdbRow *pRow, bool callFunc) { sdbPrintOper(pSdb, pRow, "free"); +#if 0 mTrace("row:%p, is freed", pRow->pObj); +#endif taosMemoryFreeClear(pRow); }