enh: adjust log format
This commit is contained in:
parent
5e07b497ce
commit
e314966cb9
|
@ -133,7 +133,7 @@ static int32_t generateWriteSlowLog(STscObj *pTscObj, SRequestObj *pRequest, int
|
|||
cJSON *json = cJSON_CreateObject();
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
if (json == NULL) {
|
||||
tscError("[monitor] cJSON_CreateObject failed");
|
||||
tscError("failed to create monitor json");
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
}
|
||||
char clusterId[32] = {0};
|
||||
|
@ -262,17 +262,17 @@ static void deregisterRequest(SRequestObj *pRequest) {
|
|||
if ((pRequest->pQuery && pRequest->pQuery->pRoot && QUERY_NODE_VNODE_MODIFY_STMT == pRequest->pQuery->pRoot->type &&
|
||||
(0 == ((SVnodeModifyOpStmt *)pRequest->pQuery->pRoot)->sqlNodeType)) ||
|
||||
QUERY_NODE_VNODE_MODIFY_STMT == pRequest->stmtType) {
|
||||
tscDebug("insert duration %" PRId64 "us: parseCost:%" PRId64 "us, ctgCost:%" PRId64 "us, analyseCost:%" PRId64
|
||||
"us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs, pRequest->metric.analyseCostUs,
|
||||
pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
tscDebug("req:0x%" PRIx64 ", insert duration %" PRId64 "us: parseCost:%" PRId64 "us, ctgCost:%" PRId64
|
||||
"us, analyseCost:%" PRId64 "us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
pRequest->self, duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs,
|
||||
pRequest->metric.analyseCostUs, pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
(void)atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration);
|
||||
reqType = SLOW_LOG_TYPE_INSERT;
|
||||
} else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) {
|
||||
tscDebug("query duration %" PRId64 "us: parseCost:%" PRId64 "us, ctgCost:%" PRId64 "us, analyseCost:%" PRId64
|
||||
"us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs, pRequest->metric.analyseCostUs,
|
||||
pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
tscDebug("req:0x%" PRIx64 ", query duration %" PRId64 "us: parseCost:%" PRId64 "us, ctgCost:%" PRId64
|
||||
"us, analyseCost:%" PRId64 "us, planCost:%" PRId64 "us, exec:%" PRId64 "us",
|
||||
pRequest->self, duration, pRequest->metric.parseCostUs, pRequest->metric.ctgCostUs,
|
||||
pRequest->metric.analyseCostUs, pRequest->metric.planCostUs, pRequest->metric.execCostUs);
|
||||
|
||||
(void)atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration);
|
||||
reqType = SLOW_LOG_TYPE_QUERY;
|
||||
|
|
|
@ -548,7 +548,7 @@ static int32_t hbQueryHbRspHandle(SAppHbMgr *pAppHbMgr, SClientHbRsp *pRsp) {
|
|||
struct SCatalog *pCatalog = NULL;
|
||||
int32_t code = catalogGetHandle(pReq->clusterId, &pCatalog);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pReq->clusterId, tstrerror(code));
|
||||
tscWarn("catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", pReq->clusterId, tstrerror(code));
|
||||
} else {
|
||||
hbProcessQueryRspKvs(kvNum, pRsp->info, pCatalog, pAppHbMgr);
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ static int32_t hbAsyncCallBack(void *param, SDataBuf *pMsg, int32_t code) {
|
|||
|
||||
pInst->serverCfg.monitorParas = pRsp.monitorParas;
|
||||
pInst->serverCfg.enableAuditDelete = pRsp.enableAuditDelete;
|
||||
tscDebug("[monitor] paras from hb, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d", pInst->clusterId,
|
||||
tscDebug("monitor paras from hb, clusterId:0x%" PRIx64 ", threshold:%d scope:%d", pInst->clusterId,
|
||||
pRsp.monitorParas.tsSlowLogThreshold, pRsp.monitorParas.tsSlowLogScope);
|
||||
|
||||
if (rspNum) {
|
||||
|
@ -1081,33 +1081,33 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
|
||||
code = hbGetQueryBasicInfo(connKey, req);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("hbGetQueryBasicInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetQueryBasicInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
if (hbParam->reqCnt == 0) {
|
||||
code = catalogGetHandle(hbParam->clusterId, &pCatalog);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = hbGetAppInfo(hbParam->clusterId, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("getAppInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("getAppInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
if (!taosHashGet(clientHbMgr.appHbHash, &hbParam->clusterId, sizeof(hbParam->clusterId))) {
|
||||
code = hbGetExpiredUserInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredUserInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredUserInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
if (clientHbMgr.appHbHash) {
|
||||
code = taosHashPut(clientHbMgr.appHbHash, &hbParam->clusterId, sizeof(uint64_t), NULL, 0);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbQueryHbReqHandle put clusterId failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId,
|
||||
tscWarn("hbQueryHbReqHandle put clusterId failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId,
|
||||
tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
if (2 != atomic_load_8(&hbParam->pAppHbMgr->connHbFlag)) {
|
||||
code = hbGetUserAuthInfo(connKey, hbParam, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetUserAuthInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetUserAuthInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
atomic_store_8(&hbParam->pAppHbMgr->connHbFlag, 1);
|
||||
|
@ -1126,32 +1126,32 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
|
|||
|
||||
code = hbGetExpiredDBInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredDBInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredDBInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
code = hbGetExpiredStbInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredStbInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredStbInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
|
||||
#ifdef TD_ENTERPRISE
|
||||
code = hbGetExpiredViewInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredViewInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredViewInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
#endif
|
||||
code = hbGetExpiredTSMAInfo(connKey, pCatalog, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetExpiredTSMAInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetExpiredTSMAInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
} else {
|
||||
code = hbGetAppInfo(hbParam->clusterId, req);
|
||||
if (TSDB_CODE_SUCCESS != code) {
|
||||
tscWarn("hbGetAppInfo failed, clusterId:%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
tscWarn("hbGetAppInfo failed, clusterId:0x%" PRIx64 ", error:%s", hbParam->clusterId, tstrerror(code));
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1754,14 +1754,14 @@ void updateTargetEpSet(SMsgSendInfo* pSendInfo, STscObj* pTscObj, SRpcMsg* pMsg,
|
|||
SCatalog* pCatalog = NULL;
|
||||
int32_t code = catalogGetHandle(pTscObj->pAppInfo->clusterId, &pCatalog);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscError("fail to get catalog handle, clusterId:%" PRIx64 ", error %s", pTscObj->pAppInfo->clusterId,
|
||||
tscError("fail to get catalog handle, clusterId:0x%" PRIx64 ", error:%s", pTscObj->pAppInfo->clusterId,
|
||||
tstrerror(code));
|
||||
return;
|
||||
}
|
||||
|
||||
code = catalogUpdateVgEpSet(pCatalog, pSendInfo->target.dbFName, pSendInfo->target.vgId, pEpSet);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
tscError("fail to update catalog vg epset, clusterId:%" PRIx64 ", error %s", pTscObj->pAppInfo->clusterId,
|
||||
tscError("fail to update catalog vg epset, clusterId:0x%" PRIx64 ", error:%s", pTscObj->pAppInfo->clusterId,
|
||||
tstrerror(code));
|
||||
return;
|
||||
}
|
||||
|
@ -2983,7 +2983,7 @@ TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t s
|
|||
}
|
||||
taosMemoryFree(param);
|
||||
|
||||
tscDebug("connObj:0x%" PRIx64 ", taos_query end with sql:%s", *(int64_t*)taos, sql);
|
||||
tscDebug("connObj:0x%" PRIx64 ", res:%p created, taos_query end with sql:%s", *(int64_t*)taos, pRequest, sql);
|
||||
|
||||
return pRequest;
|
||||
}
|
||||
|
|
|
@ -535,7 +535,7 @@ void taos_free_result(TAOS_RES *res) {
|
|||
return;
|
||||
}
|
||||
|
||||
tscTrace("taos free res %p", res);
|
||||
tscTrace("res:%p, will be freed", res);
|
||||
|
||||
if (TD_RES_QUERY(res)) {
|
||||
SRequestObj *pRequest = (SRequestObj *)res;
|
||||
|
|
|
@ -97,7 +97,7 @@ static void monitorFreeSlowLogDataEx(void* paras) {
|
|||
static SAppInstInfo* getAppInstByClusterId(int64_t clusterId) {
|
||||
void* p = taosHashGet(appInfo.pInstMapByClusterId, &clusterId, LONG_BYTES);
|
||||
if (p == NULL) {
|
||||
tscError("failed to get app inst, clusterId:%" PRIx64, clusterId);
|
||||
tscError("failed to get app inst, clusterId:0x%" PRIx64, clusterId);
|
||||
return NULL;
|
||||
}
|
||||
return *(SAppInstInfo**)p;
|
||||
|
@ -114,7 +114,7 @@ static int32_t monitorReportAsyncCB(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
if (param != NULL) {
|
||||
MonitorSlowLogData* p = (MonitorSlowLogData*)param;
|
||||
if (code != 0) {
|
||||
tscError("failed to send slow log:%s, clusterId:%" PRIx64, p->data, p->clusterId);
|
||||
tscError("failed to send slow log:%s, clusterId:0x%" PRIx64, p->data, p->clusterId);
|
||||
}
|
||||
MonitorSlowLogData tmp = {.clusterId = p->clusterId,
|
||||
.type = p->type,
|
||||
|
@ -241,7 +241,7 @@ void monitorCreateClient(int64_t clusterId) {
|
|||
MonitorClient* pMonitor = NULL;
|
||||
taosWLockLatch(&monitorLock);
|
||||
if (taosHashGet(monitorCounterHash, &clusterId, LONG_BYTES) == NULL) {
|
||||
tscInfo("[monitor] monitorCreateClient for %" PRIx64, clusterId);
|
||||
tscInfo("clusterId:0x%" PRIx64 ", create monitor", clusterId);
|
||||
pMonitor = taosMemoryCalloc(1, sizeof(MonitorClient));
|
||||
if (pMonitor == NULL) {
|
||||
tscError("failed to create monitor client");
|
||||
|
@ -293,7 +293,7 @@ void monitorCreateClient(int64_t clusterId) {
|
|||
tscError("failed to start timer");
|
||||
goto fail;
|
||||
}
|
||||
tscInfo("[monitor] monitorCreateClient for %" PRIx64 "finished %p.", clusterId, pMonitor);
|
||||
tscInfo("clusterId:0x%" PRIx64 ", create monitor finished, montitor:%p", clusterId, pMonitor);
|
||||
}
|
||||
taosWUnLockLatch(&monitorLock);
|
||||
|
||||
|
@ -331,7 +331,7 @@ void monitorCreateClientCounter(int64_t clusterId, const char* name, const char*
|
|||
}
|
||||
goto end;
|
||||
}
|
||||
tscInfo("[monitor] monitorCreateClientCounter %" PRIx64 "(%p):%s : %p.", pMonitor->clusterId, pMonitor, name,
|
||||
tscInfo("clusterId:0x%" PRIx64 ", monitor:%p, create counter:%s:%p", pMonitor->clusterId, pMonitor, name,
|
||||
newCounter);
|
||||
|
||||
end:
|
||||
|
@ -347,21 +347,21 @@ void monitorCounterInc(int64_t clusterId, const char* counterName, const char**
|
|||
|
||||
MonitorClient** ppMonitor = (MonitorClient**)taosHashGet(monitorCounterHash, &clusterId, LONG_BYTES);
|
||||
if (ppMonitor == NULL || *ppMonitor == NULL) {
|
||||
tscError("monitorCounterInc not found pMonitor %" PRId64, clusterId);
|
||||
tscError("clusterId:0x%" PRId64 ", monitor not found", clusterId);
|
||||
goto end;
|
||||
}
|
||||
|
||||
MonitorClient* pMonitor = *ppMonitor;
|
||||
taos_counter_t** ppCounter = (taos_counter_t**)taosHashGet(pMonitor->counters, counterName, strlen(counterName));
|
||||
if (ppCounter == NULL || *ppCounter == NULL) {
|
||||
tscError("monitorCounterInc not found pCounter %" PRIx64 ":%s.", clusterId, counterName);
|
||||
tscError("clusterId:0x%" PRIx64 ", monitor:%p counter:%s not found", clusterId, pMonitor, counterName);
|
||||
goto end;
|
||||
}
|
||||
if (taos_counter_inc(*ppCounter, label_values) != 0) {
|
||||
tscError("monitorCounterInc failed to inc %" PRIx64 ":%s.", clusterId, counterName);
|
||||
tscError("clusterId:0x%" PRIx64 ", monitor:%p counter:%s inc failed", clusterId, pMonitor, counterName);
|
||||
goto end;
|
||||
}
|
||||
tscDebug("[monitor] monitorCounterInc %" PRIx64 "(%p):%s", pMonitor->clusterId, pMonitor, counterName);
|
||||
tscDebug("clusterId:0x%" PRIx64 ", monitor:%p, counter:%s inc", pMonitor->clusterId, pMonitor, counterName);
|
||||
|
||||
end:
|
||||
taosWUnLockLatch(&monitorLock);
|
||||
|
@ -379,11 +379,11 @@ static void monitorWriteSlowLog2File(MonitorSlowLogData* slowLogData, char* tmpP
|
|||
char path[PATH_MAX] = {0};
|
||||
char clusterId[32] = {0};
|
||||
if (snprintf(clusterId, sizeof(clusterId), "%" PRIx64, slowLogData->clusterId) < 0) {
|
||||
tscError("failed to generate clusterId:%" PRIx64, slowLogData->clusterId);
|
||||
tscError("failed to generate clusterId:0x%" PRIx64, slowLogData->clusterId);
|
||||
return;
|
||||
}
|
||||
taosGetTmpfilePath(tmpPath, clusterId, path);
|
||||
tscInfo("[monitor] create slow log file:%s", path);
|
||||
tscInfo("monitor create slow log file:%s", path);
|
||||
pFile = taosOpenFile(path, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND | TD_FILE_READ | TD_FILE_TRUNC);
|
||||
if (pFile == NULL) {
|
||||
tscError("failed to open file:%s since %d", path, terrno);
|
||||
|
@ -404,7 +404,7 @@ static void monitorWriteSlowLog2File(MonitorSlowLogData* slowLogData, char* tmpP
|
|||
pClient->offset = 0;
|
||||
pClient->pFile = pFile;
|
||||
if (taosHashPut(monitorSlowLogHash, &slowLogData->clusterId, LONG_BYTES, &pClient, POINTER_BYTES) != 0) {
|
||||
tscError("failed to put clusterId:%" PRId64 " to hash table", slowLogData->clusterId);
|
||||
tscError("failed to put clusterId:0x%" PRIx64 " to hash table", slowLogData->clusterId);
|
||||
int32_t ret = taosCloseFile(&pFile);
|
||||
if (ret != 0) {
|
||||
tscError("failed to close file:%p ret:%d", pFile, ret);
|
||||
|
@ -428,11 +428,11 @@ static void monitorWriteSlowLog2File(MonitorSlowLogData* slowLogData, char* tmpP
|
|||
if (taosWriteFile(pFile, slowLogData->data, strlen(slowLogData->data) + 1) < 0) {
|
||||
tscError("failed to write len to file:%p since %s", pFile, terrstr());
|
||||
}
|
||||
tscDebug("[monitor] write slow log to file:%p, clusterId:%" PRIx64, pFile, slowLogData->clusterId);
|
||||
tscDebug("monitor write slow log to file:%p, clusterId:0x%" PRIx64, pFile, slowLogData->clusterId);
|
||||
}
|
||||
|
||||
static char* readFile(TdFilePtr pFile, int64_t* offset, int64_t size) {
|
||||
tscDebug("[monitor] readFile slow begin pFile:%p, offset:%" PRId64 ", size:%" PRId64, pFile, *offset, size);
|
||||
tscDebug("monitor readFile slow begin pFile:%p, offset:%" PRId64 ", size:%" PRId64, pFile, *offset, size);
|
||||
if (taosLSeekFile(pFile, *offset, SEEK_SET) < 0) {
|
||||
tscError("failed to seek file:%p code: %d", pFile, terrno);
|
||||
return NULL;
|
||||
|
@ -481,7 +481,7 @@ static char* readFile(TdFilePtr pFile, int64_t* offset, int64_t size) {
|
|||
*offset += (len + 1);
|
||||
}
|
||||
|
||||
tscDebug("[monitor] readFile slow log end, data:%s, offset:%" PRId64, pCont, *offset);
|
||||
tscDebug("monitor readFile slow log end, data:%s, offset:%" PRId64, pCont, *offset);
|
||||
return pCont;
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ static int32_t monitorReadSend(int64_t clusterId, TdFilePtr pFile, int64_t* offs
|
|||
SLOW_LOG_QUEUE_TYPE type, char* fileName) {
|
||||
SAppInstInfo* pInst = getAppInstByClusterId(clusterId);
|
||||
if (pInst == NULL) {
|
||||
tscError("failed to get app instance by clusterId:%" PRId64, clusterId);
|
||||
tscError("failed to get app instance by clusterId:0x%" PRIx64, clusterId);
|
||||
if (taosCloseFile(&pFile) != 0) {
|
||||
tscError("failed to close file:%p", pFile);
|
||||
}
|
||||
|
@ -546,13 +546,13 @@ static void monitorSendSlowLogAtBeginning(int64_t clusterId, char** fileName, Td
|
|||
int64_t size = getFileSize(*fileName);
|
||||
if (size <= offset) {
|
||||
processFileInTheEnd(pFile, *fileName);
|
||||
tscDebug("[monitor] monitorSendSlowLogAtBeginning delete file:%s", *fileName);
|
||||
tscDebug("monitor delete file:%s", *fileName);
|
||||
} else {
|
||||
int32_t code = monitorReadSend(clusterId, pFile, &offset, size, SLOW_LOG_READ_BEGINNIG, *fileName);
|
||||
if (code == 0) {
|
||||
tscDebug("[monitor] monitorSendSlowLogAtBeginning send slow log succ, clusterId:%" PRId64, clusterId);
|
||||
tscDebug("monitor send slow log succ, clusterId:0x%" PRIx64, clusterId);
|
||||
} else {
|
||||
tscError("[monitor] monitorSendSlowLogAtBeginning send slow log failed, clusterId:%" PRId64 ",ret:%d", clusterId,
|
||||
tscError("monitor send slow log failed, clusterId:0x%" PRIx64 ",ret:%d", clusterId,
|
||||
code);
|
||||
}
|
||||
*fileName = NULL;
|
||||
|
@ -562,12 +562,12 @@ static void monitorSendSlowLogAtBeginning(int64_t clusterId, char** fileName, Td
|
|||
static void monitorSendSlowLogAtRunning(int64_t clusterId) {
|
||||
void* tmp = taosHashGet(monitorSlowLogHash, &clusterId, LONG_BYTES);
|
||||
if (tmp == NULL) {
|
||||
tscError("failed to get slow log client by clusterId:%" PRId64, clusterId);
|
||||
tscError("failed to get slow log client by clusterId:0x%" PRIx64, clusterId);
|
||||
return;
|
||||
}
|
||||
SlowLogClient* pClient = (*(SlowLogClient**)tmp);
|
||||
if (pClient == NULL) {
|
||||
tscError("failed to get slow log client by clusterId:%" PRId64, clusterId);
|
||||
tscError("failed to get slow log client by clusterId:0x%" PRIx64, clusterId);
|
||||
return;
|
||||
}
|
||||
int64_t size = getFileSize(pClient->path);
|
||||
|
@ -575,11 +575,11 @@ static void monitorSendSlowLogAtRunning(int64_t clusterId) {
|
|||
if (taosFtruncateFile(pClient->pFile, 0) < 0) {
|
||||
tscError("failed to truncate file:%p code: %d", pClient->pFile, terrno);
|
||||
}
|
||||
tscDebug("[monitor] monitorSendSlowLogAtRunning truncate file to 0 file:%p", pClient->pFile);
|
||||
tscDebug("monitor truncate file to 0 file:%p", pClient->pFile);
|
||||
pClient->offset = 0;
|
||||
} else {
|
||||
int32_t code = monitorReadSend(clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_RUNNING, NULL);
|
||||
tscDebug("[monitor] monitorSendSlowLogAtRunning send slow log clusterId:%" PRId64 ",ret:%d", clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ",ret:%d", clusterId, code);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -596,13 +596,13 @@ static bool monitorSendSlowLogAtQuit(int64_t clusterId) {
|
|||
if (size <= pClient->offset) {
|
||||
processFileInTheEnd(pClient->pFile, pClient->path);
|
||||
pClient->pFile = NULL;
|
||||
tscInfo("[monitor] monitorSendSlowLogAtQuit remove file:%s", pClient->path);
|
||||
tscInfo("monitor remove file:%s", pClient->path);
|
||||
if ((--quitCnt) == 0) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
int32_t code = monitorReadSend(clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_QUIT, NULL);
|
||||
tscDebug("[monitor] monitorSendSlowLogAtQuit send slow log clusterId:%" PRId64 ",ret:%d", clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ",ret:%d", clusterId, code);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -620,7 +620,7 @@ static void monitorSendAllSlowLogAtQuit() {
|
|||
} else if (pClient->offset == 0) {
|
||||
int64_t* clusterId = (int64_t*)taosHashGetKey(pIter, NULL);
|
||||
int32_t code = monitorReadSend(*clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_QUIT, NULL);
|
||||
tscDebug("[monitor] monitorSendAllSlowLogAtQuit send slow log clusterId:%" PRId64 ",ret:%d", *clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ",ret:%d", *clusterId, code);
|
||||
if (code == 0) {
|
||||
quitCnt++;
|
||||
}
|
||||
|
@ -669,7 +669,7 @@ static void monitorSendAllSlowLog() {
|
|||
int64_t size = getFileSize(pClient->path);
|
||||
if (size <= 0) {
|
||||
if (size < 0) {
|
||||
tscError("[monitor] monitorSendAllSlowLog failed to get file size:%s, err:%d", pClient->path, errno);
|
||||
tscError("monitor failed to get file size:%s, err:%d", pClient->path, errno);
|
||||
if (errno == ENOENT) {
|
||||
processFileRemoved(pClient);
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ static void monitorSendAllSlowLog() {
|
|||
continue;
|
||||
}
|
||||
int32_t code = monitorReadSend(*clusterId, pClient->pFile, &pClient->offset, size, SLOW_LOG_READ_RUNNING, NULL);
|
||||
tscDebug("[monitor] monitorSendAllSlowLog send slow log clusterId:%" PRId64 ",ret:%d", *clusterId, code);
|
||||
tscDebug("monitor send slow log clusterId:0x%" PRIx64 ",ret:%d", *clusterId, code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ static void monitorSendAllSlowLogFromTempDir(int64_t clusterId) {
|
|||
SAppInstInfo* pInst = getAppInstByClusterId((int64_t)clusterId);
|
||||
|
||||
if (pInst == NULL || !pInst->serverCfg.monitorParas.tsEnableMonitor) {
|
||||
tscInfo("[monitor] monitor is disabled, skip send slow log");
|
||||
tscInfo("monitor is disabled, skip send slow log");
|
||||
return;
|
||||
}
|
||||
char namePrefix[PATH_MAX] = {0};
|
||||
|
@ -837,7 +837,7 @@ static void tscMonitorStop() {
|
|||
int32_t monitorInit() {
|
||||
int32_t code = 0;
|
||||
|
||||
tscInfo("[monitor] tscMonitor init");
|
||||
tscInfo("monitor init");
|
||||
monitorCounterHash =
|
||||
(SHashObj*)taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_ENTRY_LOCK);
|
||||
if (monitorCounterHash == NULL) {
|
||||
|
@ -887,7 +887,7 @@ int32_t monitorInit() {
|
|||
}
|
||||
|
||||
void monitorClose() {
|
||||
tscInfo("[monitor] tscMonitor close");
|
||||
tscInfo("monitor close");
|
||||
taosWLockLatch(&monitorLock);
|
||||
atomic_store_32(&monitorFlag, 1);
|
||||
tscMonitorStop();
|
||||
|
@ -907,17 +907,17 @@ int32_t monitorPutData2MonitorQueue(MonitorSlowLogData data) {
|
|||
MonitorSlowLogData* slowLogData = NULL;
|
||||
|
||||
if (atomic_load_32(&monitorFlag) == 1) {
|
||||
tscError("[monitor] slow log thread is exiting");
|
||||
tscError("monitor slow log thread is exiting");
|
||||
return -1;
|
||||
}
|
||||
|
||||
code = taosAllocateQitem(sizeof(MonitorSlowLogData), DEF_QITEM, 0, (void**)&slowLogData);
|
||||
if (code) {
|
||||
tscError("[monitor] failed to allocate slow log data");
|
||||
tscError("monitor failed to allocate slow log data");
|
||||
return code;
|
||||
}
|
||||
*slowLogData = data;
|
||||
tscDebug("[monitor] write slow log to queue, clusterId:%" PRIx64 " type:%s, data:%s", slowLogData->clusterId,
|
||||
tscDebug("monitor write slow log to queue, clusterId:0x%" PRIx64 " type:%s, data:%s", slowLogData->clusterId,
|
||||
queueTypeStr[slowLogData->type], slowLogData->data);
|
||||
if (taosWriteQitem(monitorQueue, slowLogData) == 0) {
|
||||
if (tsem2_post(&monitorSem) != 0) {
|
||||
|
|
|
@ -123,7 +123,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
}
|
||||
|
||||
for (int32_t i = 0; i < connectRsp.epSet.numOfEps; ++i) {
|
||||
tscDebug("0x%" PRIx64 " epSet.fqdn[%d]:%s port:%d, connObj:0x%" PRIx64, pRequest->requestId, i,
|
||||
tscDebug("QID:0x%" PRIx64 " epSet.fqdn[%d]:%s port:%d, connObj:0x%" PRIx64, pRequest->requestId, i,
|
||||
connectRsp.epSet.eps[i].fqdn, connectRsp.epSet.eps[i].port, pTscObj->id);
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
pTscObj->pAppInfo->clusterId = connectRsp.clusterId;
|
||||
pTscObj->pAppInfo->serverCfg.monitorParas = connectRsp.monitorParas;
|
||||
pTscObj->pAppInfo->serverCfg.enableAuditDelete = connectRsp.enableAuditDelete;
|
||||
tscDebug("[monitor] paras from connect rsp, clusterId:%" PRIx64 " monitorParas threshold:%d scope:%d",
|
||||
tscDebug("monitor paras from connect rsp, clusterId:0x%" PRIx64 ", threshold:%d scope:%d",
|
||||
connectRsp.clusterId, connectRsp.monitorParas.tsSlowLogThreshold, connectRsp.monitorParas.tsSlowLogScope);
|
||||
lastClusterId = connectRsp.clusterId;
|
||||
|
||||
|
@ -164,7 +164,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
SAppHbMgr* pAppHbMgr = taosArrayGetP(clientHbMgr.appHbMgrs, pTscObj->appHbMgrIdx);
|
||||
if (pAppHbMgr) {
|
||||
if (hbRegisterConn(pAppHbMgr, pTscObj->id, connectRsp.clusterId, connectRsp.connType) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to register conn to hbMgr", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 " failed to register conn to hbMgr", pRequest->requestId);
|
||||
}
|
||||
} else {
|
||||
(void)taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||
|
@ -173,7 +173,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
}
|
||||
(void)taosThreadMutexUnlock(&clientHbMgr.lock);
|
||||
|
||||
tscDebug("0x%" PRIx64 " clusterId:%" PRId64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId,
|
||||
tscDebug("QID:0x%" PRIx64 " clusterId:0x%" PRIx64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId,
|
||||
pTscObj->pAppInfo->numOfConns);
|
||||
|
||||
End:
|
||||
|
@ -229,11 +229,11 @@ int32_t processCreateDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
char dbFName[TSDB_DB_FNAME_LEN];
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_INFORMATION_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 " failed to refresh db vg info", pRequest->requestId);
|
||||
}
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_PERFORMANCE_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 " failed to refresh db vg info", pRequest->requestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
TSDB_CODE_MND_DB_IN_DROPPING == code) {
|
||||
SUseDbRsp usedbRsp = {0};
|
||||
if (tDeserializeSUseDbRsp(pMsg->pData, pMsg->len, &usedbRsp) != 0) {
|
||||
tscError("0x%" PRIx64 " deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 " deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
}
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
|
||||
|
@ -262,11 +262,11 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
int64_t clusterId = pRequest->pTscObj->pAppInfo->clusterId;
|
||||
int32_t code1 = catalogGetHandle(clusterId, &pCatalog);
|
||||
if (code1 != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("0x%" PRIx64 "catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pRequest->requestId, clusterId,
|
||||
tscWarn("QID:0x%" PRIx64 "catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", pRequest->requestId, clusterId,
|
||||
tstrerror(code1));
|
||||
} else {
|
||||
if (catalogRemoveDB(pCatalog, usedbRsp.db, usedbRsp.uid) != 0) {
|
||||
tscError("0x%" PRIx64 "catalogRemoveDB failed, db:%s, uid:%" PRId64, pRequest->requestId, usedbRsp.db,
|
||||
tscError("QID:0x%" PRIx64 "catalogRemoveDB failed, db:%s, uid:%" PRId64, pRequest->requestId, usedbRsp.db,
|
||||
usedbRsp.uid);
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
SUseDbRsp usedbRsp = {0};
|
||||
if (tDeserializeSUseDbRsp(pMsg->pData, pMsg->len, &usedbRsp) != 0) {
|
||||
tscError("0x%" PRIx64 " deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 " deserialize SUseDbRsp failed", pRequest->requestId);
|
||||
}
|
||||
|
||||
if (strlen(usedbRsp.db) == 0) {
|
||||
|
@ -321,7 +321,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
SName name = {0};
|
||||
if (tNameFromString(&name, usedbRsp.db, T_NAME_ACCT | T_NAME_DB) != TSDB_CODE_SUCCESS) {
|
||||
tscError("0x%" PRIx64 " failed to parse db name:%s", pRequest->requestId, usedbRsp.db);
|
||||
tscError("QID:0x%" PRIx64 " failed to parse db name:%s", pRequest->requestId, usedbRsp.db);
|
||||
}
|
||||
|
||||
SUseDbOutput output = {0};
|
||||
|
@ -330,17 +330,17 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
terrno = code;
|
||||
if (output.dbVgroup) taosHashCleanup(output.dbVgroup->vgHash);
|
||||
|
||||
tscError("0x%" PRIx64 " failed to build use db output since %s", pRequest->requestId, terrstr());
|
||||
tscError("QID:0x%" PRIx64 " failed to build use db output since %s", pRequest->requestId, terrstr());
|
||||
} else if (output.dbVgroup && output.dbVgroup->vgHash) {
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
|
||||
int32_t code1 = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
|
||||
if (code1 != TSDB_CODE_SUCCESS) {
|
||||
tscWarn("catalogGetHandle failed, clusterId:%" PRIx64 ", error:%s", pRequest->pTscObj->pAppInfo->clusterId,
|
||||
tscWarn("catalogGetHandle failed, clusterId:0x%" PRIx64 ", error:%s", pRequest->pTscObj->pAppInfo->clusterId,
|
||||
tstrerror(code1));
|
||||
} else {
|
||||
if (catalogUpdateDBVgInfo(pCatalog, output.db, output.dbId, output.dbVgroup) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to update db vg info, db:%s, dbId:%" PRId64, pRequest->requestId, output.db,
|
||||
tscError("QID:0x%" PRIx64 " failed to update db vg info, db:%s, dbId:%" PRId64, pRequest->requestId, output.db,
|
||||
output.dbId);
|
||||
}
|
||||
output.dbVgroup = NULL;
|
||||
|
@ -352,7 +352,7 @@ int32_t processUseDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
|
||||
char db[TSDB_DB_NAME_LEN] = {0};
|
||||
if (tNameGetDbName(&name, db) != TSDB_CODE_SUCCESS) {
|
||||
tscError("0x%" PRIx64 " failed to get db name since %s", pRequest->requestId, tstrerror(code));
|
||||
tscError("QID:0x%" PRIx64 " failed to get db name since %s", pRequest->requestId, tstrerror(code));
|
||||
}
|
||||
|
||||
setConnectionDB(pRequest->pTscObj, db);
|
||||
|
@ -434,13 +434,13 @@ int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
} else {
|
||||
SDropDbRsp dropdbRsp = {0};
|
||||
if (tDeserializeSDropDbRsp(pMsg->pData, pMsg->len, &dropdbRsp) != 0) {
|
||||
tscError("0x%" PRIx64 " deserialize SDropDbRsp failed", pRequest->requestId);
|
||||
tscError("QID:0x%" PRIx64 " deserialize SDropDbRsp failed", pRequest->requestId);
|
||||
}
|
||||
struct SCatalog* pCatalog = NULL;
|
||||
code = catalogGetHandle(pRequest->pTscObj->pAppInfo->clusterId, &pCatalog);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
if (catalogRemoveDB(pCatalog, dropdbRsp.db, dropdbRsp.uid) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to remove db:%s", pRequest->requestId, dropdbRsp.db);
|
||||
tscError("QID:0x%" PRIx64 " failed to remove db:%s", pRequest->requestId, dropdbRsp.db);
|
||||
}
|
||||
STscObj* pTscObj = pRequest->pTscObj;
|
||||
|
||||
|
@ -451,11 +451,11 @@ int32_t processDropDbRsp(void* param, SDataBuf* pMsg, int32_t code) {
|
|||
char dbFName[TSDB_DB_FNAME_LEN] = {0};
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_INFORMATION_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != TSDB_CODE_SUCCESS) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
tscError("QID:0x%" PRIx64 " failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
}
|
||||
(void)snprintf(dbFName, sizeof(dbFName) - 1, "%d.%s", pTscObj->acctId, TSDB_PERFORMANCE_SCHEMA_DB);
|
||||
if (catalogRefreshDBVgInfo(pCatalog, &conn, dbFName) != 0) {
|
||||
tscError("0x%" PRIx64 " failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
tscError("QID:0x%" PRIx64 " failed to refresh db vg info, db:%s", pRequest->requestId, dbFName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
|||
auditSetDnodeId(pCfg->dnodeId);
|
||||
code = dmWriteEps(pMgmt->pData);
|
||||
if (code != 0) {
|
||||
dInfo("failed to set local info, dnodeId:%d clusterId:%" PRId64 " reason:%s", pCfg->dnodeId, pCfg->clusterId,
|
||||
dInfo("failed to set local info, dnodeId:%d clusterId:0x%" PRIx64 " reason:%s", pCfg->dnodeId, pCfg->clusterId,
|
||||
tstrerror(code));
|
||||
}
|
||||
(void)taosThreadRwlockUnlock(&pMgmt->pData->lock);
|
||||
|
|
|
@ -34,7 +34,7 @@ static int32_t mmRequire(const SMgmtInputOpt *pInput, bool *required) {
|
|||
if (!option.deploy) {
|
||||
*required = mmDeployRequired(pInput);
|
||||
if (*required) {
|
||||
dInfo("deploy mnode required. dnodeId:%d<=0, clusterId:%" PRId64 "<=0, localEp:%s==firstEp",
|
||||
dInfo("deploy mnode required. dnodeId:%d<=0, clusterId:0x%" PRIx64 "<=0, localEp:%s==firstEp",
|
||||
pInput->pData->dnodeId, pInput->pData->clusterId, tsLocalEp);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -2835,7 +2835,7 @@ int32_t mndProcessConsensusInTmr(SRpcMsg *pMsg) {
|
|||
if (taosArrayGetSize(pInfo->pTaskList) == 0) {
|
||||
mndClearConsensusRspEntry(pInfo);
|
||||
if (streamId == -1) {
|
||||
mError("streamId is -1, streamId:%" PRIx64" in consensus-checkpointId hashMap, cont", pInfo->streamId);
|
||||
mError("streamId is -1, streamId:%" PRIx64 " in consensus-checkpointId hashMap, cont", pInfo->streamId);
|
||||
}
|
||||
|
||||
void *p = taosArrayPush(pStreamList, &streamId);
|
||||
|
|
|
@ -249,14 +249,14 @@ int32_t tsdbTFileObjRef(STFileObj *fobj) {
|
|||
(void)taosThreadMutexLock(&fobj->mutex);
|
||||
|
||||
if (fobj->ref <= 0 || fobj->state != TSDB_FSTATE_LIVE) {
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, fobj->ref);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, fobj->ref);
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
nRef = ++fobj->ref;
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbTrace("ref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("ref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -266,11 +266,11 @@ int32_t tsdbTFileObjUnref(STFileObj *fobj) {
|
|||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
|
||||
if (nRef < 0) {
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
tsdbTrace("unref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("unref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
if (nRef == 0) {
|
||||
if (fobj->state == TSDB_FSTATE_DEAD) {
|
||||
tsdbRemoveFile(fobj->fname);
|
||||
|
@ -335,14 +335,14 @@ static void tsdbTFileObjRemoveLC(STFileObj *fobj, bool remove_all) {
|
|||
int32_t tsdbTFileObjRemove(STFileObj *fobj) {
|
||||
(void)taosThreadMutexLock(&fobj->mutex);
|
||||
if (fobj->state != TSDB_FSTATE_LIVE || fobj->ref <= 0) {
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, fobj->ref);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, fobj->ref);
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
fobj->state = TSDB_FSTATE_DEAD;
|
||||
int32_t nRef = --fobj->ref;
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
if (nRef == 0) {
|
||||
tsdbTFileObjRemoveLC(fobj, true);
|
||||
taosMemoryFree(fobj);
|
||||
|
@ -355,14 +355,14 @@ int32_t tsdbTFileObjRemoveUpdateLC(STFileObj *fobj) {
|
|||
|
||||
if (fobj->state != TSDB_FSTATE_LIVE || fobj->ref <= 0) {
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbError("file %s, fobj:%p ref %d", fobj->fname, fobj, fobj->ref);
|
||||
tsdbError("file %s, fobj:%p ref:%d", fobj->fname, fobj, fobj->ref);
|
||||
return TSDB_CODE_FAILED;
|
||||
}
|
||||
|
||||
fobj->state = TSDB_FSTATE_DEAD;
|
||||
int32_t nRef = --fobj->ref;
|
||||
(void)taosThreadMutexUnlock(&fobj->mutex);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref %d", fobj->fname, fobj, nRef);
|
||||
tsdbTrace("remove unref file %s, fobj:%p ref:%d", fobj->fname, fobj, nRef);
|
||||
if (nRef == 0) {
|
||||
tsdbTFileObjRemoveLC(fobj, false);
|
||||
taosMemoryFree(fobj);
|
||||
|
|
|
@ -292,7 +292,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SSDataBlock* pBlock) {
|
|||
SqlFunctionCtx* pCtx = pOperator->exprSupp.pCtx;
|
||||
int32_t numOfGroupCols = taosArrayGetSize(pInfo->pGroupCols);
|
||||
// if (type == TSDB_DATA_TYPE_FLOAT || type == TSDB_DATA_TYPE_DOUBLE) {
|
||||
// qError("QInfo:0x%"PRIx64" group by not supported on double/float columns, abort", GET_TASKID(pRuntimeEnv));
|
||||
// qError("QInfo:0x%"PRIx64 " group by not supported on double/float columns, abort", GET_TASKID(pRuntimeEnv));
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
|
|
@ -5193,7 +5193,7 @@ static int32_t doTagScanFromMetaEntryNext(SOperatorInfo* pOperator, SSDataBlock*
|
|||
setOperatorCompleted(pOperator);
|
||||
}
|
||||
|
||||
// qDebug("QInfo:0x%"PRIx64" create tag values results completed, rows:%d", GET_TASKID(pRuntimeEnv), count);
|
||||
// qDebug("QInfo:0x%"PRIx64 " create tag values results completed, rows:%d", GET_TASKID(pRuntimeEnv), count);
|
||||
if (pOperator->status == OP_EXEC_DONE) {
|
||||
setTaskStatus(pTaskInfo, TASK_COMPLETED);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "trpc.h"
|
||||
|
||||
FORCE_INLINE int32_t schAcquireJob(int64_t refId, SSchJob **ppJob) {
|
||||
qTrace("sch acquire jobId:0x%" PRIx64, refId);
|
||||
qTrace("jobId:0x%" PRIx64 ", sch acquire", refId);
|
||||
*ppJob = (SSchJob *)taosAcquireRef(schMgmt.jobRef, refId);
|
||||
if (NULL == *ppJob) {
|
||||
return terrno;
|
||||
|
@ -37,7 +37,7 @@ FORCE_INLINE int32_t schReleaseJob(int64_t refId) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
qTrace("sch release jobId:0x%" PRIx64, refId);
|
||||
qTrace("jobId:0x%" PRIx64 ", sch release", refId);
|
||||
return taosReleaseRef(schMgmt.jobRef, refId);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ FORCE_INLINE int32_t schReleaseJobEx(int64_t refId, int32_t *released) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
qTrace("sch release ex jobId:0x%" PRIx64, refId);
|
||||
qTrace("jobId:0x%" PRIx64 ", sch release ex", refId);
|
||||
return taosReleaseRefEx(schMgmt.jobRef, refId, released);
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ int32_t schRemoveHbConnection(SSchJob *pJob, SSchTask *pTask, SQueryNodeEpId *ep
|
|||
SSchHbTrans *hb = taosHashGet(schMgmt.hbConnections, epId, sizeof(SQueryNodeEpId));
|
||||
if (NULL == hb) {
|
||||
SCH_UNLOCK(SCH_WRITE, &schMgmt.hbLock);
|
||||
SCH_TASK_ELOG("nodeId %d fqdn %s port %d not in hb connections", epId->nodeId, epId->ep.fqdn, epId->ep.port);
|
||||
SCH_TASK_ELOG("nodeId:%d fqdn:%s port:%d not in hb connections", epId->nodeId, epId->ep.fqdn, epId->ep.port);
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ static int32_t doAppendPullOverBlock(SStreamTask* pTask, int32_t* pNumOfBlocks,
|
|||
pTask->info.selfChildId, pRetrieveBlock->reqId);
|
||||
} else {
|
||||
code = terrno;
|
||||
stError("s-task:%s failed to append pull over block for retrieve data, QID:0x%" PRIx64" code:%s", pTask->id.idStr,
|
||||
stError("s-task:%s failed to append pull over block for retrieve data, QID:0x%" PRIx64 " code:%s", pTask->id.idStr,
|
||||
pRetrieveBlock->reqId, tstrerror(code));
|
||||
}
|
||||
|
||||
|
|
|
@ -2922,12 +2922,12 @@ void syncNodeLogConfigInfo(SSyncNode* ths, SSyncCfg* cfg, char* str) {
|
|||
ths->vgId, str, ths->replicaNum, ths->peersNum, ths->raftCfg.lastConfigIndex, ths->raftCfg.cfg.changeVersion,
|
||||
ths->restoreFinish);
|
||||
|
||||
sInfo("vgId:%d, %s, myNodeInfo, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str,
|
||||
sInfo("vgId:%d, %s, myNodeInfo, clusterId:0x%" PRIx64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str,
|
||||
ths->myNodeInfo.clusterId, ths->myNodeInfo.nodeId, ths->myNodeInfo.nodeFqdn, ths->myNodeInfo.nodePort,
|
||||
ths->myNodeInfo.nodeRole);
|
||||
|
||||
for (int32_t i = 0; i < ths->peersNum; ++i) {
|
||||
sInfo("vgId:%d, %s, peersNodeInfo%d, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str,
|
||||
sInfo("vgId:%d, %s, peersNodeInfo%d, clusterId:0x%" PRIx64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str,
|
||||
i, ths->peersNodeInfo[i].clusterId, ths->peersNodeInfo[i].nodeId, ths->peersNodeInfo[i].nodeFqdn,
|
||||
ths->peersNodeInfo[i].nodePort, ths->peersNodeInfo[i].nodeRole);
|
||||
}
|
||||
|
@ -2951,7 +2951,7 @@ void syncNodeLogConfigInfo(SSyncNode* ths, SSyncCfg* cfg, char* str) {
|
|||
}
|
||||
|
||||
for (int32_t i = 0; i < ths->raftCfg.cfg.totalReplicaNum; ++i) {
|
||||
sInfo("vgId:%d, %s, nodeInfo%d, clusterId:%" PRId64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str, i,
|
||||
sInfo("vgId:%d, %s, nodeInfo%d, clusterId:0x%" PRIx64 ", nodeId:%d, Fqdn:%s, port:%d, role:%d", ths->vgId, str, i,
|
||||
ths->raftCfg.cfg.nodeInfo[i].clusterId, ths->raftCfg.cfg.nodeInfo[i].nodeId,
|
||||
ths->raftCfg.cfg.nodeInfo[i].nodeFqdn, ths->raftCfg.cfg.nodeInfo[i].nodePort,
|
||||
ths->raftCfg.cfg.nodeInfo[i].nodeRole);
|
||||
|
|
|
@ -160,7 +160,7 @@ void* rpcMallocCont(int64_t contLen) {
|
|||
tError("failed to malloc msg, size:%" PRId64, size);
|
||||
return NULL;
|
||||
} else {
|
||||
tTrace("malloc mem:%p size:%" PRId64, start, size);
|
||||
tTrace("cont:%p, rpc malloc size:%" PRId64, start, size);
|
||||
}
|
||||
|
||||
return start + TRANS_MSG_OVERHEAD;
|
||||
|
|
|
@ -2160,7 +2160,7 @@ static FORCE_INLINE void destroyReq(void* arg) {
|
|||
|
||||
removeReqFromSendQ(pReq);
|
||||
STraceId* trace = &pReq->msg.info.traceId;
|
||||
tGTrace("free memory:%p, free ctx:%p", pReq, pReq->ctx);
|
||||
tGTrace("free mem:%p, free ctx:%p", pReq, pReq->ctx);
|
||||
|
||||
if (pReq->ctx) {
|
||||
destroyReqCtx(pReq->ctx);
|
||||
|
@ -2938,7 +2938,7 @@ void transRefCliHandle(void* handle) {
|
|||
SCliConn* conn = (SCliConn*)handle;
|
||||
conn->ref++;
|
||||
|
||||
tTrace("%s conn:%p, ref %d", CONN_GET_INST_LABEL(conn), conn, conn->ref);
|
||||
tTrace("%s conn:%p, ref:%d", CONN_GET_INST_LABEL(conn), conn, conn->ref);
|
||||
}
|
||||
int32_t transUnrefCliHandle(void* handle) {
|
||||
if (handle == NULL) {
|
||||
|
@ -3023,7 +3023,7 @@ int32_t transReleaseCliHandle(void* handle, int32_t status) {
|
|||
cmsg->ctx = pCtx;
|
||||
|
||||
STraceId* trace = &tmsg.info.traceId;
|
||||
tGDebug("send release request at thread:%08" PRId64 ", malloc memory:%p", pThrd->pid, cmsg);
|
||||
tGDebug("send release request at thread:%08" PRId64 ", malloc mem:%p", pThrd->pid, cmsg);
|
||||
|
||||
if ((code = transAsyncSend(pThrd->asyncPool, &cmsg->q)) != 0) {
|
||||
destroyReq(cmsg);
|
||||
|
|
|
@ -126,7 +126,7 @@ void transFreeMsg(void* msg) {
|
|||
if (msg == NULL) {
|
||||
return;
|
||||
}
|
||||
tTrace("rpc free cont:%p", (char*)msg - TRANS_MSG_OVERHEAD);
|
||||
tTrace("cont:%p, rpc free", (char*)msg - TRANS_MSG_OVERHEAD);
|
||||
taosMemoryFree((char*)msg - sizeof(STransMsgHead));
|
||||
}
|
||||
void transSockInfo2Str(struct sockaddr* sockname, char* dst) {
|
||||
|
|
|
@ -408,7 +408,7 @@ int32_t createDiskbasedBuf(SDiskbasedBuf** pBuf, int32_t pagesize, int64_t inMem
|
|||
goto _error;
|
||||
}
|
||||
|
||||
// qDebug("QInfo:0x%"PRIx64" create resBuf for output, page size:%d, inmem buf pages:%d, file:%s", qId,
|
||||
// qDebug("QInfo:0x%"PRIx64 " create resBuf for output, page size:%d, inmem buf pages:%d, file:%s", qId,
|
||||
// pPBuf->pageSize, pPBuf->inMemPages, pPBuf->path);
|
||||
|
||||
*pBuf = pPBuf;
|
||||
|
|
|
@ -214,14 +214,14 @@ int32_t taosWriteQitem(STaosQueue *queue, void *pItem) {
|
|||
(void)taosThreadMutexLock(&queue->mutex);
|
||||
if (queue->memLimit > 0 && (queue->memOfItems + pNode->size + pNode->dataSize) > queue->memLimit) {
|
||||
code = TSDB_CODE_UTIL_QUEUE_OUT_OF_MEMORY;
|
||||
uError("item:%p failed to put into queue:%p, queue mem limit: %" PRId64 ", reason: %s" PRId64, pItem, queue,
|
||||
uError("item:%p, failed to put into queue:%p, queue mem limit:%" PRId64 ", reason:%s" PRId64, pItem, queue,
|
||||
queue->memLimit, tstrerror(code));
|
||||
|
||||
(void)taosThreadMutexUnlock(&queue->mutex);
|
||||
return code;
|
||||
} else if (queue->itemLimit > 0 && queue->numOfItems + 1 > queue->itemLimit) {
|
||||
code = TSDB_CODE_UTIL_QUEUE_OUT_OF_MEMORY;
|
||||
uError("item:%p failed to put into queue:%p, queue size limit: %" PRId64 ", reason: %s" PRId64, pItem, queue,
|
||||
uError("item:%p, failed to put into queue:%p, queue size limit:%" PRId64 ", reason:%s" PRId64, pItem, queue,
|
||||
queue->itemLimit, tstrerror(code));
|
||||
(void)taosThreadMutexUnlock(&queue->mutex);
|
||||
return code;
|
||||
|
@ -240,7 +240,7 @@ int32_t taosWriteQitem(STaosQueue *queue, void *pItem) {
|
|||
(void)atomic_add_fetch_32(&queue->qset->numOfItems, 1);
|
||||
}
|
||||
|
||||
uTrace("item:%p is put into queue:%p, items:%d mem:%" PRId64, pItem, queue, queue->numOfItems, queue->memOfItems);
|
||||
uTrace("item:%p, is put into queue:%p, items:%d mem:%" PRId64, pItem, queue, queue->numOfItems, queue->memOfItems);
|
||||
|
||||
(void)taosThreadMutexUnlock(&queue->mutex);
|
||||
|
||||
|
@ -269,7 +269,7 @@ void taosReadQitem(STaosQueue *queue, void **ppItem) {
|
|||
if (queue->qset) {
|
||||
(void)atomic_sub_fetch_32(&queue->qset->numOfItems, 1);
|
||||
}
|
||||
uTrace("item:%p is read out from queue:%p, items:%d mem:%" PRId64, *ppItem, queue, queue->numOfItems,
|
||||
uTrace("item:%p, is read out from queue:%p, items:%d mem:%" PRId64, *ppItem, queue, queue->numOfItems,
|
||||
queue->memOfItems);
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ int32_t taosGetQitem(STaosQall *qall, void **ppItem) {
|
|||
qall->unAccessedNumOfItems -= 1;
|
||||
qall->unAccessMemOfItems -= pNode->dataSize;
|
||||
|
||||
uTrace("item:%p is fetched", *ppItem);
|
||||
uTrace("item:%p, is fetched", *ppItem);
|
||||
} else {
|
||||
*ppItem = NULL;
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ int32_t taosReadQitemFromQset(STaosQset *qset, void **ppItem, SQueueInfo *qinfo)
|
|||
queue->memOfItems -= (pNode->size + pNode->dataSize);
|
||||
(void)atomic_sub_fetch_32(&qset->numOfItems, 1);
|
||||
code = 1;
|
||||
uTrace("item:%p is read out from queue:%p, items:%d mem:%" PRId64, *ppItem, queue, queue->numOfItems - 1,
|
||||
uTrace("item:%p, is read out from queue:%p, items:%d mem:%" PRId64, *ppItem, queue, queue->numOfItems - 1,
|
||||
queue->memOfItems);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ int32_t taosOpenRef(int32_t max, RefFp fp) {
|
|||
taosIncRsetCount(pSet);
|
||||
|
||||
tsRefSetNum++;
|
||||
uTrace("rsetId:%d is opened, max:%d, fp:%p refSetNum:%d", rsetId, max, fp, tsRefSetNum);
|
||||
uTrace("rsetId:%d, is opened, max:%d, fp:%p refSetNum:%d", rsetId, max, fp, tsRefSetNum);
|
||||
} else {
|
||||
rsetId = TSDB_CODE_REF_FULL;
|
||||
taosMemoryFree(nodeList);
|
||||
|
@ -116,7 +116,7 @@ void taosCloseRef(int32_t rsetId) {
|
|||
int32_t deleted = 0;
|
||||
|
||||
if (rsetId < 0 || rsetId >= TSDB_REF_OBJECTS) {
|
||||
uTrace("rsetId:%d is invalid, out of range", rsetId);
|
||||
uTrace("rsetId:%d, is invalid, out of range", rsetId);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -127,9 +127,9 @@ void taosCloseRef(int32_t rsetId) {
|
|||
if (pSet->state == TSDB_REF_STATE_ACTIVE) {
|
||||
pSet->state = TSDB_REF_STATE_DELETED;
|
||||
deleted = 1;
|
||||
uTrace("rsetId:%d is closed, count:%d", rsetId, pSet->count);
|
||||
uTrace("rsetId:%d, is closed, count:%d", rsetId, pSet->count);
|
||||
} else {
|
||||
uTrace("rsetId:%d is already closed, count:%d", rsetId, pSet->count);
|
||||
uTrace("rsetId:%d, is already closed, count:%d", rsetId, pSet->count);
|
||||
}
|
||||
|
||||
(void)taosThreadMutexUnlock(&tsRefMutex);
|
||||
|
@ -144,7 +144,7 @@ int64_t taosAddRef(int32_t rsetId, void *p) {
|
|||
int64_t rid = 0;
|
||||
|
||||
if (rsetId < 0 || rsetId >= TSDB_REF_OBJECTS) {
|
||||
uTrace("rsetId:%d p:%p failed to add, rsetId not valid", rsetId, p);
|
||||
uTrace("rsetId:%d, p:%p failed to add, rsetId not valid", rsetId, p);
|
||||
return terrno = TSDB_CODE_REF_INVALID_ID;
|
||||
}
|
||||
|
||||
|
@ -152,14 +152,14 @@ int64_t taosAddRef(int32_t rsetId, void *p) {
|
|||
taosIncRsetCount(pSet);
|
||||
if (pSet->state != TSDB_REF_STATE_ACTIVE) {
|
||||
taosDecRsetCount(pSet);
|
||||
uTrace("rsetId:%d p:%p failed to add, not active", rsetId, p);
|
||||
uTrace("rsetId:%d, p:%p failed to add, not active", rsetId, p);
|
||||
return terrno = TSDB_CODE_REF_ID_REMOVED;
|
||||
}
|
||||
|
||||
pNode = taosMemoryCalloc(sizeof(SRefNode), 1);
|
||||
if (pNode == NULL) {
|
||||
taosDecRsetCount(pSet);
|
||||
uError("rsetId:%d p:%p failed to add, out of memory", rsetId, p);
|
||||
uError("rsetId:%d, p:%p failed to add, out of memory", rsetId, p);
|
||||
return terrno;
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ int64_t taosAddRef(int32_t rsetId, void *p) {
|
|||
if (pSet->nodeList[hash]) pSet->nodeList[hash]->prev = pNode;
|
||||
pSet->nodeList[hash] = pNode;
|
||||
|
||||
uTrace("rsetId:%d p:%p rid:%" PRId64 " is added, count:%d, remain count:%d", rsetId, p, rid, pSet->count,
|
||||
uTrace("rsetId:%d, p:%p rid:0x%" PRIx64 " is added, count:%d, remain count:%d", rsetId, p, rid, pSet->count,
|
||||
pNode->count);
|
||||
|
||||
taosUnlockList(pSet->lockedBy + hash);
|
||||
|
@ -195,13 +195,13 @@ void *taosAcquireRef(int32_t rsetId, int64_t rid) {
|
|||
void *p = NULL;
|
||||
|
||||
if (rsetId < 0 || rsetId >= TSDB_REF_OBJECTS) {
|
||||
// uTrace("rsetId:%d rid:%" PRId64 " failed to acquire, rsetId not valid", rsetId, rid);
|
||||
// uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to acquire, rsetId not valid", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_INVALID_ID;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (rid <= 0) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to acquire, rid not valid", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to acquire, rid not valid", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ void *taosAcquireRef(int32_t rsetId, int64_t rid) {
|
|||
pSet = tsRefSetList + rsetId;
|
||||
taosIncRsetCount(pSet);
|
||||
if (pSet->state != TSDB_REF_STATE_ACTIVE) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to acquire, not active", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to acquire, not active", rsetId, rid);
|
||||
taosDecRsetCount(pSet);
|
||||
terrno = TSDB_CODE_REF_ID_REMOVED;
|
||||
return NULL;
|
||||
|
@ -229,21 +229,21 @@ void *taosAcquireRef(int32_t rsetId, int64_t rid) {
|
|||
}
|
||||
|
||||
if (iter >= TSDB_REF_ITER_THRESHOLD) {
|
||||
uWarn("rsetId:%d rid:%" PRId64 " iter:%d", rsetId, rid, iter);
|
||||
uWarn("rsetId:%d, rid:0x%" PRIx64 " iter:%d", rsetId, rid, iter);
|
||||
}
|
||||
|
||||
if (pNode) {
|
||||
if (pNode->removed == 0) {
|
||||
pNode->count++;
|
||||
p = pNode->p;
|
||||
uTrace("rsetId:%d p:%p rid:%" PRId64 " is acquired, remain count:%d", rsetId, pNode->p, rid, pNode->count);
|
||||
uTrace("rsetId:%d, p:%p rid:0x%" PRIx64 " is acquired, remain count:%d", rsetId, pNode->p, rid, pNode->count);
|
||||
} else {
|
||||
terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
uTrace("rsetId:%d p:%p rid:%" PRId64 " is already removed, failed to acquire", rsetId, pNode->p, rid);
|
||||
uTrace("rsetId:%d, p:%p rid:0x%" PRIx64 " is already removed, failed to acquire", rsetId, pNode->p, rid);
|
||||
}
|
||||
} else {
|
||||
terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
uTrace("rsetId:%d rid:%" PRId64 " is not there, failed to acquire", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " is not there, failed to acquire", rsetId, rid);
|
||||
}
|
||||
|
||||
taosUnlockList(pSet->lockedBy + hash);
|
||||
|
@ -264,13 +264,13 @@ void *taosIterateRef(int32_t rsetId, int64_t rid) {
|
|||
SRefSet *pSet;
|
||||
|
||||
if (rsetId < 0 || rsetId >= TSDB_REF_OBJECTS) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to iterate, rsetId not valid", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to iterate, rsetId not valid", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_INVALID_ID;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (rid < 0) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to iterate, rid not valid", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to iterate, rid not valid", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ void *taosIterateRef(int32_t rsetId, int64_t rid) {
|
|||
pSet = tsRefSetList + rsetId;
|
||||
taosIncRsetCount(pSet);
|
||||
if (pSet->state != TSDB_REF_STATE_ACTIVE) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to iterate, rset not active", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to iterate, rset not active", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_ID_REMOVED;
|
||||
taosDecRsetCount(pSet);
|
||||
return NULL;
|
||||
|
@ -301,11 +301,11 @@ void *taosIterateRef(int32_t rsetId, int64_t rid) {
|
|||
}
|
||||
|
||||
if (iter >= TSDB_REF_ITER_THRESHOLD) {
|
||||
uWarn("rsetId:%d rid:%" PRId64 " iter:%d", rsetId, rid, iter);
|
||||
uWarn("rsetId:%d, rid:0x%" PRIx64 " iter:%d", rsetId, rid, iter);
|
||||
}
|
||||
|
||||
if (pNode == NULL) {
|
||||
uError("rsetId:%d rid:%" PRId64 " not there, quit", rsetId, rid);
|
||||
uError("rsetId:%d, rid:0x%" PRIx64 " not there, quit", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
taosUnlockList(pSet->lockedBy + hash);
|
||||
taosDecRsetCount(pSet);
|
||||
|
@ -345,9 +345,9 @@ void *taosIterateRef(int32_t rsetId, int64_t rid) {
|
|||
pNode->count++; // acquire it
|
||||
newP = pNode->p;
|
||||
taosUnlockList(pSet->lockedBy + hash);
|
||||
uTrace("rsetId:%d p:%p rid:%" PRId64 " is returned", rsetId, newP, rid);
|
||||
uTrace("rsetId:%d, p:%p rid:0x%" PRIx64 " is returned", rsetId, newP, rid);
|
||||
} else {
|
||||
uTrace("rsetId:%d the list is over", rsetId);
|
||||
uTrace("rsetId:%d, the list is over", rsetId);
|
||||
}
|
||||
|
||||
if (rid > 0) taosReleaseRef(rsetId, rid); // release the current one
|
||||
|
@ -371,13 +371,13 @@ int32_t taosListRef() {
|
|||
|
||||
if (pSet->state == TSDB_REF_STATE_EMPTY) continue;
|
||||
|
||||
uInfo("rsetId:%d state:%d count:%d", i, pSet->state, pSet->count);
|
||||
uInfo("rsetId:%d, state:%d count:%d", i, pSet->state, pSet->count);
|
||||
|
||||
for (int32_t j = 0; j < pSet->max; ++j) {
|
||||
pNode = pSet->nodeList[j];
|
||||
|
||||
while (pNode) {
|
||||
uInfo("rsetId:%d p:%p rid:%" PRId64 "count:%d", i, pNode->p, pNode->rid, pNode->count);
|
||||
uInfo("rsetId:%d, p:%p rid:0x%" PRIx64 "count:%d", i, pNode->p, pNode->rid, pNode->count);
|
||||
pNode = pNode->next;
|
||||
num++;
|
||||
}
|
||||
|
@ -398,18 +398,18 @@ static int32_t taosDecRefCount(int32_t rsetId, int64_t rid, int32_t remove, int3
|
|||
int32_t code = 0;
|
||||
|
||||
if (rsetId < 0 || rsetId >= TSDB_REF_OBJECTS) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to remove, rsetId not valid", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to remove, rsetId not valid", rsetId, rid);
|
||||
return terrno = TSDB_CODE_REF_INVALID_ID;
|
||||
}
|
||||
|
||||
if (rid <= 0) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to remove, rid not valid", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to remove, rid not valid", rsetId, rid);
|
||||
return terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
}
|
||||
|
||||
pSet = tsRefSetList + rsetId;
|
||||
if (pSet->state == TSDB_REF_STATE_EMPTY) {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " failed to remove, cleaned", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " failed to remove, cleaned", rsetId, rid);
|
||||
return terrno = TSDB_CODE_REF_ID_REMOVED;
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ static int32_t taosDecRefCount(int32_t rsetId, int64_t rid, int32_t remove, int3
|
|||
}
|
||||
|
||||
if (iter >= TSDB_REF_ITER_THRESHOLD) {
|
||||
uWarn("rsetId:%d rid:%" PRId64 " iter:%d", rsetId, rid, iter);
|
||||
uWarn("rsetId:%d, rid:0x%" PRIx64 " iter:%d", rsetId, rid, iter);
|
||||
}
|
||||
|
||||
if (pNode) {
|
||||
|
@ -444,10 +444,10 @@ static int32_t taosDecRefCount(int32_t rsetId, int64_t rid, int32_t remove, int3
|
|||
}
|
||||
released = 1;
|
||||
} else {
|
||||
uTrace("rsetId:%d p:%p rid:%" PRId64 " is released, remain count %d", rsetId, pNode->p, rid, pNode->count);
|
||||
uTrace("rsetId:%d, p:%p rid:0x%" PRIx64 " is released, remain count %d", rsetId, pNode->p, rid, pNode->count);
|
||||
}
|
||||
} else {
|
||||
uTrace("rsetId:%d rid:%" PRId64 " is not there, failed to release/remove", rsetId, rid);
|
||||
uTrace("rsetId:%d, rid:0x%" PRIx64 " is not there, failed to release/remove", rsetId, rid);
|
||||
terrno = TSDB_CODE_REF_NOT_EXIST;
|
||||
code = terrno;
|
||||
}
|
||||
|
@ -455,7 +455,7 @@ static int32_t taosDecRefCount(int32_t rsetId, int64_t rid, int32_t remove, int3
|
|||
taosUnlockList(pSet->lockedBy + hash);
|
||||
|
||||
if (released) {
|
||||
uTrace("rsetId:%d p:%p rid:%" PRId64 " is removed, count:%d, free mem: %p", rsetId, pNode->p, rid, pSet->count,
|
||||
uTrace("rsetId:%d, p:%p rid:0x%" PRIx64 " is removed, count:%d, free mem: %p", rsetId, pNode->p, rid, pSet->count,
|
||||
pNode);
|
||||
(*pSet->fp)(pNode->p);
|
||||
taosMemoryFree(pNode);
|
||||
|
@ -489,12 +489,12 @@ static void taosInitRefModule(void) { (void)taosThreadMutexInit(&tsRefMutex, NUL
|
|||
|
||||
static void taosIncRsetCount(SRefSet *pSet) {
|
||||
(void)atomic_add_fetch_32(&pSet->count, 1);
|
||||
// uTrace("rsetId:%d inc count:%d", pSet->rsetId, count);
|
||||
// uTrace("rsetId:%d, inc count:%d", pSet->rsetId, count);
|
||||
}
|
||||
|
||||
static void taosDecRsetCount(SRefSet *pSet) {
|
||||
int32_t count = atomic_sub_fetch_32(&pSet->count, 1);
|
||||
// uTrace("rsetId:%d dec count:%d", pSet->rsetId, count);
|
||||
// uTrace("rsetId:%d, dec count:%d", pSet->rsetId, count);
|
||||
|
||||
if (count > 0) return;
|
||||
|
||||
|
@ -509,7 +509,7 @@ static void taosDecRsetCount(SRefSet *pSet) {
|
|||
taosMemoryFreeClear(pSet->lockedBy);
|
||||
|
||||
tsRefSetNum--;
|
||||
uTrace("rsetId:%d is cleaned, refSetNum:%d count:%d", pSet->rsetId, tsRefSetNum, pSet->count);
|
||||
uTrace("rsetId:%d, is cleaned, refSetNum:%d count:%d", pSet->rsetId, tsRefSetNum, pSet->count);
|
||||
}
|
||||
|
||||
(void)taosThreadMutexUnlock(&tsRefMutex);
|
||||
|
|
Loading…
Reference in New Issue