diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 03308e395f9d785229c06eb83e86eadd08666701..9f65f8646a0f1a51e9302336d51f0876c229c8e5 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -695,6 +695,9 @@ int32_t* taosGetErrno(); #define TSDB_CODE_RSMA_INVALID_ENV TAOS_DEF_ERROR_CODE(0, 0x3150) #define TSDB_CODE_RSMA_INVALID_STAT TAOS_DEF_ERROR_CODE(0, 0x3151) +// index +#define TSDB_CODE_INDEX_REBUILD TAOS_DEF_ERROR_CODE(0, 0x3251) + #ifdef __cplusplus } diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 4852dcfb543c879f70dd89d8fbc720735faaa57a..8881646e0dc6e7590905e04c2f8facbe71e5d570 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -54,7 +54,8 @@ typedef struct SCliMsg { } SCliMsg; typedef struct SCliThrdObj { - TdThread thread; + TdThread thread; // tid + int64_t pid; // pid uv_loop_t* loop; SAsyncPool* asyncPool; uv_timer_t timer; @@ -822,6 +823,7 @@ static void cliAsyncCb(uv_async_t* handle) { static void* cliWorkThread(void* arg) { SCliThrdObj* pThrd = (SCliThrdObj*)arg; + pThrd->pid = taosGetSelfPthreadId(); setThreadName("trans-cli-work"); uv_run(pThrd->loop, UV_RUN_DEFAULT); return NULL; @@ -1089,7 +1091,7 @@ void transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STra SCliThrdObj* thrd = ((SCliObj*)pTransInst->tcphandle)->pThreadObj[index]; - tDebug("send request at thread:%d, threadID: %" PRId64 ", msg: %p, dst: %s:%d, app:%p", index, thrd->thread, pReq, + tDebug("send request at thread:%d, threadID: %08" PRId64 ", msg: %p, dst: %s:%d, app:%p", index, thrd->pid, pReq, EPSET_GET_INUSE_IP(&pCtx->epSet), EPSET_GET_INUSE_PORT(&pCtx->epSet), pReq->info.ahandle); ASSERT(transSendAsync(thrd->asyncPool, &(cliMsg->q)) == 0); } @@ -1118,7 +1120,7 @@ void transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransM cliMsg->type = Normal; SCliThrdObj* thrd = ((SCliObj*)pTransInst->tcphandle)->pThreadObj[index]; - tDebug("send request at thread:%d, threadID:%" PRId64 ", msg: %p, dst: %s:%d, app:%p", index, thrd->thread, pReq, + tDebug("send request at thread:%d, threadID:%08" PRId64 ", msg: %p, dst: %s:%d, app:%p", index, thrd->pid, pReq, EPSET_GET_INUSE_IP(&pCtx->epSet), EPSET_GET_INUSE_PORT(&pCtx->epSet), pReq->info.ahandle); transSendAsync(thrd->asyncPool, &(cliMsg->q)); @@ -1149,7 +1151,7 @@ void transSetDefaultAddr(void* ahandle, const char* ip, const char* fqdn) { cliMsg->type = Update; SCliThrdObj* thrd = ((SCliObj*)pTransInst->tcphandle)->pThreadObj[i]; - tDebug("update epset at thread:%d, threadID:%" PRId64 "", i, thrd->thread); + tDebug("update epset at thread:%d, threadID:%08" PRId64 "", i, thrd->pid); transSendAsync(thrd->asyncPool, &(cliMsg->q)); } diff --git a/source/util/src/terror.c b/source/util/src/terror.c index e122ad0ab6ef10afe82a65d874db34131d332b04..850eb257b36e4ff123138be9c95c1902575c642c 100644 --- a/source/util/src/terror.c +++ b/source/util/src/terror.c @@ -566,6 +566,9 @@ TAOS_DEFINE_ERROR(TSDB_CODE_TSMA_RM_SKEY_IN_HASH, "Rm tsma skey in cac TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_ENV, "Invalid rsma env") TAOS_DEFINE_ERROR(TSDB_CODE_RSMA_INVALID_STAT, "Invalid rsma state") +//indx +TAOS_DEFINE_ERROR(TSDB_CODE_INDEX_REBUILD, "Index is rebuilding") + #ifdef TAOS_ERROR_C };