Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8ffb5012
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
8ffb5012
编写于
7月 11, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: enhance stop query
上级
65c318db
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
13 deletion
+33
-13
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+7
-2
source/libs/scheduler/inc/schInt.h
source/libs/scheduler/inc/schInt.h
+1
-0
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+24
-11
source/libs/scheduler/src/schStatus.c
source/libs/scheduler/src/schStatus.c
+1
-0
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
8ffb5012
...
...
@@ -808,11 +808,16 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) {
void
schedulerExecCb
(
SExecResult
*
pResult
,
void
*
param
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
param
;
pRequest
->
code
=
code
;
memcpy
(
&
pRequest
->
body
.
resInfo
.
execRes
,
pResult
,
sizeof
(
*
pResult
));
if
(
pResult
)
{
memcpy
(
&
pRequest
->
body
.
resInfo
.
execRes
,
pResult
,
sizeof
(
*
pResult
));
}
if
(
TDMT_VND_SUBMIT
==
pRequest
->
type
||
TDMT_VND_DELETE
==
pRequest
->
type
||
TDMT_VND_CREATE_TABLE
==
pRequest
->
type
)
{
pRequest
->
body
.
resInfo
.
numOfRows
=
pResult
->
numOfRows
;
if
(
pResult
)
{
pRequest
->
body
.
resInfo
.
numOfRows
=
pResult
->
numOfRows
;
}
schedulerFreeJob
(
&
pRequest
->
body
.
queryJob
,
0
);
}
...
...
source/libs/scheduler/inc/schInt.h
浏览文件 @
8ffb5012
...
...
@@ -434,6 +434,7 @@ int32_t schLaunchLevelTasks(SSchJob *pJob, SSchLevel *level);
int32_t
schGetTaskFromList
(
SHashObj
*
pTaskList
,
uint64_t
taskId
,
SSchTask
**
pTask
);
int32_t
schInitTask
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SSubplan
*
pPlan
,
SSchLevel
*
pLevel
,
int32_t
levelNum
);
int32_t
schSwitchTaskCandidateAddr
(
SSchJob
*
pJob
,
SSchTask
*
pTask
);
void
schDirectPostJobRes
(
SSchedulerReq
*
pReq
,
int32_t
errCode
);
#ifdef __cplusplus
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
8ffb5012
...
...
@@ -758,6 +758,17 @@ int32_t schExecJob(SSchJob *pJob, SSchedulerReq *pReq) {
return
TSDB_CODE_SUCCESS
;
}
void
schDirectPostJobRes
(
SSchedulerReq
*
pReq
,
int32_t
errCode
)
{
if
(
pReq
->
syncReq
)
{
return
;
}
if
(
pReq
->
execFp
)
{
(
*
pReq
->
execFp
)(
NULL
,
pReq
->
cbParam
,
errCode
);
}
else
if
(
pReq
->
fetchFp
)
{
(
*
pReq
->
fetchFp
)(
NULL
,
pReq
->
cbParam
,
errCode
);
}
}
void
schProcessOnOpEnd
(
SSchJob
*
pJob
,
SCH_OP_TYPE
type
,
SSchedulerReq
*
pReq
,
int32_t
errCode
)
{
int32_t
op
=
0
;
...
...
@@ -796,17 +807,13 @@ void schProcessOnOpEnd(SSchJob *pJob, SCH_OP_TYPE type, SSchedulerReq* pReq, int
int32_t
schProcessOnOpBegin
(
SSchJob
*
pJob
,
SCH_OP_TYPE
type
,
SSchedulerReq
*
pReq
)
{
int32_t
code
=
0
;
int8_t
status
=
0
;
if
(
schJobNeedToStop
(
pJob
,
&
status
))
{
SCH_JOB_ELOG
(
"abort op %s cause of job need to stop, status:%s"
,
schGetOpStr
(
type
),
jobTaskStatusStr
(
status
));
SCH_ERR_RET
(
TSDB_CODE_SCH_IGNORE_ERROR
);
}
int8_t
status
=
SCH_GET_JOB_STATUS
(
pJob
);
switch
(
type
)
{
case
SCH_OP_EXEC
:
if
(
SCH_OP_NULL
!=
atomic_val_compare_exchange_32
(
&
pJob
->
opStatus
.
op
,
SCH_OP_NULL
,
type
))
{
SCH_JOB_ELOG
(
"job already in %s operation"
,
schGetOpStr
(
pJob
->
opStatus
.
op
));
schDirectPostJobRes
(
pReq
,
TSDB_CODE_TSC_APP_ERROR
);
SCH_ERR_RET
(
TSDB_CODE_TSC_APP_ERROR
);
}
...
...
@@ -817,11 +824,16 @@ int32_t schProcessOnOpBegin(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
case
SCH_OP_FETCH
:
if
(
SCH_OP_NULL
!=
atomic_val_compare_exchange_32
(
&
pJob
->
opStatus
.
op
,
SCH_OP_NULL
,
type
))
{
SCH_JOB_ELOG
(
"job already in %s operation"
,
schGetOpStr
(
pJob
->
opStatus
.
op
));
schDirectPostJobRes
(
pReq
,
TSDB_CODE_TSC_APP_ERROR
);
SCH_ERR_RET
(
TSDB_CODE_TSC_APP_ERROR
);
}
SCH_JOB_DLOG
(
"job start %s operation"
,
schGetOpStr
(
pJob
->
opStatus
.
op
));
pJob
->
userRes
.
fetchRes
=
pReq
->
pFetchRes
;
pJob
->
userRes
.
fetchFp
=
pReq
->
fetchFp
;
pJob
->
userRes
.
cbParam
=
pReq
->
cbParam
;
pJob
->
opStatus
.
syncReq
=
pReq
->
syncReq
;
if
(
!
SCH_JOB_NEED_FETCH
(
pJob
))
{
...
...
@@ -834,10 +846,6 @@ int32_t schProcessOnOpBegin(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
SCH_ERR_RET
(
TSDB_CODE_SCH_STATUS_ERROR
);
}
pJob
->
userRes
.
fetchRes
=
pReq
->
pFetchRes
;
pJob
->
userRes
.
fetchFp
=
pReq
->
fetchFp
;
pJob
->
userRes
.
cbParam
=
pReq
->
cbParam
;
break
;
case
SCH_OP_GET_STATUS
:
if
(
pJob
->
status
<
JOB_TASK_STATUS_INIT
||
pJob
->
levelNum
<=
0
||
NULL
==
pJob
->
levels
)
{
...
...
@@ -850,6 +858,11 @@ int32_t schProcessOnOpBegin(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
SCH_ERR_RET
(
TSDB_CODE_TSC_APP_ERROR
);
}
if
(
schJobNeedToStop
(
pJob
,
&
status
))
{
SCH_JOB_ELOG
(
"abort op %s cause of job need to stop, status:%s"
,
schGetOpStr
(
type
),
jobTaskStatusStr
(
status
));
SCH_ERR_RET
(
TSDB_CODE_SCH_IGNORE_ERROR
);
}
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/scheduler/src/schStatus.c
浏览文件 @
8ffb5012
...
...
@@ -77,6 +77,7 @@ int32_t schHandleOpEndEvent(SSchJob* pJob, SCH_OP_TYPE type, SSchedulerReq* pReq
int32_t
code
=
errCode
;
if
(
NULL
==
pJob
)
{
schDirectPostJobRes
(
pReq
,
errCode
);
SCH_RET
(
code
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录