Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4745b4ff
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
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看板
提交
4745b4ff
编写于
9月 10, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: make CI happy
上级
d1d35c48
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
42 addition
and
38 deletion
+42
-38
source/libs/scheduler/src/schTask.c
source/libs/scheduler/src/schTask.c
+42
-38
未找到文件。
source/libs/scheduler/src/schTask.c
浏览文件 @
4745b4ff
...
...
@@ -52,7 +52,7 @@ void schInitTaskRetryTimes(SSchJob *pJob, SSchTask *pTask, SSchLevel *pLevel) {
int32_t
nodeNum
=
taosArrayGetSize
(
pJob
->
nodeList
);
pTask
->
maxRetryTimes
=
TMAX
(
nodeNum
,
SCH_DEFAULT_MAX_RETRY_NUM
);
}
pTask
->
maxExecTimes
=
pTask
->
maxRetryTimes
*
(
pLevel
->
level
+
1
);
}
...
...
@@ -139,13 +139,15 @@ int32_t schUpdateTaskExecNode(SSchJob *pJob, SSchTask *pTask, void *handle, int3
}
if
((
execId
!=
pTask
->
execId
)
||
pTask
->
waitRetry
)
{
// ignore it
SCH_TASK_DLOG
(
"handle not updated since execId %d is already not current execId %d, waitRetry %d"
,
execId
,
pTask
->
execId
,
pTask
->
waitRetry
);
SCH_TASK_DLOG
(
"handle not updated since execId %d is already not current execId %d, waitRetry %d"
,
execId
,
pTask
->
execId
,
pTask
->
waitRetry
);
return
TSDB_CODE_SUCCESS
;
}
SSchNodeInfo
*
nodeInfo
=
taosHashGet
(
pTask
->
execNodes
,
&
execId
,
sizeof
(
execId
));
if
(
NULL
==
nodeInfo
)
{
// ignore it
SCH_TASK_DLOG
(
"handle not updated since execId %d already not exist, current execId %d, waitRetry %d"
,
execId
,
pTask
->
execId
,
pTask
->
waitRetry
);
SCH_TASK_DLOG
(
"handle not updated since execId %d already not exist, current execId %d, waitRetry %d"
,
execId
,
pTask
->
execId
,
pTask
->
waitRetry
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -314,7 +316,7 @@ int32_t schRescheduleTask(SSchJob *pJob, SSchTask *pTask) {
if
(
!
schMgmt
.
cfg
.
enableReSchedule
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
SCH_IS_DATA_BIND_TASK
(
pTask
))
{
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -341,7 +343,8 @@ int32_t schDoTaskRedirect(SSchJob *pJob, SSchTask *pTask, SDataBuf *pData, int32
}
if
(((
pTask
->
execId
+
1
)
>=
pTask
->
maxExecTimes
)
||
((
pTask
->
retryTimes
+
1
)
>
pTask
->
maxRetryTimes
))
{
SCH_TASK_DLOG
(
"task no more retry since reach max times %d:%d, execId %d"
,
pTask
->
maxRetryTimes
,
pTask
->
maxExecTimes
,
pTask
->
execId
);
SCH_TASK_DLOG
(
"task no more retry since reach max times %d:%d, execId %d"
,
pTask
->
maxRetryTimes
,
pTask
->
maxExecTimes
,
pTask
->
execId
);
schHandleJobFailure
(
pJob
,
rspCode
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -548,7 +551,8 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo
if
((
pTask
->
retryTimes
+
1
)
>
pTask
->
maxRetryTimes
)
{
*
needRetry
=
false
;
SCH_TASK_DLOG
(
"task no more retry since reach max retry times, retryTimes:%d/%d"
,
pTask
->
retryTimes
,
pTask
->
maxRetryTimes
);
SCH_TASK_DLOG
(
"task no more retry since reach max retry times, retryTimes:%d/%d"
,
pTask
->
retryTimes
,
pTask
->
maxRetryTimes
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -564,25 +568,25 @@ int32_t schTaskCheckSetRetry(SSchJob *pJob, SSchTask *pTask, int32_t errCode, bo
return
TSDB_CODE_SUCCESS
;
}
/*
if (SCH_IS_DATA_BIND_TASK(pTask)) {
if ((pTask->execId + 1) >= SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)) {
*needRetry = false;
SCH_TASK_DLOG("task no more retry since all ep tried, execId:%d, epNum:%d", pTask->execId,
SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode));
return TSDB_CODE_SUCCESS;
}
} else {
int32_t candidateNum = taosArrayGetSize(pTask->candidateAddrs);
/*
if (SCH_IS_DATA_BIND_TASK(pTask)) {
if ((pTask->execId + 1) >= SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode)) {
*needRetry = false;
SCH_TASK_DLOG("task no more retry since all ep tried, execId:%d, epNum:%d", pTask->execId,
SCH_TASK_NUM_OF_EPS(&pTask->plan->execNode));
return TSDB_CODE_SUCCESS;
}
} else {
int32_t candidateNum = taosArrayGetSize(pTask->candidateAddrs);
if ((pTask->candidateIdx + 1) >= candidateNum && (TSDB_CODE_SCH_TIMEOUT_ERROR != errCode)) {
*needRetry = false;
SCH_TASK_DLOG("task no more retry since all candiates tried, candidateIdx:%d, candidateNum:%d",
pTask->candidateIdx, candidateNum);
return TSDB_CODE_SUCCESS;
if ((pTask->candidateIdx + 1) >= candidateNum && (TSDB_CODE_SCH_TIMEOUT_ERROR != errCode)) {
*needRetry = false;
SCH_TASK_DLOG("task no more retry since all candiates tried, candidateIdx:%d, candidateNum:%d",
pTask->candidateIdx, candidateNum);
return TSDB_CODE_SUCCESS;
}
}
}
*/
*/
*
needRetry
=
true
;
SCH_TASK_DLOG
(
"task need the %dth retry, errCode:%x - %s"
,
pTask
->
execId
+
1
,
errCode
,
tstrerror
(
errCode
));
...
...
@@ -630,8 +634,9 @@ int32_t schSetAddrsFromNodeList(SSchJob *pJob, SSchTask *pTask) {
SCH_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
SCH_TASK_TLOG
(
"set %dth candidate addr, id %d, inUse:%d/%d, fqdn:%s, port:%d"
,
i
,
naddr
->
nodeId
,
naddr
->
epSet
.
inUse
,
naddr
->
epSet
.
numOfEps
,
SCH_GET_CUR_EP
(
naddr
)
->
fqdn
,
SCH_GET_CUR_EP
(
naddr
)
->
port
);
SCH_TASK_TLOG
(
"set %dth candidate addr, id %d, inUse:%d/%d, fqdn:%s, port:%d"
,
i
,
naddr
->
nodeId
,
naddr
->
epSet
.
inUse
,
naddr
->
epSet
.
numOfEps
,
SCH_GET_CUR_EP
(
naddr
)
->
fqdn
,
SCH_GET_CUR_EP
(
naddr
)
->
port
);
++
addNum
;
}
...
...
@@ -711,10 +716,10 @@ int32_t schSwitchTaskCandidateAddr(SSchJob *pJob, SSchTask *pTask) {
if
(
candidateNum
<=
1
)
{
goto
_return
;
}
switch
(
schMgmt
.
cfg
.
schPolicy
)
{
case
SCH_LOAD_SEQ
:
case
SCH_ALL
:
case
SCH_ALL
:
default:
if
(
++
pTask
->
candidateIdx
>=
candidateNum
)
{
pTask
->
candidateIdx
=
0
;
...
...
@@ -732,7 +737,7 @@ int32_t schSwitchTaskCandidateAddr(SSchJob *pJob, SSchTask *pTask) {
_return:
SCH_TASK_DLOG
(
"switch task candiateIdx to %d/%d"
,
pTask
->
candidateIdx
,
candidateNum
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -759,7 +764,7 @@ void schDropTaskOnExecNode(SSchJob *pJob, SSchTask *pTask) {
return
;
}
int32_t
i
=
0
;
int32_t
i
=
0
;
SSchNodeInfo
*
nodeInfo
=
taosHashIterate
(
pTask
->
execNodes
,
NULL
);
while
(
nodeInfo
)
{
if
(
nodeInfo
->
handle
)
{
...
...
@@ -821,16 +826,16 @@ int32_t schProcessOnTaskStatusRsp(SQueryNodeEpId *pEpId, SArray *pStatusList) {
int32_t
schLaunchTaskImpl
(
void
*
param
)
{
SSchTaskCtx
*
pCtx
=
(
SSchTaskCtx
*
)
param
;
SSchJob
*
pJob
=
schAcquireJob
(
pCtx
->
jobRid
);
SSchJob
*
pJob
=
schAcquireJob
(
pCtx
->
jobRid
);
if
(
NULL
==
pJob
)
{
taosMemoryFree
(
param
);
qDebug
(
"job refId 0x%"
PRIx64
" already not exist"
,
pCtx
->
jobRid
);
taosMemoryFree
(
param
);
SCH_RET
(
TSDB_CODE_SCH_JOB_IS_DROPPING
);
}
SSchTask
*
pTask
=
pCtx
->
pTask
;
int8_t
status
=
0
;
int32_t
code
=
0
;
int8_t
status
=
0
;
int32_t
code
=
0
;
atomic_add_fetch_32
(
&
pTask
->
level
->
taskLaunchedNum
,
1
);
pTask
->
execId
++
;
...
...
@@ -891,13 +896,12 @@ _return:
SCH_RET
(
code
);
}
int32_t
schAsyncLaunchTaskImpl
(
SSchJob
*
pJob
,
SSchTask
*
pTask
)
{
int32_t
schAsyncLaunchTaskImpl
(
SSchJob
*
pJob
,
SSchTask
*
pTask
)
{
SSchTaskCtx
*
param
=
taosMemoryCalloc
(
1
,
sizeof
(
SSchTaskCtx
));
if
(
NULL
==
param
)
{
SCH_ERR_RET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
param
->
jobRid
=
pJob
->
refId
;
param
->
pTask
=
pTask
;
...
...
@@ -906,7 +910,7 @@ int32_t schAsyncLaunchTaskImpl(SSchJob *pJob, SSchTask *pTask) {
}
else
{
SCH_ERR_RET
(
schLaunchTaskImpl
(
param
));
}
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录