Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7b6b3a72
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b6b3a72
编写于
5月 31, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix send on broken rpc connection issue
上级
52988b6d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
59 addition
and
31 deletion
+59
-31
source/libs/scheduler/inc/schedulerInt.h
source/libs/scheduler/inc/schedulerInt.h
+4
-5
source/libs/scheduler/src/schJob.c
source/libs/scheduler/src/schJob.c
+53
-8
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+2
-18
未找到文件。
source/libs/scheduler/inc/schedulerInt.h
浏览文件 @
7b6b3a72
...
...
@@ -300,7 +300,7 @@ int32_t schProcessOnTaskSuccess(SSchJob *pJob, SSchTask *pTask);
int32_t
schSaveJobQueryRes
(
SSchJob
*
pJob
,
SQueryTableRsp
*
rsp
);
int32_t
schProcessOnExplainDone
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SRetrieveTableRsp
*
pRsp
);
void
schProcessOnDataFetched
(
SSchJob
*
job
);
int32_t
schGetTask
FromTaskList
(
SHashObj
*
pTaskList
,
uint64_t
taskId
,
SSchTask
**
pTask
);
int32_t
schGetTask
InJob
(
SSchJob
*
pJob
,
uint64_t
taskId
,
SSchTask
**
pTask
);
int32_t
schUpdateTaskExecNodeHandle
(
SSchTask
*
pTask
,
void
*
handle
,
int32_t
rspCode
);
void
schFreeRpcCtxVal
(
const
void
*
arg
);
int32_t
schMakeBrokenLinkVal
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
SRpcBrokenlinkVal
*
brokenVal
,
bool
isHb
);
...
...
@@ -314,12 +314,11 @@ int32_t schCancelJob(SSchJob *pJob);
int32_t
schProcessOnJobDropped
(
SSchJob
*
pJob
,
int32_t
errCode
);
uint64_t
schGenTaskId
(
void
);
void
schCloseJobRef
(
void
);
int32_t
schExecJob
(
void
*
pTrans
,
SArray
*
pNodeList
,
SQueryPlan
*
pDag
,
int64_t
*
pJob
,
const
char
*
sql
,
int64_t
startTs
,
SSchResInfo
*
pRes
);
int32_t
schAsyncExecJob
(
void
*
pTrans
,
SArray
*
pNodeList
,
SQueryPlan
*
pDag
,
int64_t
*
pJob
,
const
char
*
sql
,
int64_t
startTs
,
SSchResInfo
*
pRes
);
int32_t
schExecJob
(
void
*
pTrans
,
SArray
*
pNodeList
,
SQueryPlan
*
pDag
,
int64_t
*
pJob
,
const
char
*
sql
,
int64_t
startTs
,
SSchResInfo
*
pRes
);
int32_t
schAsyncExecJob
(
void
*
pTrans
,
SArray
*
pNodeList
,
SQueryPlan
*
pDag
,
int64_t
*
pJob
,
const
char
*
sql
,
int64_t
startTs
,
SSchResInfo
*
pRes
);
int32_t
schFetchRows
(
SSchJob
*
pJob
);
int32_t
schAsyncFetchRows
(
SSchJob
*
pJob
);
int32_t
schUpdateTaskHandle
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
int32_t
msgType
,
void
*
handle
,
int32_t
rspCode
);
#ifdef __cplusplus
...
...
source/libs/scheduler/src/schJob.c
浏览文件 @
7b6b3a72
...
...
@@ -342,6 +342,36 @@ int32_t schRecordTaskExecNode(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *ad
return
TSDB_CODE_SUCCESS
;
}
int32_t
schDropTaskExecNode
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
void
*
handle
)
{
if
(
NULL
==
pTask
->
execNodes
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
num
=
taosArrayGetSize
(
pTask
->
execNodes
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
SSchNodeInfo
*
pNode
=
taosArrayGet
(
pTask
->
execNodes
,
i
);
if
(
pNode
->
handle
==
handle
)
{
taosArrayRemove
(
pTask
->
execNodes
,
i
);
break
;
}
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
schUpdateTaskHandle
(
SSchJob
*
pJob
,
SSchTask
*
pTask
,
int32_t
msgType
,
void
*
handle
,
int32_t
rspCode
)
{
SCH_SET_TASK_HANDLE
(
pTask
,
handle
);
schUpdateTaskExecNodeHandle
(
pTask
,
handle
,
rspCode
);
if
(
msgType
==
TDMT_SCH_LINK_BROKEN
)
{
schDropTaskExecNode
(
pJob
,
pTask
,
handle
);
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
schRecordQueryDataSrc
(
SSchJob
*
pJob
,
SSchTask
*
pTask
)
{
if
(
!
SCH_IS_DATA_SRC_QRY_TASK
(
pTask
))
{
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1009,19 +1039,19 @@ int32_t schProcessOnTaskSuccess(SSchJob *pJob, SSchTask *pTask) {
*/
for
(
int32_t
i
=
0
;
i
<
parentNum
;
++
i
)
{
SSchTask
*
par
=
*
(
SSchTask
**
)
taosArrayGet
(
pTask
->
parents
,
i
);
int32_t
readyNum
=
atomic_add_fetch_32
(
&
par
->
childReady
,
1
);
SSchTask
*
par
ent
=
*
(
SSchTask
**
)
taosArrayGet
(
pTask
->
parents
,
i
);
int32_t
readyNum
=
atomic_add_fetch_32
(
&
par
ent
->
childReady
,
1
);
SCH_LOCK
(
SCH_WRITE
,
&
par
->
lock
);
SCH_LOCK
(
SCH_WRITE
,
&
par
ent
->
lock
);
SDownstreamSourceNode
source
=
{.
type
=
QUERY_NODE_DOWNSTREAM_SOURCE
,
.
taskId
=
pTask
->
taskId
,
.
schedId
=
schMgmt
.
sId
,
.
addr
=
pTask
->
succeedAddr
};
qSetSubplanExecutionNode
(
par
->
plan
,
pTask
->
plan
->
id
.
groupId
,
&
source
);
SCH_UNLOCK
(
SCH_WRITE
,
&
par
->
lock
);
qSetSubplanExecutionNode
(
par
ent
->
plan
,
pTask
->
plan
->
id
.
groupId
,
&
source
);
SCH_UNLOCK
(
SCH_WRITE
,
&
par
ent
->
lock
);
if
(
SCH_TASK_READY_FOR_LAUNCH
(
readyNum
,
par
))
{
SCH_ERR_RET
(
schLaunchTask
(
pJob
,
par
));
if
(
SCH_TASK_READY_FOR_LAUNCH
(
readyNum
,
par
ent
))
{
SCH_ERR_RET
(
schLaunchTask
(
pJob
,
par
ent
));
}
}
...
...
@@ -1095,7 +1125,7 @@ int32_t schSaveJobQueryRes(SSchJob *pJob, SQueryTableRsp *rsp) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
schGetTaskFrom
Task
List
(
SHashObj
*
pTaskList
,
uint64_t
taskId
,
SSchTask
**
pTask
)
{
int32_t
schGetTaskFromList
(
SHashObj
*
pTaskList
,
uint64_t
taskId
,
SSchTask
**
pTask
)
{
int32_t
s
=
taosHashGetSize
(
pTaskList
);
if
(
s
<=
0
)
{
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1111,6 +1141,21 @@ int32_t schGetTaskFromTaskList(SHashObj *pTaskList, uint64_t taskId, SSchTask **
return
TSDB_CODE_SUCCESS
;
}
int32_t
schGetTaskInJob
(
SSchJob
*
pJob
,
uint64_t
taskId
,
SSchTask
**
pTask
)
{
schGetTaskFromList
(
pJob
->
execTasks
,
taskId
,
pTask
);
if
(
NULL
==
*
pTask
)
{
schGetTaskFromList
(
pJob
->
succTasks
,
taskId
,
pTask
);
if
(
NULL
==
*
pTask
)
{
SCH_JOB_ELOG
(
"task not found in execList & succList, taskId:%"
PRIx64
,
taskId
);
SCH_ERR_RET
(
TSDB_CODE_SCH_INTERNAL_ERROR
);
}
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
schUpdateTaskExecNodeHandle
(
SSchTask
*
pTask
,
void
*
handle
,
int32_t
rspCode
)
{
if
(
rspCode
||
NULL
==
pTask
->
execNodes
||
taosArrayGetSize
(
pTask
->
execNodes
)
>
1
||
taosArrayGetSize
(
pTask
->
execNodes
)
<=
0
)
{
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
7b6b3a72
...
...
@@ -358,27 +358,11 @@ int32_t schHandleCallback(void *param, const SDataBuf *pMsg, int32_t msgType, in
SCH_ERR_JRET
(
TSDB_CODE_QRY_JOB_FREED
);
}
schGetTaskFromTaskList
(
pJob
->
execTasks
,
pParam
->
taskId
,
&
pTask
);
if
(
NULL
==
pTask
)
{
if
(
TDMT_VND_EXPLAIN_RSP
==
msgType
)
{
schGetTaskFromTaskList
(
pJob
->
succTasks
,
pParam
->
taskId
,
&
pTask
);
}
else
{
SCH_JOB_ELOG
(
"task not found in execTask list, refId:%"
PRIx64
", taskId:%"
PRIx64
,
pParam
->
refId
,
pParam
->
taskId
);
SCH_ERR_JRET
(
TSDB_CODE_SCH_INTERNAL_ERROR
);
}
}
if
(
NULL
==
pTask
)
{
SCH_JOB_ELOG
(
"task not found in execList & succList, refId:%"
PRIx64
", taskId:%"
PRIx64
,
pParam
->
refId
,
pParam
->
taskId
);
SCH_ERR_JRET
(
TSDB_CODE_SCH_INTERNAL_ERROR
);
}
SCH_ERR_JRET
(
schGetTaskInJob
(
pJob
,
pParam
->
taskId
,
&
pTask
));
SCH_TASK_DLOG
(
"rsp msg received, type:%s, handle:%p, code:%s"
,
TMSG_INFO
(
msgType
),
pMsg
->
handle
,
tstrerror
(
rspCode
));
SCH_SET_TASK_HANDLE
(
pTask
,
pMsg
->
handle
);
schUpdateTaskExecNodeHandle
(
pTask
,
pMsg
->
handle
,
rspCode
);
SCH_ERR_JRET
(
schUpdateTaskHandle
(
pJob
,
pTask
,
msgType
,
pMsg
->
handle
,
rspCode
));
SCH_ERR_JRET
(
schHandleResponseMsg
(
pJob
,
pTask
,
msgType
,
pMsg
->
pData
,
pMsg
->
len
,
rspCode
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录