Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
47bc3687
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
47bc3687
编写于
6月 30, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: query redirect
上级
1b3eec48
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
39 addition
and
32 deletion
+39
-32
include/common/tmsg.h
include/common/tmsg.h
+1
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+2
-2
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+3
-2
source/libs/qworker/inc/qwInt.h
source/libs/qworker/inc/qwInt.h
+10
-10
source/libs/qworker/src/qwMsg.c
source/libs/qworker/src/qwMsg.c
+3
-1
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+16
-14
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+3
-2
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
47bc3687
...
...
@@ -1594,6 +1594,7 @@ typedef struct {
uint64_t
queryId
;
uint64_t
taskId
;
int64_t
refId
;
int32_t
execId
;
}
STaskCancelReq
;
typedef
struct
{
...
...
source/client/src/clientImpl.c
浏览文件 @
47bc3687
...
...
@@ -1294,10 +1294,10 @@ void processMsgFromServer(void* parent, SRpcMsg* pMsg, SEpSet* pEpSet) {
*/
int32_t
elapsed
=
pRequest
->
metric
.
rsp
-
pRequest
->
metric
.
start
;
if
(
pMsg
->
code
==
TSDB_CODE_SUCCESS
)
{
tscDebug
(
"0x%"
PRIx64
"
message
:%s, code:%s rspLen:%d, elapsed:%d ms, reqId:0x%"
PRIx64
,
pRequest
->
self
,
tscDebug
(
"0x%"
PRIx64
"
rsp msg
:%s, code:%s rspLen:%d, elapsed:%d ms, reqId:0x%"
PRIx64
,
pRequest
->
self
,
TMSG_INFO
(
pMsg
->
msgType
),
tstrerror
(
pMsg
->
code
),
pMsg
->
contLen
,
elapsed
/
1000
,
pRequest
->
requestId
);
}
else
{
tscError
(
"0x%"
PRIx64
"
SQL cmd
:%s, code:%s rspLen:%d, elapsed time:%d ms, reqId:0x%"
PRIx64
,
pRequest
->
self
,
tscError
(
"0x%"
PRIx64
"
rsp msg
:%s, code:%s rspLen:%d, elapsed time:%d ms, reqId:0x%"
PRIx64
,
pRequest
->
self
,
TMSG_INFO
(
pMsg
->
msgType
),
tstrerror
(
pMsg
->
code
),
pMsg
->
contLen
,
elapsed
/
1000
,
pRequest
->
requestId
);
}
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
47bc3687
...
...
@@ -3430,6 +3430,7 @@ static int32_t jsonToSlotDescNode(const SJson* pJson, void* pObj) {
static
const
char
*
jkDownstreamSourceAddr
=
"Addr"
;
static
const
char
*
jkDownstreamSourceTaskId
=
"TaskId"
;
static
const
char
*
jkDownstreamSourceSchedId
=
"SchedId"
;
static
const
char
*
jkDownstreamSourceExecId
=
"ExecId"
;
static
int32_t
downstreamSourceNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SDownstreamSourceNode
*
pNode
=
(
const
SDownstreamSourceNode
*
)
pObj
;
...
...
@@ -3442,7 +3443,7 @@ static int32_t downstreamSourceNodeToJson(const void* pObj, SJson* pJson) {
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDownstreamSourceSchedId
,
pNode
->
schedId
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDownstreamSource
Sched
Id
,
pNode
->
execId
);
code
=
tjsonAddIntegerToObject
(
pJson
,
jkDownstreamSource
Exec
Id
,
pNode
->
execId
);
}
return
code
;
...
...
@@ -3459,7 +3460,7 @@ static int32_t jsonToDownstreamSourceNode(const SJson* pJson, void* pObj) {
code
=
tjsonGetUBigIntValue
(
pJson
,
jkDownstreamSourceSchedId
,
&
pNode
->
schedId
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetIntValue
(
pJson
,
jkDownstreamSource
Sched
Id
,
&
pNode
->
execId
);
code
=
tjsonGetIntValue
(
pJson
,
jkDownstreamSource
Exec
Id
,
&
pNode
->
execId
);
}
return
code
;
...
...
source/libs/qworker/inc/qwInt.h
浏览文件 @
47bc3687
...
...
@@ -281,22 +281,22 @@ typedef struct SQWorkerMgmt {
#define QW_SCH_ELOG(param, ...) qError("QW:%p SID:%" PRIx64 " " param, mgmt, sId, __VA_ARGS__)
#define QW_SCH_DLOG(param, ...) qDebug("QW:%p SID:%" PRIx64 " " param, mgmt, sId, __VA_ARGS__)
#define QW_TASK_ELOG(param, ...) qError("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id, __VA_ARGS__)
#define QW_TASK_WLOG(param, ...) qWarn("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id, __VA_ARGS__)
#define QW_TASK_DLOG(param, ...) qDebug("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id, __VA_ARGS__)
#define QW_TASK_ELOG(param, ...) qError("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id, __VA_ARGS__)
#define QW_TASK_WLOG(param, ...) qWarn("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id, __VA_ARGS__)
#define QW_TASK_DLOG(param, ...) qDebug("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id, __VA_ARGS__)
#define QW_TASK_DLOGL(param, ...) \
qDebugL("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id, __VA_ARGS__)
qDebugL("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id, __VA_ARGS__)
#define QW_TASK_ELOG_E(param) qError("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id)
#define QW_TASK_WLOG_E(param) qWarn("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id)
#define QW_TASK_DLOG_E(param) qDebug("Q
W:%p QID:0x%" PRIx64 ",TID:0x%" PRIx64 " " param, mgmt, qId, t
Id)
#define QW_TASK_ELOG_E(param) qError("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id)
#define QW_TASK_WLOG_E(param) qWarn("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id)
#define QW_TASK_DLOG_E(param) qDebug("Q
ID:0x%" PRIx64 ",TID:0x%" PRIx64 ",EID:%d " param, qId, tId, e
Id)
#define QW_SCH_TASK_ELOG(param, ...) \
qError("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 "
" param, mgmt, sId, qId, t
Id, __VA_ARGS__)
qError("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 "
,EID:%d " param, mgmt, sId, qId, tId, e
Id, __VA_ARGS__)
#define QW_SCH_TASK_WLOG(param, ...) \
qWarn("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 "
" param, mgmt, sId, qId, t
Id, __VA_ARGS__)
qWarn("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 "
,EID:%d " param, mgmt, sId, qId, tId, e
Id, __VA_ARGS__)
#define QW_SCH_TASK_DLOG(param, ...) \
qDebug("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 "
" param, mgmt, sId, qId, t
Id, __VA_ARGS__)
qDebug("QW:%p SID:0x%" PRIx64 ",QID:0x%" PRIx64 ",TID:0x%" PRIx64 "
,EID:%d " param, mgmt, sId, qId, tId, e
Id, __VA_ARGS__)
#define QW_LOCK_DEBUG(...) \
do { \
...
...
source/libs/qworker/src/qwMsg.c
浏览文件 @
47bc3687
...
...
@@ -480,11 +480,13 @@ int32_t qWorkerProcessCancelMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, in
msg
->
queryId
=
be64toh
(
msg
->
queryId
);
msg
->
taskId
=
be64toh
(
msg
->
taskId
);
msg
->
refId
=
be64toh
(
msg
->
refId
);
msg
->
execId
=
ntohl
(
msg
->
execId
);
uint64_t
sId
=
msg
->
sId
;
uint64_t
qId
=
msg
->
queryId
;
uint64_t
tId
=
msg
->
taskId
;
int64_t
rId
=
msg
->
refId
;
int32_t
eId
=
msg
->
execId
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
NULL
,
.
msgLen
=
0
,
.
connInfo
=
pMsg
->
info
};
...
...
@@ -598,7 +600,7 @@ int32_t qWorkerProcessDeleteMsg(void *node, void *qWorkerMgmt, SRpcMsg *pMsg, SR
uint64_t
qId
=
req
.
queryId
;
uint64_t
tId
=
req
.
taskId
;
int64_t
rId
=
0
;
int32_t
eId
=
0
;
int32_t
eId
=
-
1
;
SQWMsg
qwMsg
=
{.
node
=
node
,
.
msg
=
req
.
msg
,
.
msgLen
=
req
.
phyLen
,
.
connInfo
=
pMsg
->
info
};
QW_SCH_TASK_DLOG
(
"processDelete start, node:%p, handle:%p, sql:%s"
,
node
,
pMsg
->
info
.
handle
,
req
.
sql
);
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
47bc3687
...
...
@@ -566,20 +566,22 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex
if
(
gQWDebug
.
tmp
)
{
#if 0
SEpSet epSet = {0};
epSet.inUse = 1;
epSet.numOfEps = 3;
strcpy(epSet.eps[0].fqdn, "localhost");
epSet.eps[0].port = 7100;
strcpy(epSet.eps[1].fqdn, "localhost");
epSet.eps[1].port = 7200;
strcpy(epSet.eps[2].fqdn, "localhost");
epSet.eps[2].port = 7300;
qwDbgBuildAndSendRedirectRsp(pMsg->msgType + 1, &pMsg->info, TSDB_CODE_RPC_REDIRECT, &epSet);
gQWDebug.tmp = false;
return TSDB_CODE_SUCCESS;
#if 1
if
(
TDMT_SCH_QUERY
==
qwMsg
->
msgType
)
{
SEpSet
epSet
=
{
0
};
epSet
.
inUse
=
1
;
epSet
.
numOfEps
=
3
;
strcpy
(
epSet
.
eps
[
0
].
fqdn
,
"localhost"
);
epSet
.
eps
[
0
].
port
=
7100
;
strcpy
(
epSet
.
eps
[
1
].
fqdn
,
"localhost"
);
epSet
.
eps
[
1
].
port
=
7200
;
strcpy
(
epSet
.
eps
[
2
].
fqdn
,
"localhost"
);
epSet
.
eps
[
2
].
port
=
7300
;
qwDbgBuildAndSendRedirectRsp
(
qwMsg
->
msgType
+
1
,
&
qwMsg
->
connInfo
,
TSDB_CODE_RPC_REDIRECT
,
&
epSet
);
gQWDebug
.
tmp
=
false
;
return
TSDB_CODE_SUCCESS
;
}
#else
if
(
TDMT_SCH_MERGE_QUERY
==
qwMsg
->
msgType
)
{
ctx
->
phase
=
QW_PHASE_POST_QUERY
;
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
47bc3687
...
...
@@ -1276,6 +1276,9 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) {
for
(
int32_t
i
=
0
;
i
<
taskNum
;
++
i
)
{
STaskStatus
*
taskStatus
=
taosArrayGet
(
pStatusList
,
i
);
qDebug
(
"QID:%"
PRIx64
",TID:0x%"
PRIx64
",EID:%d task status in server: %s"
,
taskStatus
->
queryId
,
taskStatus
->
taskId
,
taskStatus
->
execId
,
jobTaskStatusStr
(
taskStatus
->
status
));
SSchJob
*
pJob
=
schAcquireJob
(
taskStatus
->
refId
);
if
(
NULL
==
pJob
)
{
qWarn
(
"job not found, refId:0x%"
PRIx64
",QID:0x%"
PRIx64
",TID:0x%"
PRIx64
,
taskStatus
->
refId
,
...
...
@@ -1284,8 +1287,6 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId* pEpId, SArray* pStatusList) {
continue
;
}
SCH_JOB_DLOG
(
"TID:0x%"
PRIx64
"EID:%d task status in server: %s"
,
taskStatus
->
taskId
,
taskStatus
->
execId
,
jobTaskStatusStr
(
taskStatus
->
status
));
pTask
=
NULL
;
schGetTaskInJob
(
pJob
,
taskStatus
->
taskId
,
&
pTask
);
if
(
NULL
==
pTask
)
{
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
47bc3687
...
...
@@ -1062,7 +1062,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr,
pMsg
->
queryId
=
htobe64
(
pJob
->
queryId
);
pMsg
->
taskId
=
htobe64
(
pTask
->
taskId
);
pMsg
->
refId
=
htobe64
(
pJob
->
refId
);
pMsg
->
execId
=
hto
be64
(
pTask
->
execId
);
pMsg
->
execId
=
hto
nl
(
pTask
->
execId
);
break
;
}
case
TDMT_SCH_QUERY_HEARTBEAT
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录