refactor: adjust logs
This commit is contained in:
parent
389a4fba7c
commit
dca93b18cc
|
@ -21,7 +21,7 @@ extern SConfig *tsCfg;
|
|||
|
||||
static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) {
|
||||
if (pMgmt->pData->dnodeId == 0 || pMgmt->pData->clusterId == 0) {
|
||||
dInfo("set dnodeId:%d clusterId:%" PRId64, pCfg->dnodeId, pCfg->clusterId);
|
||||
dInfo("set local info, dnodeId:%d clusterId:%" PRId64, pCfg->dnodeId, pCfg->clusterId);
|
||||
taosThreadRwlockWrlock(&pMgmt->pData->lock);
|
||||
pMgmt->pData->dnodeId = pCfg->dnodeId;
|
||||
pMgmt->pData->clusterId = pCfg->clusterId;
|
||||
|
|
|
@ -277,7 +277,7 @@ int32_t dmRunDnode(SDnode *pDnode) {
|
|||
|
||||
while (1) {
|
||||
if (pDnode->stop) {
|
||||
dInfo("dnode is about to stop");
|
||||
dInfo("TDengine is about to stop");
|
||||
dmSetStatus(pDnode, DND_STAT_STOPPED);
|
||||
dmStopNodes(pDnode);
|
||||
dmCloseNodes(pDnode);
|
||||
|
|
|
@ -406,7 +406,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
|
|||
}
|
||||
|
||||
if (statusReq.dnodeId == 0) {
|
||||
mInfo("dnode:%d, %s first access, set clusterId %" PRId64, pDnode->id, pDnode->ep, pMnode->clusterId);
|
||||
mInfo("dnode:%d, %s first access, clusterId:%" PRId64, pDnode->id, pDnode->ep, pMnode->clusterId);
|
||||
} else {
|
||||
if (statusReq.clusterId != pMnode->clusterId) {
|
||||
if (pDnode != NULL) {
|
||||
|
|
|
@ -323,12 +323,12 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
|||
if (code == TSDB_CODE_INDEX_REBUILDING) {
|
||||
code = vnodeGetAllTableList(pVnode, tableUid, pListInfo->pTableList);
|
||||
} else if (code != TSDB_CODE_SUCCESS) {
|
||||
qError("failed to get tableIds, reason: %s, suid: %" PRIu64 "", tstrerror(code), tableUid);
|
||||
qError("failed to get tableIds, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
|
||||
taosArrayDestroy(res);
|
||||
terrno = code;
|
||||
return code;
|
||||
} else {
|
||||
qDebug("sucess to get tableIds, size: %d, suid: %" PRIu64 "", (int)taosArrayGetSize(res), tableUid);
|
||||
qDebug("success to get tableIds, size:%d, suid:%" PRIu64, (int)taosArrayGetSize(res), tableUid);
|
||||
}
|
||||
|
||||
for (int i = 0; i < taosArrayGetSize(res); i++) {
|
||||
|
@ -341,7 +341,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
|||
}
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
qError("failed to get tableIds, reason: %s, suid: %" PRIu64 "", tstrerror(code), tableUid);
|
||||
qError("failed to get tableIds, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
|
||||
terrno = code;
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ int32_t udfStartUdfd(int32_t startDnodeId) {
|
|||
uv_async_send(&pData->stopAsync);
|
||||
uv_thread_join(&pData->thread);
|
||||
pData->needCleanUp = false;
|
||||
fnInfo("dnode udfd cleaned up after spawn err");
|
||||
fnInfo("udfd is cleaned up after spawn err");
|
||||
} else {
|
||||
pData->needCleanUp = true;
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ int32_t udfStartUdfd(int32_t startDnodeId) {
|
|||
|
||||
int32_t udfStopUdfd() {
|
||||
SUdfdData *pData = &udfdGlobal;
|
||||
fnInfo("dnode to stop udfd. need cleanup: %d, spawn err: %d",
|
||||
fnInfo("udfd start to stop, need cleanup:%d, spawn err:%d",
|
||||
pData->needCleanUp, pData->spawnErr);
|
||||
if (!pData->needCleanUp || atomic_load_32(&pData->stopCalled)) {
|
||||
return 0;
|
||||
|
@ -225,7 +225,7 @@ int32_t udfStopUdfd() {
|
|||
#ifdef WINDOWS
|
||||
if (pData->jobHandle != NULL) CloseHandle(pData->jobHandle);
|
||||
#endif
|
||||
fnInfo("dnode udfd cleaned up");
|
||||
fnInfo("udfd is cleaned up");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -467,7 +467,7 @@ int32_t getUdfdPipeName(char* pipeName, int32_t size) {
|
|||
size_t dnodeIdSize = sizeof(dnodeId);
|
||||
int32_t err = uv_os_getenv(UDF_DNODE_ID_ENV_NAME, dnodeId, &dnodeIdSize);
|
||||
if (err != 0) {
|
||||
fnError("get dnode id from env. error: %s.", uv_err_name(err));
|
||||
fnError("failed to get dnodeId from env since %s", uv_err_name(err));
|
||||
dnodeId[0] = '1';
|
||||
}
|
||||
#ifdef _WIN32
|
||||
|
@ -475,7 +475,7 @@ int32_t getUdfdPipeName(char* pipeName, int32_t size) {
|
|||
#else
|
||||
snprintf(pipeName, size, "%s/%s%s", tsDataDir, UDF_LISTEN_PIPE_NAME_PREFIX, dnodeId);
|
||||
#endif
|
||||
fnInfo("get dnode id from env. dnode id: %s. pipe path: %s", dnodeId, pipeName);
|
||||
fnInfo("get dnodeId:%s from env, pipe path:%s", dnodeId, pipeName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1609,7 +1609,7 @@ int32_t udfcClose() {
|
|||
taosArrayDestroy(udfc->udfStubs);
|
||||
uv_mutex_destroy(&udfc->udfStubsMutex);
|
||||
udfc->udfcState = UDFC_STATE_INITAL;
|
||||
fnInfo("udfc cleaned up");
|
||||
fnInfo("udfc is cleaned up");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
|
|||
init = 1;
|
||||
|
||||
nRead = tdbOsPRead(pPager->fd, pPage->pData, pPage->pageSize, ((i64)pPage->pageSize) * (pgno - 1));
|
||||
tdbTrace("tdbttl pager:%p, pgno:%d, nRead:%ld", pPager, pgno, nRead);
|
||||
tdbTrace("tdbttl pager:%p, pgno:%d, nRead:%" PRId64, pPager, pgno, nRead);
|
||||
if (nRead < pPage->pageSize) {
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
|
|
|
@ -255,7 +255,7 @@ int transAsyncSend(SAsyncPool* pool, queue* mq);
|
|||
tTrace("handle step1"); \
|
||||
SExHandle* exh2 = transAcquireExHandle(transGetRefMgt(), id); \
|
||||
if (exh2 == NULL || id != exh2->refId) { \
|
||||
tTrace("handle %p except, may already freed, ignore msg, ref1: %" PRIu64 ", ref2 : %" PRIu64 "", exh1, \
|
||||
tTrace("handle %p except, may already freed, ignore msg, ref1:%" PRIu64 ", ref2:%" PRIu64, exh1, \
|
||||
exh2 ? exh2->refId : 0, id); \
|
||||
goto _return1; \
|
||||
} \
|
||||
|
@ -263,7 +263,7 @@ int transAsyncSend(SAsyncPool* pool, queue* mq);
|
|||
tTrace("handle step2"); \
|
||||
SExHandle* exh2 = transAcquireExHandle(transGetRefMgt(), id); \
|
||||
if (exh2 == NULL || id == exh2->refId) { \
|
||||
tTrace("handle %p except, may already freed, ignore msg, ref1: %" PRIu64 ", ref2 : %" PRIu64 "", exh1, id, \
|
||||
tTrace("handle %p except, may already freed, ignore msg, ref1:%" PRIu64 ", ref2:%" PRIu64, exh1, id, \
|
||||
exh2 ? exh2->refId : 0); \
|
||||
goto _return1; \
|
||||
} else { \
|
||||
|
|
|
@ -86,7 +86,7 @@ void rpcClose(void* arg) {
|
|||
tInfo("start to close rpc");
|
||||
transRemoveExHandle(transGetInstMgt(), (int64_t)arg);
|
||||
transReleaseExHandle(transGetInstMgt(), (int64_t)arg);
|
||||
tInfo("finish to close rpc");
|
||||
tInfo("rpc is closed");
|
||||
return;
|
||||
}
|
||||
void rpcCloseImpl(void* arg) {
|
||||
|
|
|
@ -353,7 +353,7 @@ void cliHandleResp(SCliConn* conn) {
|
|||
}
|
||||
|
||||
STraceId* trace = &transMsg.info.traceId;
|
||||
tGTrace("%s conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, code: %d", CONN_GET_INST_LABEL(conn),
|
||||
tGTrace("%s conn %p %s received from %s:%d, local info:%s:%d, msg size:%d, code:0x%x", CONN_GET_INST_LABEL(conn),
|
||||
conn, TMSG_INFO(pHead->msgType), taosInetNtoa(conn->addr.sin_addr), ntohs(conn->addr.sin_port),
|
||||
taosInetNtoa(conn->localAddr.sin_addr), ntohs(conn->localAddr.sin_port), transMsg.contLen, transMsg.code);
|
||||
|
||||
|
@ -1294,7 +1294,7 @@ void transSetDefaultAddr(void* shandle, const char* ip, const char* fqdn) {
|
|||
cliMsg->refId = (int64_t)shandle;
|
||||
|
||||
SCliThrd* thrd = ((SCliObj*)pTransInst->tcphandle)->pThreadObj[i];
|
||||
tDebug("%s update epset at thread:%08" PRId64 "", pTransInst->label, thrd->pid);
|
||||
tDebug("%s update epset at thread:%08" PRId64, pTransInst->label, thrd->pid);
|
||||
|
||||
transAsyncSend(thrd->asyncPool, &(cliMsg->q));
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ int transDQSched(SDelayQueue* queue, void (*func)(void* arg), void* arg, uint64_
|
|||
}
|
||||
}
|
||||
|
||||
tTrace("timer %p put task into delay queue, timeoutMs: %" PRIu64 "", queue->timer, timeoutMs);
|
||||
tTrace("timer %p put task into delay queue, timeoutMs:%" PRIu64, queue->timer, timeoutMs);
|
||||
heapInsert(queue->heap, &task->node);
|
||||
uv_timer_start(queue->timer, transDQTimeout, timeoutMs, 0);
|
||||
return 0;
|
||||
|
|
|
@ -265,7 +265,7 @@ static void uvHandleReq(SSvrConn* pConn) {
|
|||
transMsg.info.refId = pConn->refId;
|
||||
transMsg.info.traceId = pHead->traceId;
|
||||
|
||||
tGTrace("%s handle %p conn: %p translated to app, refId: %" PRIu64 "", transLabel(pTransInst), transMsg.info.handle,
|
||||
tGTrace("%s handle %p conn:%p translated to app, refId:%" PRIu64, transLabel(pTransInst), transMsg.info.handle,
|
||||
pConn, pConn->refId);
|
||||
assert(transMsg.info.handle != NULL);
|
||||
|
||||
|
@ -601,7 +601,7 @@ void uvOnConnectionCb(uv_stream_t* q, ssize_t nread, const uv_buf_t* buf) {
|
|||
tError("read error %s", uv_err_name(nread));
|
||||
}
|
||||
// TODO(log other failure reason)
|
||||
tError("failed to create connect: %p", q);
|
||||
tWarn("failed to create connect:%p", q);
|
||||
taosMemoryFree(buf->base);
|
||||
uv_close((uv_handle_t*)q, NULL);
|
||||
// taosMemoryFree(q);
|
||||
|
@ -765,7 +765,7 @@ static SSvrConn* createConn(void* hThrd) {
|
|||
STrans* pTransInst = pThrd->pTransInst;
|
||||
pConn->refId = exh->refId;
|
||||
transRefSrvHandle(pConn);
|
||||
tTrace("%s handle %p, conn %p created, refId: %" PRId64 "", transLabel(pTransInst), exh, pConn, pConn->refId);
|
||||
tTrace("%s handle %p, conn %p created, refId:%" PRId64, transLabel(pTransInst), exh, pConn, pConn->refId);
|
||||
return pConn;
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ int main(int argc, char *argv[]) {
|
|||
dDebugFlag = rpcDebugFlag;
|
||||
uDebugFlag = rpcDebugFlag;
|
||||
} else {
|
||||
printf("\nusage: %s [options] \n", argv[0]);
|
||||
printf("\nusage:% [options] \n", argv[0]);
|
||||
printf(" [-p port]: server port number, default is:%d\n", rpcInit.localPort);
|
||||
printf(" [-t threads]: number of rpc threads, default is:%d\n", rpcInit.numOfThreads);
|
||||
printf(" [-s sessions]: number of sessions, default is:%d\n", rpcInit.sessions);
|
||||
|
|
|
@ -94,7 +94,7 @@ static int64_t walReadSeekFilePos(SWalReader *pRead, int64_t fileFirstVer, int64
|
|||
ret = taosLSeekFile(pIdxTFile, offset, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
wError("failed to seek idx file, ver %ld, pos: %ld, since %s", ver, offset, terrstr());
|
||||
wError("failed to seek idx file, ver:%" PRId64 ", pos:%" PRId64 ", since %s", ver, offset, terrstr());
|
||||
return -1;
|
||||
}
|
||||
SWalIdxEntry entry = {0};
|
||||
|
@ -104,7 +104,7 @@ static int64_t walReadSeekFilePos(SWalReader *pRead, int64_t fileFirstVer, int64
|
|||
wError("failed to read idx file, since %s", terrstr());
|
||||
} else {
|
||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||
wError("read idx file incompletely, read bytes %ld, bytes should be %lu", ret, sizeof(SWalIdxEntry));
|
||||
wError("read idx file incompletely, read bytes %" PRId64 ", bytes should be %" PRIu64, ret, sizeof(SWalIdxEntry));
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ static int64_t walReadSeekFilePos(SWalReader *pRead, int64_t fileFirstVer, int64
|
|||
ret = taosLSeekFile(pLogTFile, entry.offset, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
wError("failed to seek log file, ver %ld, pos: %ld, since %s", ver, entry.offset, terrstr());
|
||||
wError("failed to seek log file, ver:%" PRId64 ", pos:%" PRId64 ", since %s", ver, entry.offset, terrstr());
|
||||
return -1;
|
||||
}
|
||||
return ret;
|
||||
|
@ -153,7 +153,8 @@ static int32_t walReadSeekVer(SWalReader *pRead, int64_t ver) {
|
|||
return 0;
|
||||
}
|
||||
if (ver > pWal->vers.lastVer || ver < pWal->vers.firstVer) {
|
||||
wError("invalid version: % " PRId64 ", first ver %ld, last ver %ld", ver, pWal->vers.firstVer, pWal->vers.lastVer);
|
||||
wError("invalid version:%" PRId64 ", first ver:%" PRId64 ", last ver:%" PRId64, ver, pWal->vers.firstVer,
|
||||
pWal->vers.lastVer);
|
||||
terrno = TSDB_CODE_WAL_LOG_NOT_EXIST;
|
||||
return -1;
|
||||
}
|
||||
|
@ -388,7 +389,7 @@ int32_t walReadVer(SWalReader *pRead, int64_t ver) {
|
|||
}
|
||||
|
||||
if (ver > pRead->pWal->vers.lastVer || ver < pRead->pWal->vers.firstVer) {
|
||||
wError("invalid version: % " PRId64 ", first ver %ld, last ver %ld", ver, pRead->pWal->vers.firstVer,
|
||||
wError("invalid version:%" PRId64 ", first ver:%" PRId64 ", last ver:%" PRId64, ver, pRead->pWal->vers.firstVer,
|
||||
pRead->pWal->vers.lastVer);
|
||||
terrno = TSDB_CODE_WAL_LOG_NOT_EXIST;
|
||||
return -1;
|
||||
|
@ -436,8 +437,7 @@ int32_t walReadVer(SWalReader *pRead, int64_t ver) {
|
|||
}
|
||||
|
||||
if (pRead->pHead->head.version != ver) {
|
||||
wError("unexpected wal log version: %" PRId64 ", read request version:%" PRId64 "", pRead->pHead->head.version,
|
||||
ver);
|
||||
wError("unexpected wal log version:%" PRId64 ", read request version:%" PRId64 "", pRead->pHead->head.version, ver);
|
||||
pRead->curVersion = -1;
|
||||
terrno = TSDB_CODE_WAL_FILE_CORRUPTED;
|
||||
return -1;
|
||||
|
|
|
@ -318,7 +318,7 @@ int walRoll(SWal *pWal) {
|
|||
static int walWriteIndex(SWal *pWal, int64_t ver, int64_t offset) {
|
||||
SWalIdxEntry entry = {.ver = ver, .offset = offset};
|
||||
int64_t idxOffset = taosLSeekFile(pWal->pWriteIdxTFile, 0, SEEK_END);
|
||||
wDebug("write index: ver: %ld, offset: %ld, at %ld", ver, offset, idxOffset);
|
||||
wDebug("write index, ver:%" PRId64 ", offset:%" PRId64 ", at %" PRId64, ver, offset, idxOffset);
|
||||
int64_t size = taosWriteFile(pWal->pWriteIdxTFile, &entry, sizeof(SWalIdxEntry));
|
||||
if (size != sizeof(SWalIdxEntry)) {
|
||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||
|
|
Loading…
Reference in New Issue