From a55df5e92765efcc74e8f76738e3e0bc1665eba6 Mon Sep 17 00:00:00 2001 From: AlexDuan <417921451@qq.com> Date: Tue, 24 Aug 2021 18:14:14 +0800 Subject: [PATCH] fixed deadlock missspelling and printf replace with log api --- src/common/inc/tglobal.h | 2 +- src/common/src/tglobal.c | 6 +++--- src/query/src/queryMain.c | 6 +++--- src/tsdb/src/tsdbBuffer.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index e53c898718..26f9faecca 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -222,7 +222,7 @@ extern uint32_t curRange; extern char Compressor[]; #endif // long query -extern int8_t tsDeathLockKillQuery; +extern int8_t tsDeadLockKillQuery; typedef struct { char dir[TSDB_FILENAME_LEN]; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index c7725dde08..1677c6b52a 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -277,7 +277,7 @@ char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESS #endif // long query death-lock -int8_t tsDeathLockKillQuery = 0; +int8_t tsDeadLockKillQuery = 0; int32_t (*monStartSystemFp)() = NULL; void (*monStopSystemFp)() = NULL; @@ -1651,8 +1651,8 @@ static void doInitGlobalConfig(void) { #endif // enable kill long query - cfg.option = "deathLockKillQuery"; - cfg.ptr = &tsDeathLockKillQuery; + cfg.option = "deadLockKillQuery"; + cfg.ptr = &tsDeadLockKillQuery; cfg.valType = TAOS_CFG_VTYPE_INT8; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; cfg.minValue = 0; diff --git a/src/query/src/queryMain.c b/src/query/src/queryMain.c index b92a4625f6..77fcdb0825 100644 --- a/src/query/src/queryMain.c +++ b/src/query/src/queryMain.c @@ -239,8 +239,8 @@ int waitMoment(SQInfo* pQInfo){ ms *= 1000; } } - - printf("wait sleep %dms. sql=%s\n", ms, pQInfo->sql); + if(ms == 0) return 0; + qWarn("wait sleep %dms. sql=%s", ms, pQInfo->sql); if(ms < 1000) { taosMsleep(ms); @@ -250,7 +250,7 @@ int waitMoment(SQInfo* pQInfo){ taosMsleep(1000); used_ms += 1000; if(isQueryKilled(pQInfo)){ - printf(" check query is canceled, sleep break... %s\n", pQInfo->sql); + qWarn("check query is canceled, sleep break... %s", pQInfo->sql); break; } } diff --git a/src/tsdb/src/tsdbBuffer.c b/src/tsdb/src/tsdbBuffer.c index be64f9ee1b..3dae2c6f4a 100644 --- a/src/tsdb/src/tsdbBuffer.c +++ b/src/tsdb/src/tsdbBuffer.c @@ -118,7 +118,7 @@ SListNode *tsdbAllocBufBlockFromPool(STsdbRepo *pRepo) { STsdbBufPool *pBufPool = pRepo->pPool; while (POOL_IS_EMPTY(pBufPool)) { - if(tsDeathLockKillQuery) { + if(tsDeadLockKillQuery) { // supply new Block if(tsdbInsertNewBlock(pRepo) > 0) { tsdbWarn("vgId:%d add new elastic block . elasticBlocks=%d totalBlocks=%d", REPO_ID(pRepo), pBufPool->nElasticBlocks, pBufPool->nBufBlocks); -- GitLab