Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e37a89d4
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e37a89d4
编写于
6月 18, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add trace log
上级
5401c687
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
70 addition
and
56 deletion
+70
-56
include/util/ttrace.h
include/util/ttrace.h
+5
-4
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+2
-1
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
+4
-3
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+3
-2
source/dnode/mgmt/node_util/inc/dmUtil.h
source/dnode/mgmt/node_util/inc/dmUtil.h
+4
-2
source/dnode/mnode/impl/inc/mndInt.h
source/dnode/mnode/impl/inc/mndInt.h
+11
-9
source/dnode/mnode/impl/src/mndMain.c
source/dnode/mnode/impl/src/mndMain.c
+9
-8
source/dnode/vnode/src/inc/vnd.h
source/dnode/vnode/src/inc/vnd.h
+3
-1
source/libs/transport/inc/transLog.h
source/libs/transport/inc/transLog.h
+1
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+13
-13
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+15
-12
未找到文件。
include/util/ttrace.h
浏览文件 @
e37a89d4
...
...
@@ -22,7 +22,8 @@ extern "C" {
#endif
#pragma(push, 1)
typedef
struct
{
typedef
struct
STraceId
{
int64_t
rootId
;
int64_t
msgId
;
}
STraceId
;
...
...
@@ -43,9 +44,9 @@ typedef struct {
#define TRACE_GET_MSGID(traceId) (traceId)->msgId
#define TRACE_TO_STR(traceId, buf)
\
do {
\
sprintf(buf, "0x%" PRIx64 ":
0x%" PRIx64 "", traceId->rootId, traceId->msgId); \
#define TRACE_TO_STR(traceId, buf) \
do { \
sprintf(buf, "0x%" PRIx64 ":0x%" PRIx64 "", traceId->rootId, traceId->msgId); \
} while (0)
#ifdef __cplusplus
...
...
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
e37a89d4
...
...
@@ -48,7 +48,8 @@ static inline void mmSendRsp(SRpcMsg *pMsg, int32_t code) {
static
void
mmProcessRpcMsg
(
SQueueInfo
*
pInfo
,
SRpcMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from mnode queue"
,
pMsg
);
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"msg:%p, get from mnode queue"
,
pMsg
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_MON_MM_INFO
:
...
...
source/dnode/mgmt/mgmt_vnode/src/vmWorker.c
浏览文件 @
e37a89d4
...
...
@@ -31,7 +31,8 @@ static void vmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
SVnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
dTrace
(
"msg:%p, get from vnode-mgmt queue"
,
pMsg
);
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"msg:%p, get from vnode-mgmt queue"
,
pMsg
);
switch
(
pMsg
->
msgType
)
{
case
TDMT_MON_VM_INFO
:
code
=
vmProcessGetMonitorInfoReq
(
pMgmt
,
pMsg
);
...
...
@@ -97,7 +98,7 @@ static void vmProcessFetchQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
static
void
vmProcessSyncQueue
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
SRpcMsg
*
pMsg
=
NULL
;
SRpcMsg
*
pMsg
=
NULL
;
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
if
(
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
)
==
0
)
continue
;
...
...
@@ -118,7 +119,7 @@ static void vmProcessSyncQueue(SQueueInfo *pInfo, STaosQall *qall, int32_t numOf
static
void
vmProcessMergeQueue
(
SQueueInfo
*
pInfo
,
STaosQall
*
qall
,
int32_t
numOfMsgs
)
{
SVnodeObj
*
pVnode
=
pInfo
->
ahandle
;
SRpcMsg
*
pMsg
=
NULL
;
SRpcMsg
*
pMsg
=
NULL
;
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
if
(
taosGetQitem
(
qall
,
(
void
**
)
&
pMsg
)
==
0
)
continue
;
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
e37a89d4
...
...
@@ -55,8 +55,9 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
SMgmtWrapper
*
pWrapper
=
NULL
;
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pRpc
->
msgType
)];
dTrace
(
"msg:%s is received, handle:%p len:%d code:0x%x app:%p refId:%"
PRId64
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
info
.
handle
,
pRpc
->
contLen
,
pRpc
->
code
,
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
refId
);
STraceId
*
trace
=
&
pRpc
->
info
.
traceId
;
dGTrace
(
"msg:%s is received, handle:%p len:%d code:0x%x app:%p refId:%"
PRId64
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
info
.
handle
,
pRpc
->
contLen
,
pRpc
->
code
,
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
refId
);
if
(
pRpc
->
msgType
==
TDMT_DND_NET_TEST
)
{
dmProcessNetTestReq
(
pDnode
,
pRpc
);
...
...
source/dnode/mgmt/node_util/inc/dmUtil.h
浏览文件 @
e37a89d4
...
...
@@ -34,13 +34,13 @@
#include "dnode.h"
#include "mnode.h"
#include "qnode.h"
#include "monitor.h"
#include "qnode.h"
#include "sync.h"
#include "wal.h"
#include "libs/function/function.h"
// clang-format off
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -51,6 +51,7 @@ extern "C" {
#define dInfo(...) { if (dDebugFlag & DEBUG_INFO) { taosPrintLog("DND ", DEBUG_INFO, 255, __VA_ARGS__); }}
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
#define dGTrace(param, ...) do { char buf[40] = {0}; TRACE_TO_STR(trace, buf); dTrace(param ",GID: %s", __VA_ARGS__, buf);} while(0)
typedef
enum
{
DNODE
=
0
,
...
...
@@ -184,3 +185,4 @@ void dmSetMnodeEpSet(SDnodeData *pData, SEpSet *pEpSet);
#endif
#endif
/*_TD_DM_INT_H_*/
// clang-format on
source/dnode/mnode/impl/inc/mndInt.h
浏览文件 @
e37a89d4
...
...
@@ -40,6 +40,8 @@ extern "C" {
#define mInfo(...) { if (mDebugFlag & DEBUG_INFO) { taosPrintLog("MND ", DEBUG_INFO, 255, __VA_ARGS__); }}
#define mDebug(...) { if (mDebugFlag & DEBUG_DEBUG) { taosPrintLog("MND ", DEBUG_DEBUG, mDebugFlag, __VA_ARGS__); }}
#define mTrace(...) { if (mDebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", DEBUG_TRACE, mDebugFlag, __VA_ARGS__); }}
#define mGTrace(param, ...) do { char buf[40] = {0}; TRACE_TO_STR(trace, buf); mTrace(param ", GID: %s", __VA_ARGS__, buf);} while(0)
// clang-format on
#define SYSTABLE_SCH_TABLE_NAME_LEN ((TSDB_TABLE_NAME_LEN - 1) + VARSTR_HEADER_SIZE)
...
...
@@ -54,7 +56,7 @@ typedef void (*ShowFreeIterFp)(SMnode *pMnode, void *pIter);
typedef
struct
SQWorker
SQHandle
;
typedef
struct
{
const
char
*
name
;
const
char
*
name
;
MndInitFp
initFp
;
MndCleanupFp
cleanupFp
;
}
SMnodeStep
;
...
...
@@ -63,7 +65,7 @@ typedef struct {
int64_t
showId
;
ShowRetrieveFp
retrieveFps
[
TSDB_MGMT_TABLE_MAX
];
ShowFreeIterFp
freeIterFps
[
TSDB_MGMT_TABLE_MAX
];
SCacheObj
*
cache
;
SCacheObj
*
cache
;
}
SShowMgmt
;
typedef
struct
{
...
...
@@ -99,14 +101,14 @@ typedef struct SMnode {
bool
stopped
;
bool
restored
;
bool
deploy
;
char
*
path
;
char
*
path
;
int64_t
checkTime
;
SSdb
*
pSdb
;
SArray
*
pSteps
;
SQHandle
*
pQuery
;
SHashObj
*
infosMeta
;
SHashObj
*
perfsMeta
;
SWal
*
pWal
;
SSdb
*
pSdb
;
SArray
*
pSteps
;
SQHandle
*
pQuery
;
SHashObj
*
infosMeta
;
SHashObj
*
perfsMeta
;
SWal
*
pWal
;
SShowMgmt
showMgmt
;
SProfileMgmt
profileMgmt
;
STelemMgmt
telemMgmt
;
...
...
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
e37a89d4
...
...
@@ -58,21 +58,21 @@ static void *mndBuildTimerMsg(int32_t *pContLen) {
static
void
mndPullupTrans
(
SMnode
*
pMnode
)
{
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_TRANS_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
WRITE_QUEUE
,
&
rpcMsg
);
}
static
void
mndCalMqRebalance
(
SMnode
*
pMnode
)
{
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_MQ_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
READ_QUEUE
,
&
rpcMsg
);
}
static
void
mndPullupTelem
(
SMnode
*
pMnode
)
{
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_MND_TELEM_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
READ_QUEUE
,
&
rpcMsg
);
}
...
...
@@ -378,7 +378,7 @@ void mndStop(SMnode *pMnode) {
}
int32_t
mndProcessSyncMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SSyncMgmt
*
pMgmt
=
&
pMnode
->
syncMgmt
;
int32_t
code
=
0
;
...
...
@@ -539,7 +539,7 @@ static int32_t mndCheckMsgContent(SRpcMsg *pMsg) {
}
int32_t
mndProcessRpcMsg
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
MndMsgFp
fp
=
pMnode
->
msgFp
[
TMSG_INDEX
(
pMsg
->
msgType
)];
if
(
fp
==
NULL
)
{
mError
(
"msg:%p, failed to get msg handle, app:%p type:%s"
,
pMsg
,
pMsg
->
info
.
ahandle
,
TMSG_INFO
(
pMsg
->
msgType
));
...
...
@@ -550,7 +550,8 @@ int32_t mndProcessRpcMsg(SRpcMsg *pMsg) {
if
(
mndCheckMsgContent
(
pMsg
)
!=
0
)
return
-
1
;
if
(
mndCheckMnodeState
(
pMsg
)
!=
0
)
return
-
1
;
mTrace
(
"msg:%p, start to process in mnode, app:%p type:%s"
,
pMsg
,
pMsg
->
info
.
ahandle
,
TMSG_INFO
(
pMsg
->
msgType
));
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
mGTrace
(
"msg:%p, start to process in mnode, app:%p type:%s"
,
pMsg
,
pMsg
->
info
.
ahandle
,
TMSG_INFO
(
pMsg
->
msgType
));
int32_t
code
=
(
*
fp
)(
pMsg
);
mndReleaseRpcRef
(
pMnode
);
...
...
@@ -591,7 +592,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
SMonGrantInfo
*
pGrantInfo
)
{
if
(
mndAcquireRpcRef
(
pMnode
)
!=
0
)
return
-
1
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int64_t
ms
=
taosGetTimestampMs
();
pClusterInfo
->
dnodes
=
taosArrayInit
(
sdbGetSize
(
pSdb
,
SDB_DNODE
),
sizeof
(
SMonDnodeDesc
));
...
...
@@ -667,7 +668,7 @@ int32_t mndGetMonitorInfo(SMnode *pMnode, SMonClusterInfo *pClusterInfo, SMonVgr
pGrantInfo
->
timeseries_used
+=
pVgroup
->
numOfTimeSeries
;
tstrncpy
(
desc
.
status
,
"unsynced"
,
sizeof
(
desc
.
status
));
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
replica
;
++
i
)
{
SVnodeGid
*
pVgid
=
&
pVgroup
->
vnodeGid
[
i
];
SVnodeGid
*
pVgid
=
&
pVgroup
->
vnodeGid
[
i
];
SMonVnodeDesc
*
pVnDesc
=
&
desc
.
vnodes
[
i
];
pVnDesc
->
dnode_id
=
pVgid
->
dnodeId
;
tstrncpy
(
pVnDesc
->
vnode_role
,
syncStr
(
pVgid
->
role
),
sizeof
(
pVnDesc
->
vnode_role
));
...
...
source/dnode/vnode/src/inc/vnd.h
浏览文件 @
e37a89d4
...
...
@@ -18,6 +18,7 @@
#include "sync.h"
#include "syncTools.h"
#include "ttrace.h"
#include "vnodeInt.h"
#ifdef __cplusplus
...
...
@@ -31,6 +32,7 @@ extern "C" {
#define vInfo(...) do { if (vDebugFlag & DEBUG_INFO) { taosPrintLog("VND ", DEBUG_INFO, 255, __VA_ARGS__); }} while(0)
#define vDebug(...) do { if (vDebugFlag & DEBUG_DEBUG) { taosPrintLog("VND ", DEBUG_DEBUG, vDebugFlag, __VA_ARGS__); }} while(0)
#define vTrace(...) do { if (vDebugFlag & DEBUG_TRACE) { taosPrintLog("VND ", DEBUG_TRACE, vDebugFlag, __VA_ARGS__); }} while(0)
#define vGTrace(...) do { char buf[40] = {0}; TRACE_TO_STR(trace, buf); vTrace(param " GID: %s", __VA_ARGS__, buf);} while(0)//#define vDye(...) do
// clang-format on
// vnodeCfg.c
...
...
@@ -89,4 +91,4 @@ void vnodeSyncClose(SVnode* pVnode);
}
#endif
#endif
/*_TD_VND_H_*/
\ No newline at end of file
#endif
/*_TD_VND_H_*/
source/libs/transport/inc/transLog.h
浏览文件 @
e37a89d4
...
...
@@ -33,7 +33,7 @@ extern "C" {
#define tDump(x, y) do {if (rpcDebugFlag & DEBUG_DUMP) { taosDumpData((unsigned char *)x, y); } } while(0)
//#define tTR(param, ...) do { char buf[40] = {0};TRACE_TO_STR(trace, buf);tTrace("TRID: %s "param, buf, __VA_ARGS__);} while(0)
#define t
TR(param, ...) do { char buf[40] = {0}; TRACE_TO_STR(trace, buf); tTrace(param " TR
ID: %s", __VA_ARGS__, buf);} while(0)
#define t
GTrace(param, ...) do { char buf[40] = {0}; TRACE_TO_STR(trace, buf); tTrace(param ", G
ID: %s", __VA_ARGS__, buf);} while(0)
// clang-format on
#ifdef __cplusplus
...
...
source/libs/transport/src/transCli.c
浏览文件 @
e37a89d4
...
...
@@ -329,9 +329,9 @@ void cliHandleResp(SCliConn* conn) {
// char buf[64] = {0};
// TRACE_TO_STR(&transMsg.info.traceId, buf);
STraceId
*
trace
=
&
transMsg
.
info
.
traceId
;
t
TR
(
"conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, code: %d"
,
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
);
t
GTrace
(
"conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, code: %d"
,
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
);
if
(
pCtx
==
NULL
&&
CONN_NO_PERSIST_BY_APP
(
conn
))
{
tDebug
(
"%s except, server continue send while cli ignore it"
,
CONN_GET_INST_LABEL
(
conn
));
...
...
@@ -650,9 +650,9 @@ void cliSend(SCliConn* pConn) {
// char buf[64] = {0};
// TRACE_TO_STR(&pMsg->info.traceId, buf);
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
t
TR
(
"conn %p %s is sent to %s:%d, local info %s:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
));
t
GTrace
(
"conn %p %s is sent to %s:%d, local info %s:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
));
if
(
pHead
->
persist
==
1
)
{
CONN_SET_PERSIST_BY_APP
(
pConn
);
...
...
@@ -1018,16 +1018,16 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
STraceId
*
trace
=
&
pResp
->
info
.
traceId
;
if
(
pCtx
->
pSem
!=
NULL
)
{
t
TR
(
"conn %p(sync) handle resp"
,
pConn
);
t
GTrace
(
"conn %p(sync) handle resp"
,
pConn
);
if
(
pCtx
->
pRsp
==
NULL
)
{
t
TR
(
"conn %p(sync) failed to resp, ignore"
,
pConn
);
t
GTrace
(
"conn %p(sync) failed to resp, ignore"
,
pConn
);
}
else
{
memcpy
((
char
*
)
pCtx
->
pRsp
,
(
char
*
)
pResp
,
sizeof
(
*
pResp
));
}
tsem_post
(
pCtx
->
pSem
);
pCtx
->
pRsp
=
NULL
;
}
else
{
t
TR
(
"conn %p handle resp"
,
pConn
);
t
GTrace
(
"conn %p handle resp"
,
pConn
);
if
(
pResp
->
code
!=
0
||
pCtx
->
retryCount
==
0
||
transEpSetIsEqual
(
&
pCtx
->
epSet
,
&
pCtx
->
origEpSet
))
{
pTransInst
->
cfp
(
pTransInst
->
parent
,
pResp
,
NULL
);
}
else
{
...
...
@@ -1110,8 +1110,8 @@ void transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STra
SCliThrdObj
*
thrd
=
((
SCliObj
*
)
pTransInst
->
tcphandle
)
->
pThreadObj
[
idx
];
STraceId
*
trace
=
&
pReq
->
info
.
traceId
;
t
TR
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
pTransInst
->
label
,
thrd
->
pid
,
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
),
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
),
pReq
->
info
.
ahandle
);
t
GTrace
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
pTransInst
->
label
,
thrd
->
pid
,
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
),
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
),
pReq
->
info
.
ahandle
);
ASSERT
(
transSendAsync
(
thrd
->
asyncPool
,
&
(
cliMsg
->
q
))
==
0
);
}
...
...
@@ -1143,8 +1143,8 @@ void transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransM
SCliThrdObj
*
thrd
=
((
SCliObj
*
)
pTransInst
->
tcphandle
)
->
pThreadObj
[
idx
];
STraceId
*
trace
=
&
pReq
->
info
.
traceId
;
t
TR
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
pTransInst
->
label
,
thrd
->
pid
,
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
),
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
),
pReq
->
info
.
ahandle
);
t
GTrace
(
"%s send request at thread:%08"
PRId64
", dst: %s:%d, app:%p"
,
pTransInst
->
label
,
thrd
->
pid
,
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
),
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
),
pReq
->
info
.
ahandle
);
transSendAsync
(
thrd
->
asyncPool
,
&
(
cliMsg
->
q
));
tsem_wait
(
sem
);
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
e37a89d4
...
...
@@ -284,14 +284,14 @@ static void uvHandleReq(SSvrConn* pConn) {
if
(
pConn
->
status
==
ConnNormal
&&
pHead
->
noResp
==
0
)
{
transRefSrvHandle
(
pConn
);
t
TR
(
"conn %p %s received from %s:%d, local info: %s:%d, msg size: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
),
transMsg
.
contLen
);
t
GTrace
(
"conn %p %s received from %s:%d, local info: %s:%d, msg size: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
),
transMsg
.
contLen
);
}
else
{
t
TR
(
"conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, resp:%d, code: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
),
transMsg
.
contLen
,
pHead
->
noResp
,
transMsg
.
code
);
t
GTrace
(
"conn %p %s received from %s:%d, local info: %s:%d, msg size: %d, resp:%d, code: %d"
,
pConn
,
TMSG_INFO
(
transMsg
.
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
),
transMsg
.
contLen
,
pHead
->
noResp
,
transMsg
.
code
);
// no ref here
}
...
...
@@ -304,7 +304,7 @@ static void uvHandleReq(SSvrConn* pConn) {
transMsg
.
info
.
refId
=
pConn
->
refId
;
transMsg
.
info
.
traceId
=
pHead
->
traceId
;
t
TR
(
"handle %p conn: %p translated to app, refId: %"
PRIu64
""
,
transMsg
.
info
.
handle
,
pConn
,
pConn
->
refId
);
t
GTrace
(
"handle %p conn: %p translated to app, refId: %"
PRIu64
""
,
transMsg
.
info
.
handle
,
pConn
,
pConn
->
refId
);
assert
(
transMsg
.
info
.
handle
!=
NULL
);
if
(
pHead
->
noResp
==
1
)
{
...
...
@@ -457,9 +457,9 @@ static void uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) {
int32_t
len
=
transMsgLenFromCont
(
pMsg
->
contLen
);
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
t
TR
(
"conn %p %s is sent to %s:%d, local info: %s:%d, msglen:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
),
len
);
t
GTrace
(
"conn %p %s is sent to %s:%d, local info: %s:%d, msglen:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
localAddr
.
sin_addr
),
ntohs
(
pConn
->
localAddr
.
sin_port
),
len
);
pHead
->
msgLen
=
htonl
(
len
);
wb
->
base
=
msg
;
...
...
@@ -1121,7 +1121,9 @@ void transSendResponse(const STransMsg* msg) {
SSvrMsg
*
m
=
taosMemoryCalloc
(
1
,
sizeof
(
SSvrMsg
));
m
->
msg
=
tmsg
;
m
->
type
=
Normal
;
tDebug
(
"conn %p start to send resp (1/2)"
,
exh
->
handle
);
STraceId
*
trace
=
(
STraceId
*
)
&
msg
->
info
.
traceId
;
tGTrace
(
"conn %p start to send resp (1/2)"
,
exh
->
handle
);
transSendAsync
(
pThrd
->
asyncPool
,
&
m
->
q
);
transReleaseExHandle
(
refMgt
,
refId
);
return
;
...
...
@@ -1149,6 +1151,7 @@ void transRegisterMsg(const STransMsg* msg) {
SSvrMsg
*
m
=
taosMemoryCalloc
(
1
,
sizeof
(
SSvrMsg
));
m
->
msg
=
tmsg
;
m
->
type
=
Register
;
tTrace
(
"conn %p start to register brokenlink callback"
,
exh
->
handle
);
transSendAsync
(
pThrd
->
asyncPool
,
&
m
->
q
);
transReleaseExHandle
(
refMgt
,
refId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录