Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a8e526a6
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看板
提交
a8e526a6
编写于
6月 30, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: support query redirect
上级
407db99a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
35 deletion
+38
-35
source/libs/qworker/src/qwDbg.c
source/libs/qworker/src/qwDbg.c
+31
-1
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+0
-29
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+7
-5
未找到文件。
source/libs/qworker/src/qwDbg.c
浏览文件 @
a8e526a6
...
...
@@ -9,7 +9,7 @@
#include "tmsg.h"
#include "tname.h"
SQWDebug
gQWDebug
=
{.
statusEnable
=
true
,
.
dumpEnable
=
false
,
.
tmp
=
tru
e
};
SQWDebug
gQWDebug
=
{.
statusEnable
=
true
,
.
dumpEnable
=
false
,
.
tmp
=
fals
e
};
int32_t
qwDbgValidateStatus
(
QW_FPARAMS_DEF
,
int8_t
oriStatus
,
int8_t
newStatus
,
bool
*
ignore
)
{
if
(
!
gQWDebug
.
statusEnable
)
{
...
...
@@ -138,6 +138,7 @@ int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int
.
code
=
code
,
.
info
=
*
pConn
,
};
rpcRsp
.
info
.
hasEpSet
=
1
;
tmsgSendRsp
(
&
rpcRsp
);
...
...
@@ -146,6 +147,35 @@ int32_t qwDbgBuildAndSendRedirectRsp(int32_t rspType, SRpcHandleInfo *pConn, int
return
TSDB_CODE_SUCCESS
;
}
int32_t
qwDbgResponseREdirect
(
SQWMsg
*
qwMsg
,
SQWTaskCtx
*
ctx
)
{
if
(
gQWDebug
.
tmp
)
{
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
;
}
if
(
TDMT_SCH_MERGE_QUERY
==
qwMsg
->
msgType
)
{
ctx
->
phase
=
QW_PHASE_POST_QUERY
;
qwDbgBuildAndSendRedirectRsp
(
qwMsg
->
msgType
+
1
,
&
qwMsg
->
connInfo
,
TSDB_CODE_RPC_REDIRECT
,
NULL
);
gQWDebug
.
tmp
=
false
;
return
TSDB_CODE_SUCCESS
;
}
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
qwDbgEnableDebug
(
char
*
option
)
{
if
(
0
==
strcasecmp
(
option
,
"lock"
))
{
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
a8e526a6
...
...
@@ -564,35 +564,6 @@ int32_t qwProcessQuery(QW_FPARAMS_DEF, SQWMsg *qwMsg, int8_t taskType, int8_t ex
QW_ERR_JRET
(
qwExecTask
(
QW_FPARAMS
(),
ctx
,
NULL
));
}
if
(
gQWDebug
.
tmp
)
{
#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
;
qwDbgBuildAndSendRedirectRsp
(
qwMsg
->
msgType
+
1
,
&
qwMsg
->
connInfo
,
TSDB_CODE_RPC_REDIRECT
,
NULL
);
gQWDebug
.
tmp
=
false
;
return
TSDB_CODE_SUCCESS
;
}
#endif
}
_return:
input
.
code
=
code
;
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
a8e526a6
...
...
@@ -1684,7 +1684,7 @@ _return:
SCH_RET
(
code
);
}
int32_t
schDoTaskRedirect
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
int32_t
rspCode
)
{
int32_t
schDoTaskRedirect
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SDataBuf
*
pData
,
int32_t
rspCode
)
{
int32_t
code
=
0
;
int8_t
status
=
0
;
if
(
schJobNeedToStop
(
pJob
,
&
status
))
{
...
...
@@ -1711,6 +1711,10 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) {
memset
(
&
pTask
->
succeedAddr
,
0
,
sizeof
(
pTask
->
succeedAddr
));
if
(
SCH_IS_DATA_SRC_QRY_TASK
(
pTask
))
{
if
(
pData
)
{
SCH_ERR_JRET
(
schUpdateTaskCandidateAddr
(
pJob
,
pTask
,
pData
->
pEpSet
));
}
if
(
SCH_TASK_NEED_FLOW_CTRL
(
pJob
,
pTask
))
{
if
(
JOB_TASK_STATUS_EXECUTING
==
SCH_GET_TASK_STATUS
(
pTask
))
{
SCH_ERR_JRET
(
schLaunchTasksInFlowCtrlList
(
pJob
,
pTask
));
...
...
@@ -1737,7 +1741,7 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, int32_t rspCode) {
for
(
int32_t
i
=
0
;
i
<
childrenNum
;
++
i
)
{
SSchTask
*
pChild
=
taosArrayGetP
(
pTask
->
children
,
i
);
SCH_LOCK_TASK
(
pChild
);
schDoTaskRedirect
(
pJob
,
pChild
,
rspCode
);
schDoTaskRedirect
(
pJob
,
pChild
,
NULL
,
rspCode
);
SCH_UNLOCK_TASK
(
pChild
);
}
...
...
@@ -1758,11 +1762,9 @@ int32_t schHandleRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf* pData, int32
SCH_TASK_ELOG
(
"no epset updated while got error %s"
,
tstrerror
(
rspCode
));
SCH_ERR_JRET
(
rspCode
);
}
SCH_ERR_JRET
(
schUpdateTaskCandidateAddr
(
pJob
,
pTask
,
pData
->
pEpSet
));
}
SCH_RET
(
schDoTaskRedirect
(
pJob
,
pTask
,
rspCode
));
SCH_RET
(
schDoTaskRedirect
(
pJob
,
pTask
,
pData
,
rspCode
));
_return:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录