Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6d0b51bf
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看板
提交
6d0b51bf
编写于
5月 16, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: adjust SRpcMsg handle to info
上级
b765f21e
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
61 addition
and
107 deletion
+61
-107
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+11
-16
source/common/src/tmsgcb.c
source/common/src/tmsgcb.c
+2
-2
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+1
-1
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
+1
-3
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+12
-10
source/dnode/mnode/impl/src/mndQuery.c
source/dnode/mnode/impl/src/mndQuery.c
+8
-8
source/dnode/vnode/src/vnd/vnodeSync.c
source/dnode/vnode/src/vnd/vnodeSync.c
+1
-3
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+5
-15
source/libs/qworker/src/qworkerMsg.c
source/libs/qworker/src/qworkerMsg.c
+20
-49
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
6d0b51bf
...
@@ -38,24 +38,19 @@ typedef struct {
...
@@ -38,24 +38,19 @@ typedef struct {
typedef
struct
{
typedef
struct
{
// rpc info
// rpc info
struct
{
void
*
handle
;
// rpc handle returned to app
void
*
handle
;
// rpc handle returned to app
int64_t
refId
;
// refid, used by server
int64_t
refId
;
// refid, used by server
int32_t
noResp
;
// has response or not(default 0, 0: resp, 1: no resp);
int32_t
noResp
;
// has response or not(default 0, 0: resp, 1: no resp);
int32_t
persistHandle
;
// persist handle or not
int32_t
persistHandle
;
// persist handle or not
};
// app info
// app info
struct
{
void
*
ahandle
;
// app handle set by client
void
*
ahandle
;
// app handle set by client
void
*
proc
;
// proc handle
void
*
wrapper
;
// wrapper handle
void
*
wrapper
;
// wrapper handle
void
*
node
;
// node mgmt handle
void
*
node
;
// node mgmt handle
};
// resp info
// resp info
struct
{
void
*
rsp
;
void
*
rsp
;
int32_t
rspLen
;
int32_t
rspLen
;
};
}
SRpcHandleInfo
;
}
SRpcHandleInfo
;
typedef
struct
SRpcMsg
{
typedef
struct
SRpcMsg
{
...
...
source/common/src/tmsgcb.c
浏览文件 @
6d0b51bf
...
@@ -39,10 +39,10 @@ int32_t tmsgSendReq(const SMsgCb* pMsgCb, const SEpSet* epSet, SRpcMsg* pReq) {
...
@@ -39,10 +39,10 @@ int32_t tmsgSendReq(const SMsgCb* pMsgCb, const SEpSet* epSet, SRpcMsg* pReq) {
return
(
*
fp
)(
pMsgCb
->
pWrapper
,
epSet
,
pReq
);
return
(
*
fp
)(
pMsgCb
->
pWrapper
,
epSet
,
pReq
);
}
}
void
tmsgSendRsp
(
SRpcMsg
*
p
Rsp
)
{
void
tmsgSendRsp
(
SRpcMsg
*
p
Msg
)
{
// cannot be empty, but not checked for faster detect
// cannot be empty, but not checked for faster detect
SendRspFp
fp
=
tsDefaultMsgCb
.
sendRspFp
;
SendRspFp
fp
=
tsDefaultMsgCb
.
sendRspFp
;
return
(
*
fp
)(
p
Rsp
);
return
(
*
fp
)(
p
Msg
);
}
}
void
tmsgSendRedirectRsp
(
SRpcMsg
*
pRsp
,
const
SEpSet
*
pNewEpSet
)
{
void
tmsgSendRedirectRsp
(
SRpcMsg
*
pRsp
,
const
SEpSet
*
pNewEpSet
)
{
...
...
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
浏览文件 @
6d0b51bf
...
@@ -143,7 +143,7 @@ int32_t dmProcessServerRunStatus(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
...
@@ -143,7 +143,7 @@ int32_t dmProcessServerRunStatus(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
SServerStatusRsp
statusRsp
=
{
0
};
SServerStatusRsp
statusRsp
=
{
0
};
dmGetServerRunStatus
(
pMgmt
,
&
statusRsp
);
dmGetServerRunStatus
(
pMgmt
,
&
statusRsp
);
SRpcMsg
rspMsg
=
{.
info
.
handle
=
pMsg
->
info
.
handle
,
.
info
.
ahandle
=
pMsg
->
info
.
ahandle
,
.
info
.
refId
=
pMsg
->
info
.
refId
};
SRpcMsg
rspMsg
=
{.
info
=
pMsg
->
info
};
int32_t
rspLen
=
tSerializeSServerStatusRsp
(
NULL
,
0
,
&
statusRsp
);
int32_t
rspLen
=
tSerializeSServerStatusRsp
(
NULL
,
0
,
&
statusRsp
);
if
(
rspLen
<
0
)
{
if
(
rspLen
<
0
)
{
rspMsg
.
code
=
TSDB_CODE_OUT_OF_MEMORY
;
rspMsg
.
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
浏览文件 @
6d0b51bf
...
@@ -150,10 +150,8 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
...
@@ -150,10 +150,8 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
if
(
isRequest
)
{
if
(
isRequest
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
SRpcMsg
rsp
=
{
SRpcMsg
rsp
=
{
.
info
.
handle
=
pMsg
->
info
.
handle
,
.
info
.
ahandle
=
pMsg
->
info
.
ahandle
,
.
code
=
code
,
.
code
=
code
,
.
info
.
refId
=
pMsg
->
info
.
refId
,
.
info
=
pMsg
->
info
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
pCont
=
pMsg
->
info
.
rsp
,
.
contLen
=
pMsg
->
info
.
rspLen
,
.
contLen
=
pMsg
->
info
.
rspLen
,
};
};
...
...
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
6d0b51bf
...
@@ -57,6 +57,12 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
...
@@ -57,6 +57,12 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
dTrace
(
"msg:%s is received, handle:%p cont:%p len:%d code:0x%04x app:%p refId:%"
PRId64
,
TMSG_INFO
(
pRpc
->
msgType
),
dTrace
(
"msg:%s is received, handle:%p cont:%p len:%d code:0x%04x app:%p refId:%"
PRId64
,
TMSG_INFO
(
pRpc
->
msgType
),
pRpc
->
info
.
handle
,
pRpc
->
pCont
,
pRpc
->
contLen
,
pRpc
->
code
,
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
refId
);
pRpc
->
info
.
handle
,
pRpc
->
pCont
,
pRpc
->
contLen
,
pRpc
->
code
,
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
refId
);
pRpc
->
info
.
noResp
=
0
;
pRpc
->
info
.
persistHandle
=
0
;
pRpc
->
info
.
wrapper
=
NULL
;
pRpc
->
info
.
node
=
NULL
;
pRpc
->
info
.
rsp
=
NULL
;
pRpc
->
info
.
rspLen
=
0
;
if
(
pRpc
->
msgType
==
TDMT_DND_NET_TEST
)
{
if
(
pRpc
->
msgType
==
TDMT_DND_NET_TEST
)
{
dmProcessNetTestReq
(
pDnode
,
pRpc
);
dmProcessNetTestReq
(
pDnode
,
pRpc
);
...
@@ -72,12 +78,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
...
@@ -72,12 +78,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
if
(
pRpc
->
msgType
==
TDMT_DND_SERVER_STATUS
)
{
if
(
pRpc
->
msgType
==
TDMT_DND_SERVER_STATUS
)
{
dmProcessServerStartupStatus
(
pDnode
,
pRpc
);
dmProcessServerStartupStatus
(
pDnode
,
pRpc
);
}
else
{
}
else
{
SRpcMsg
rspMsg
=
{
SRpcMsg
rspMsg
=
{.
info
=
pRpc
->
info
,
.
code
=
TSDB_CODE_APP_NOT_READY
};
.
info
.
handle
=
pRpc
->
info
.
handle
,
.
code
=
TSDB_CODE_APP_NOT_READY
,
.
info
.
ahandle
=
pRpc
->
info
.
ahandle
,
.
info
.
refId
=
pRpc
->
info
.
refId
,
};
rpcSendResponse
(
&
rspMsg
);
rpcSendResponse
(
&
rspMsg
);
}
}
return
;
return
;
...
@@ -116,6 +117,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
...
@@ -116,6 +117,7 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
goto
_OVER
;
goto
_OVER
;
}
else
{
}
else
{
needRelease
=
true
;
needRelease
=
true
;
pRpc
->
info
.
wrapper
=
pWrapper
;
}
}
pMsg
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
),
RPC_QITEM
);
pMsg
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
),
RPC_QITEM
);
...
@@ -251,12 +253,12 @@ static inline int32_t dmSendReq(SMgmtWrapper *pWrapper, const SEpSet *pEpSet, SR
...
@@ -251,12 +253,12 @@ static inline int32_t dmSendReq(SMgmtWrapper *pWrapper, const SEpSet *pEpSet, SR
return
0
;
return
0
;
}
}
static
inline
void
dmSendRsp
(
const
SRpcMsg
*
p
Rsp
)
{
static
inline
void
dmSendRsp
(
const
SRpcMsg
*
p
Msg
)
{
SMgmtWrapper
*
pWrapper
=
p
Rsp
->
info
.
wrapper
;
SMgmtWrapper
*
pWrapper
=
p
Msg
->
info
.
wrapper
;
if
(
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
if
(
InChildProc
(
pWrapper
->
proc
.
ptype
))
{
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
p
Rsp
,
sizeof
(
SRpcMsg
),
pRsp
->
pCont
,
pRsp
->
contLen
,
DND_FUNC_RSP
);
dmPutToProcPQueue
(
&
pWrapper
->
proc
,
p
Msg
,
sizeof
(
SRpcMsg
),
pMsg
->
pCont
,
pMsg
->
contLen
,
DND_FUNC_RSP
);
}
else
{
}
else
{
dmSendRpcRsp
(
pWrapper
->
pDnode
,
p
Rsp
);
dmSendRpcRsp
(
pWrapper
->
pDnode
,
p
Msg
);
}
}
}
}
...
...
source/dnode/mnode/impl/src/mndQuery.c
浏览文件 @
6d0b51bf
...
@@ -34,19 +34,19 @@ int32_t mndProcessQueryMsg(SRpcMsg *pReq) {
...
@@ -34,19 +34,19 @@ int32_t mndProcessQueryMsg(SRpcMsg *pReq) {
}
}
}
}
int32_t
mndProcessFetchMsg
(
SRpcMsg
*
p
Req
)
{
int32_t
mndProcessFetchMsg
(
SRpcMsg
*
p
Msg
)
{
SMnode
*
pMnode
=
p
Req
->
info
.
node
;
SMnode
*
pMnode
=
p
Msg
->
info
.
node
;
mTrace
(
"msg:%p, in fetch queue is processing"
,
p
Req
);
mTrace
(
"msg:%p, in fetch queue is processing"
,
p
Msg
);
switch
(
p
Req
->
msgType
)
{
switch
(
p
Msg
->
msgType
)
{
case
TDMT_VND_FETCH
:
case
TDMT_VND_FETCH
:
return
qWorkerProcessFetchMsg
(
pMnode
,
pMnode
->
pQuery
,
p
Req
);
return
qWorkerProcessFetchMsg
(
pMnode
,
pMnode
->
pQuery
,
p
Msg
);
case
TDMT_VND_DROP_TASK
:
case
TDMT_VND_DROP_TASK
:
return
qWorkerProcessDropMsg
(
pMnode
,
pMnode
->
pQuery
,
p
Req
);
return
qWorkerProcessDropMsg
(
pMnode
,
pMnode
->
pQuery
,
p
Msg
);
case
TDMT_VND_QUERY_HEARTBEAT
:
case
TDMT_VND_QUERY_HEARTBEAT
:
return
qWorkerProcessHbMsg
(
pMnode
,
pMnode
->
pQuery
,
p
Req
);
return
qWorkerProcessHbMsg
(
pMnode
,
pMnode
->
pQuery
,
p
Msg
);
default:
default:
mError
(
"unknown msg type:%d in fetch queue"
,
p
Req
->
msgType
);
mError
(
"unknown msg type:%d in fetch queue"
,
p
Msg
->
msgType
);
return
TSDB_CODE_VND_APP_ERROR
;
return
TSDB_CODE_VND_APP_ERROR
;
}
}
}
}
...
...
source/dnode/vnode/src/vnd/vnodeSync.c
浏览文件 @
6d0b51bf
...
@@ -127,9 +127,7 @@ void vnodeSyncCommitCb(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cb
...
@@ -127,9 +127,7 @@ void vnodeSyncCommitCb(struct SSyncFSM *pFsm, const SRpcMsg *pMsg, SFsmCbMeta cb
SRpcMsg
saveRpcMsg
;
SRpcMsg
saveRpcMsg
;
int32_t
ret
=
syncGetAndDelRespRpc
(
pVnode
->
sync
,
cbMeta
.
seqNum
,
&
saveRpcMsg
);
int32_t
ret
=
syncGetAndDelRespRpc
(
pVnode
->
sync
,
cbMeta
.
seqNum
,
&
saveRpcMsg
);
if
(
ret
==
1
&&
cbMeta
.
state
==
TAOS_SYNC_STATE_LEADER
)
{
if
(
ret
==
1
&&
cbMeta
.
state
==
TAOS_SYNC_STATE_LEADER
)
{
applyMsg
.
info
.
handle
=
saveRpcMsg
.
info
.
handle
;
applyMsg
.
info
=
saveRpcMsg
.
info
;
applyMsg
.
info
.
ahandle
=
saveRpcMsg
.
info
.
ahandle
;
applyMsg
.
info
.
refId
=
saveRpcMsg
.
info
.
refId
;
}
else
{
}
else
{
applyMsg
.
info
.
handle
=
NULL
;
applyMsg
.
info
.
handle
=
NULL
;
applyMsg
.
info
.
ahandle
=
NULL
;
applyMsg
.
info
.
ahandle
=
NULL
;
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
6d0b51bf
...
@@ -535,12 +535,7 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
...
@@ -535,12 +535,7 @@ int32_t qwHandleTaskComplete(QW_FPARAMS_DEF, SQWTaskCtx *ctx) {
SExplainExecInfo
*
execInfo
=
NULL
;
SExplainExecInfo
*
execInfo
=
NULL
;
int32_t
resNum
=
0
;
int32_t
resNum
=
0
;
QW_ERR_RET
(
qGetExplainExecInfo
(
ctx
->
taskHandle
,
&
resNum
,
&
execInfo
));
QW_ERR_RET
(
qGetExplainExecInfo
(
ctx
->
taskHandle
,
&
resNum
,
&
execInfo
));
QW_ERR_RET
(
qwBuildAndSendExplainRsp
(
&
ctx
->
ctrlConnInfo
,
execInfo
,
resNum
));
SRpcHandleInfo
connInfo
=
{
0
};
connInfo
.
handle
=
ctx
->
ctrlConnInfo
.
handle
;
connInfo
.
refId
=
ctx
->
ctrlConnInfo
.
refId
;
QW_ERR_RET
(
qwBuildAndSendExplainRsp
(
&
connInfo
,
execInfo
,
resNum
));
}
}
qwFreeTaskHandle
(
QW_FPARAMS
(),
taskHandle
);
qwFreeTaskHandle
(
QW_FPARAMS
(),
taskHandle
);
...
@@ -865,8 +860,7 @@ int32_t qwHandlePostPhaseEvents(QW_FPARAMS_DEF, int8_t phase, SQWPhaseInput *inp
...
@@ -865,8 +860,7 @@ int32_t qwHandlePostPhaseEvents(QW_FPARAMS_DEF, int8_t phase, SQWPhaseInput *inp
QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_READY);
QW_SET_EVENT_PROCESSED(ctx, QW_EVENT_READY);
}
}
#else
#else
connInfo
.
handle
=
ctx
->
ctrlConnInfo
.
handle
;
connInfo
=
ctx
->
ctrlConnInfo
;
connInfo
.
refId
=
ctx
->
ctrlConnInfo
.
refId
;
readyConnection
=
&
connInfo
;
readyConnection
=
&
connInfo
;
QW_SET_EVENT_PROCESSED
(
ctx
,
QW_EVENT_READY
);
QW_SET_EVENT_PROCESSED
(
ctx
,
QW_EVENT_READY
);
...
@@ -943,9 +937,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex
...
@@ -943,9 +937,7 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex
atomic_store_8
(
&
ctx
->
taskType
,
taskType
);
atomic_store_8
(
&
ctx
->
taskType
,
taskType
);
atomic_store_8
(
&
ctx
->
explain
,
explain
);
atomic_store_8
(
&
ctx
->
explain
,
explain
);
atomic_store_ptr
(
&
ctx
->
ctrlConnInfo
.
handle
,
qwMsg
->
connInfo
.
handle
);
ctx
->
ctrlConnInfo
=
qwMsg
->
connInfo
;
atomic_store_ptr
(
&
ctx
->
ctrlConnInfo
.
ahandle
,
qwMsg
->
connInfo
.
ahandle
);
atomic_store_64
(
&
ctx
->
ctrlConnInfo
.
refId
,
qwMsg
->
connInfo
.
refId
);
QW_TASK_DLOGL
(
"subplan json string, len:%d, %s"
,
qwMsg
->
msgLen
,
qwMsg
->
msg
);
QW_TASK_DLOGL
(
"subplan json string, len:%d, %s"
,
qwMsg
->
msgLen
,
qwMsg
->
msg
);
...
@@ -1010,8 +1002,7 @@ int32_t qwProcessReady(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
...
@@ -1010,8 +1002,7 @@ int32_t qwProcessReady(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
}
}
if
(
ctx
->
phase
==
QW_PHASE_PRE_QUERY
)
{
if
(
ctx
->
phase
==
QW_PHASE_PRE_QUERY
)
{
ctx
->
ctrlConnInfo
.
handle
=
qwMsg
->
connInfo
.
handle
;
ctx
->
ctrlConnInfo
=
qwMsg
->
connInfo
;
ctx
->
ctrlConnInfo
.
ahandle
=
qwMsg
->
connInfo
.
ahandle
;
QW_SET_EVENT_RECEIVED
(
ctx
,
QW_EVENT_READY
);
QW_SET_EVENT_RECEIVED
(
ctx
,
QW_EVENT_READY
);
needRsp
=
false
;
needRsp
=
false
;
QW_TASK_DLOG_E
(
"ready msg will not rsp now"
);
QW_TASK_DLOG_E
(
"ready msg will not rsp now"
);
...
@@ -1244,8 +1235,7 @@ int32_t qwProcessDrop(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
...
@@ -1244,8 +1235,7 @@ int32_t qwProcessDrop(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
}
}
if
(
!
rsped
)
{
if
(
!
rsped
)
{
ctx
->
ctrlConnInfo
.
handle
=
qwMsg
->
connInfo
.
handle
;
ctx
->
ctrlConnInfo
=
qwMsg
->
connInfo
;
ctx
->
ctrlConnInfo
.
ahandle
=
qwMsg
->
connInfo
.
ahandle
;
QW_SET_EVENT_RECEIVED
(
ctx
,
QW_EVENT_DROP
);
QW_SET_EVENT_RECEIVED
(
ctx
,
QW_EVENT_DROP
);
}
}
...
...
source/libs/qworker/src/qworkerMsg.c
浏览文件 @
6d0b51bf
...
@@ -52,10 +52,10 @@ int32_t qwBuildAndSendQueryRsp(SRpcHandleInfo *pConn, int32_t code) {
...
@@ -52,10 +52,10 @@ int32_t qwBuildAndSendQueryRsp(SRpcHandleInfo *pConn, int32_t code) {
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_QUERY_RSP
,
.
msgType
=
TDMT_VND_QUERY_RSP
,
.
info
=
pConn
,
.
pCont
=
msg
,
.
pCont
=
msg
,
.
contLen
=
contLen
,
.
contLen
=
contLen
,
.
code
=
code
,
.
code
=
code
,
.
info
=
*
pConn
,
};
};
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -69,12 +69,12 @@ int32_t qwBuildAndSendReadyRsp(SRpcHandleInfo *pConn, int32_t code) {
...
@@ -69,12 +69,12 @@ int32_t qwBuildAndSendReadyRsp(SRpcHandleInfo *pConn, int32_t code) {
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_RES_READY_RSP
,
.
msgType
=
TDMT_VND_RES_READY_RSP
,
.
info
=
pConn
,
.
info
.
ahandle
=
NULL
,
.
pCont
=
pRsp
,
.
pCont
=
pRsp
,
.
contLen
=
sizeof
(
*
pRsp
),
.
contLen
=
sizeof
(
*
pRsp
),
.
code
=
code
,
.
code
=
code
,
.
info
=
*
pConn
,
};
};
rpcRsp
.
info
.
ahandle
=
NULL
,
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -90,10 +90,10 @@ int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SExplainExecInfo *execIn
...
@@ -90,10 +90,10 @@ int32_t qwBuildAndSendExplainRsp(SRpcHandleInfo *pConn, SExplainExecInfo *execIn
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_EXPLAIN_RSP
,
.
msgType
=
TDMT_VND_EXPLAIN_RSP
,
.
info
=
pConn
,
.
pCont
=
pRsp
,
.
pCont
=
pRsp
,
.
contLen
=
contLen
,
.
contLen
=
contLen
,
.
code
=
0
,
.
code
=
0
,
.
info
=
*
pConn
,
};
};
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -108,10 +108,10 @@ int32_t qwBuildAndSendHbRsp(SRpcHandleInfo *pConn, SSchedulerHbRsp *pStatus, int
...
@@ -108,10 +108,10 @@ int32_t qwBuildAndSendHbRsp(SRpcHandleInfo *pConn, SSchedulerHbRsp *pStatus, int
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_QUERY_HEARTBEAT_RSP
,
.
msgType
=
TDMT_VND_QUERY_HEARTBEAT_RSP
,
.
info
=
pConn
,
.
pCont
=
pRsp
,
.
contLen
=
contLen
,
.
contLen
=
contLen
,
.
pCont
=
pRsp
,
.
code
=
code
,
.
code
=
code
,
.
info
=
*
pConn
,
};
};
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -128,10 +128,10 @@ int32_t qwBuildAndSendFetchRsp(SRpcHandleInfo *pConn, SRetrieveTableRsp *pRsp, i
...
@@ -128,10 +128,10 @@ int32_t qwBuildAndSendFetchRsp(SRpcHandleInfo *pConn, SRetrieveTableRsp *pRsp, i
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_FETCH_RSP
,
.
msgType
=
TDMT_VND_FETCH_RSP
,
.
info
=
pConn
,
.
pCont
=
pRsp
,
.
pCont
=
pRsp
,
.
contLen
=
sizeof
(
*
pRsp
)
+
dataLength
,
.
contLen
=
sizeof
(
*
pRsp
)
+
dataLength
,
.
code
=
code
,
.
code
=
code
,
.
info
=
*
pConn
,
};
};
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -145,10 +145,10 @@ int32_t qwBuildAndSendCancelRsp(SRpcHandleInfo *pConn, int32_t code) {
...
@@ -145,10 +145,10 @@ int32_t qwBuildAndSendCancelRsp(SRpcHandleInfo *pConn, int32_t code) {
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_CANCEL_TASK_RSP
,
.
msgType
=
TDMT_VND_CANCEL_TASK_RSP
,
.
info
=
pConn
,
.
pCont
=
pRsp
,
.
pCont
=
pRsp
,
.
contLen
=
sizeof
(
*
pRsp
),
.
contLen
=
sizeof
(
*
pRsp
),
.
code
=
code
,
.
code
=
code
,
.
info
=
*
pConn
,
};
};
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -161,10 +161,10 @@ int32_t qwBuildAndSendDropRsp(SRpcHandleInfo *pConn, int32_t code) {
...
@@ -161,10 +161,10 @@ int32_t qwBuildAndSendDropRsp(SRpcHandleInfo *pConn, int32_t code) {
SRpcMsg
rpcRsp
=
{
SRpcMsg
rpcRsp
=
{
.
msgType
=
TDMT_VND_DROP_TASK_RSP
,
.
msgType
=
TDMT_VND_DROP_TASK_RSP
,
.
info
=
pConn
,
.
pCont
=
pRsp
,
.
pCont
=
pRsp
,
.
contLen
=
sizeof
(
*
pRsp
),
.
contLen
=
sizeof
(
*
pRsp
),
.
code
=
code
,
.
code
=
code
,
.
info
=
*
pConn
,
};
};
tmsgSendRsp
(
&
rpcRsp
);
tmsgSendRsp
(
&
rpcRsp
);
...
@@ -254,13 +254,11 @@ int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
...
@@ -254,13 +254,11 @@ int32_t qwBuildAndSendCQueryMsg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
req
->
taskId
=
tId
;
req
->
taskId
=
tId
;
SRpcMsg
pNewMsg
=
{
SRpcMsg
pNewMsg
=
{
.
info
.
handle
=
pConn
->
handle
,
.
info
.
ahandle
=
pConn
->
ahandle
,
.
msgType
=
TDMT_VND_QUERY_CONTINUE
,
.
msgType
=
TDMT_VND_QUERY_CONTINUE
,
.
info
.
refId
=
pConn
->
refId
,
.
pCont
=
req
,
.
pCont
=
req
,
.
contLen
=
sizeof
(
SQueryContinueReq
),
.
contLen
=
sizeof
(
SQueryContinueReq
),
.
code
=
0
,
.
code
=
0
,
.
info
=
*
pConn
,
};
};
int32_t
code
=
tmsgPutToQueue
(
&
mgmt
->
msgCb
,
QUERY_QUEUE
,
&
pNewMsg
);
int32_t
code
=
tmsgPutToQueue
(
&
mgmt
->
msgCb
,
QUERY_QUEUE
,
&
pNewMsg
);
...
@@ -289,13 +287,11 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
...
@@ -289,13 +287,11 @@ int32_t qwRegisterQueryBrokenLinkArg(QW_FPARAMS_DEF, SRpcHandleInfo *pConn) {
req
->
refId
=
htobe64
(
rId
);
req
->
refId
=
htobe64
(
rId
);
SRpcMsg
pMsg
=
{
SRpcMsg
pMsg
=
{
.
info
.
handle
=
pConn
->
handle
,
.
info
.
ahandle
=
pConn
->
ahandle
,
.
info
.
refId
=
pConn
->
refId
,
.
msgType
=
TDMT_VND_DROP_TASK
,
.
msgType
=
TDMT_VND_DROP_TASK
,
.
pCont
=
req
,
.
pCont
=
req
,
.
contLen
=
sizeof
(
STaskDropReq
),
.
contLen
=
sizeof
(
STaskDropReq
),
.
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
,
.
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
,
.
info
=
*
pConn
,
};
};
tmsgRegisterBrokenLinkArg
(
&
mgmt
->
msgCb
,
&
pMsg
);
tmsgRegisterBrokenLinkArg
(
&
mgmt
->
msgCb
,
&
pMsg
);
...
@@ -325,13 +321,11 @@ int32_t qwRegisterHbBrokenLinkArg(SQWorker *mgmt, uint64_t sId, SRpcHandleInfo *
...
@@ -325,13 +321,11 @@ int32_t qwRegisterHbBrokenLinkArg(SQWorker *mgmt, uint64_t sId, SRpcHandleInfo *
}
}
SRpcMsg
pMsg
=
{
SRpcMsg
pMsg
=
{
.
info
.
handle
=
pConn
->
handle
,
.
info
.
ahandle
=
pConn
->
ahandle
,
.
info
.
refId
=
pConn
->
refId
,
.
msgType
=
TDMT_VND_QUERY_HEARTBEAT
,
.
msgType
=
TDMT_VND_QUERY_HEARTBEAT
,
.
pCont
=
msg
,
.
pCont
=
msg
,
.
contLen
=
msgSize
,
.
contLen
=
msgSize
,
.
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
,
.
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
,
.
info
=
*
pConn
,
};
};
tmsgRegisterBrokenLinkArg
(
&
mgmt
->
msgCb
,
&
pMsg
);
tmsgRegisterBrokenLinkArg
(
&
mgmt
->
msgCb
,
&
pMsg
);
...
@@ -365,11 +359,7 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -365,11 +359,7 @@ int32_t qWorkerProcessQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
uint64_t
tId
=
msg
->
taskId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
msg
->
refId
;
int64_t
rId
=
msg
->
refId
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
msg
->
msg
+
msg
->
sqlLen
,
.
msgLen
=
msg
->
phyLen
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
msg
->
msg
+
msg
->
sqlLen
,
.
msgLen
=
msg
->
phyLen
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
char
*
sql
=
strndup
(
msg
->
msg
,
msg
->
sqlLen
);
char
*
sql
=
strndup
(
msg
->
msg
,
msg
->
sqlLen
);
QW_SCH_TASK_DLOG
(
"processQuery start, node:%p, handle:%p, sql:%s"
,
node
,
pMsg
->
info
.
handle
,
sql
);
QW_SCH_TASK_DLOG
(
"processQuery start, node:%p, handle:%p, sql:%s"
,
node
,
pMsg
->
info
.
handle
,
sql
);
taosMemoryFreeClear
(
sql
);
taosMemoryFreeClear
(
sql
);
...
@@ -400,10 +390,7 @@ int32_t qWorkerProcessCQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -400,10 +390,7 @@ int32_t qWorkerProcessCQueryMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
uint64_t
tId
=
msg
->
taskId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
0
;
int64_t
rId
=
0
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
QW_SCH_TASK_DLOG
(
"processCQuery start, node:%p, handle:%p"
,
node
,
pMsg
->
info
.
handle
);
QW_SCH_TASK_DLOG
(
"processCQuery start, node:%p, handle:%p"
,
node
,
pMsg
->
info
.
handle
);
...
@@ -435,10 +422,7 @@ int32_t qWorkerProcessReadyMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -435,10 +422,7 @@ int32_t qWorkerProcessReadyMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
uint64_t
tId
=
msg
->
taskId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
0
;
int64_t
rId
=
0
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
QW_SCH_TASK_DLOG
(
"processReady start, node:%p, handle:%p"
,
node
,
pMsg
->
info
.
handle
);
QW_SCH_TASK_DLOG
(
"processReady start, node:%p, handle:%p"
,
node
,
pMsg
->
info
.
handle
);
...
@@ -498,10 +482,7 @@ int32_t qWorkerProcessFetchMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -498,10 +482,7 @@ int32_t qWorkerProcessFetchMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
uint64_t
tId
=
msg
->
taskId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
0
;
int64_t
rId
=
0
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
QW_SCH_TASK_DLOG
(
"processFetch start, node:%p, handle:%p"
,
node
,
pMsg
->
info
.
handle
);
QW_SCH_TASK_DLOG
(
"processFetch start, node:%p, handle:%p"
,
node
,
pMsg
->
info
.
handle
);
...
@@ -540,10 +521,7 @@ int32_t qWorkerProcessCancelMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -540,10 +521,7 @@ int32_t qWorkerProcessCancelMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
uint64_t
tId
=
msg
->
taskId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
msg
->
refId
;
int64_t
rId
=
msg
->
refId
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
// QW_ERR_JRET(qwCancelTask(qWorkerMgmt, msg->sId, msg->queryId, msg->taskId));
// QW_ERR_JRET(qwCancelTask(qWorkerMgmt, msg->sId, msg->queryId, msg->taskId));
...
@@ -579,10 +557,7 @@ int32_t qWorkerProcessDropMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -579,10 +557,7 @@ int32_t qWorkerProcessDropMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
uint64_t
tId
=
msg
->
taskId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
msg
->
refId
;
int64_t
rId
=
msg
->
refId
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
code
=
pMsg
->
code
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
code
=
pMsg
->
code
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
if
(
TSDB_CODE_RPC_NETWORK_UNAVAIL
==
pMsg
->
code
)
{
if
(
TSDB_CODE_RPC_NETWORK_UNAVAIL
==
pMsg
->
code
)
{
QW_SCH_TASK_DLOG
(
"receive drop task due to network broken, error:%s"
,
tstrerror
(
pMsg
->
code
));
QW_SCH_TASK_DLOG
(
"receive drop task due to network broken, error:%s"
,
tstrerror
(
pMsg
->
code
));
...
@@ -618,11 +593,7 @@ int32_t qWorkerProcessHbMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
...
@@ -618,11 +593,7 @@ int32_t qWorkerProcessHbMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg) {
}
}
uint64_t
sId
=
req
.
sId
;
uint64_t
sId
=
req
.
sId
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
code
=
pMsg
->
code
};
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
code
=
pMsg
->
code
,
.
connInfo
=
pMsg
->
info
};
qwMsg
.
connInfo
.
handle
=
pMsg
->
info
.
handle
;
qwMsg
.
connInfo
.
ahandle
=
pMsg
->
info
.
ahandle
;
qwMsg
.
connInfo
.
refId
=
pMsg
->
info
.
refId
;
if
(
TSDB_CODE_RPC_NETWORK_UNAVAIL
==
pMsg
->
code
)
{
if
(
TSDB_CODE_RPC_NETWORK_UNAVAIL
==
pMsg
->
code
)
{
QW_SCH_DLOG
(
"receive Hb msg due to network broken, error:%s"
,
tstrerror
(
pMsg
->
code
));
QW_SCH_DLOG
(
"receive Hb msg due to network broken, error:%s"
,
tstrerror
(
pMsg
->
code
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录