fixed deadlock missspelling and printf replace with log api

This commit is contained in:
AlexDuan 2021-08-24 18:14:14 +08:00
parent 3a1773f565
commit a55df5e927
4 changed files with 8 additions and 8 deletions

View File

@ -222,7 +222,7 @@ extern uint32_t curRange;
extern char Compressor[]; extern char Compressor[];
#endif #endif
// long query // long query
extern int8_t tsDeathLockKillQuery; extern int8_t tsDeadLockKillQuery;
typedef struct { typedef struct {
char dir[TSDB_FILENAME_LEN]; char dir[TSDB_FILENAME_LEN];

View File

@ -277,7 +277,7 @@ char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESS
#endif #endif
// long query death-lock // long query death-lock
int8_t tsDeathLockKillQuery = 0; int8_t tsDeadLockKillQuery = 0;
int32_t (*monStartSystemFp)() = NULL; int32_t (*monStartSystemFp)() = NULL;
void (*monStopSystemFp)() = NULL; void (*monStopSystemFp)() = NULL;
@ -1651,8 +1651,8 @@ static void doInitGlobalConfig(void) {
#endif #endif
// enable kill long query // enable kill long query
cfg.option = "deathLockKillQuery"; cfg.option = "deadLockKillQuery";
cfg.ptr = &tsDeathLockKillQuery; cfg.ptr = &tsDeadLockKillQuery;
cfg.valType = TAOS_CFG_VTYPE_INT8; cfg.valType = TAOS_CFG_VTYPE_INT8;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW;
cfg.minValue = 0; cfg.minValue = 0;

View File

@ -239,8 +239,8 @@ int waitMoment(SQInfo* pQInfo){
ms *= 1000; ms *= 1000;
} }
} }
if(ms == 0) return 0;
printf("wait sleep %dms. sql=%s\n", ms, pQInfo->sql); qWarn("wait sleep %dms. sql=%s", ms, pQInfo->sql);
if(ms < 1000) { if(ms < 1000) {
taosMsleep(ms); taosMsleep(ms);
@ -250,7 +250,7 @@ int waitMoment(SQInfo* pQInfo){
taosMsleep(1000); taosMsleep(1000);
used_ms += 1000; used_ms += 1000;
if(isQueryKilled(pQInfo)){ 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; break;
} }
} }

View File

@ -118,7 +118,7 @@ SListNode *tsdbAllocBufBlockFromPool(STsdbRepo *pRepo) {
STsdbBufPool *pBufPool = pRepo->pPool; STsdbBufPool *pBufPool = pRepo->pPool;
while (POOL_IS_EMPTY(pBufPool)) { while (POOL_IS_EMPTY(pBufPool)) {
if(tsDeathLockKillQuery) { if(tsDeadLockKillQuery) {
// supply new Block // supply new Block
if(tsdbInsertNewBlock(pRepo) > 0) { if(tsdbInsertNewBlock(pRepo) > 0) {
tsdbWarn("vgId:%d add new elastic block . elasticBlocks=%d totalBlocks=%d", REPO_ID(pRepo), pBufPool->nElasticBlocks, pBufPool->nBufBlocks); tsdbWarn("vgId:%d add new elastic block . elasticBlocks=%d totalBlocks=%d", REPO_ID(pRepo), pBufPool->nElasticBlocks, pBufPool->nBufBlocks);