diff --git a/source/libs/catalog/src/ctgCache.c b/source/libs/catalog/src/ctgCache.c index 2fe9fef51a53d00c4286e5698bab016c9f6775db..85d2a5c1be921ea9c5564eaca95dce48883d9cc5 100644 --- a/source/libs/catalog/src/ctgCache.c +++ b/source/libs/catalog/src/ctgCache.c @@ -716,7 +716,7 @@ int32_t ctgReadDBCfgFromCache(SCatalog *pCtg, const char* dbFName, SDbCfgInfo* p if (NULL == dbCache) { ctgDebug("db %s not in cache", dbFName); pDbCfg->cfgVersion = -1; - CTG_CACHE_STAT_INC(numOfCfgMiss, 1); + CTG_CACHE_NHIT_INC(CTG_CI_DB_CFG, 1); return TSDB_CODE_SUCCESS; } @@ -730,10 +730,10 @@ int32_t ctgReadDBCfgFromCache(SCatalog *pCtg, const char* dbFName, SDbCfgInfo* p memcpy(pDbCfg, pInfo, sizeof(*pInfo)); taosMemoryFree(pInfo); - CTG_CACHE_STAT_INC(numOfCfgHit, 1); + CTG_CACHE_HIT_INC(CTG_CI_DB_CFG, 1); } else { pDbCfg->cfgVersion = -1; - CTG_CACHE_STAT_INC(numOfCfgMiss, 1); + CTG_CACHE_NHIT_INC(CTG_CI_DB_CFG, 1); } _return: diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index ff13bf160e47321a2b655ff852c3092b48d2895a..0e75e2022bcfff32c8d822a998ff09e3399be8a1 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -50,7 +50,6 @@ typedef struct { int32_t stop; TdThread asyncThread; TdThreadMutex buffMutex; - SRWLatch buffLock; } SLogBuff; typedef struct { @@ -569,7 +568,7 @@ static SLogBuff *taosLogBuffNew(int32_t bufSize) { pLogBuf->minBuffSize = bufSize / 10; pLogBuf->stop = 0; - //if (taosThreadMutexInit(&LOG_BUF_MUTEX(pLogBuf), NULL) < 0) goto _err; + if (taosThreadMutexInit(&LOG_BUF_MUTEX(pLogBuf), NULL) < 0) goto _err; // tsem_init(&(pLogBuf->buffNotEmpty), 0, 0); return pLogBuf; @@ -604,8 +603,7 @@ static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msg if (pLogBuf == NULL || pLogBuf->stop) return -1; - //taosThreadMutexLock(&LOG_BUF_MUTEX(pLogBuf)); - taosWLockLatch(&pLogBuf->buffLock); + taosThreadMutexLock(&LOG_BUF_MUTEX(pLogBuf)); start = LOG_BUF_START(pLogBuf); end = LOG_BUF_END(pLogBuf); @@ -619,8 +617,7 @@ static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msg if (remainSize <= msgLen || ((lostLine > 0) && (remainSize <= (msgLen + tmpBufLen)))) { lostLine++; tsAsyncLogLostLines++; - //taosThreadMutexUnlock(&LOG_BUF_MUTEX(pLogBuf)); - taosWUnLockLatch(&pLogBuf->buffLock); + taosThreadMutexUnlock(&LOG_BUF_MUTEX(pLogBuf)); return -1; } @@ -641,8 +638,7 @@ static int32_t taosPushLogBuffer(SLogBuff *pLogBuf, const char *msg, int32_t msg } */ - //taosThreadMutexUnlock(&LOG_BUF_MUTEX(pLogBuf)); - taosWUnLockLatch(&pLogBuf->buffLock); + taosThreadMutexUnlock(&LOG_BUF_MUTEX(pLogBuf)); return 0; }