Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bf3a2de6
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
bf3a2de6
编写于
2月 17, 2023
作者:
D
dapan1121
提交者:
GitHub
2月 17, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20003 from taosdata/fix/TD-22457
fix: rsp msg async handled issue
上级
50f394de
a7fd33d7
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
18 addition
and
24 deletion
+18
-24
source/libs/qworker/inc/qwInt.h
source/libs/qworker/inc/qwInt.h
+2
-0
source/libs/qworker/src/qwUtil.c
source/libs/qworker/src/qwUtil.c
+7
-19
source/libs/scheduler/inc/schInt.h
source/libs/scheduler/inc/schInt.h
+1
-0
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+4
-4
source/libs/scheduler/src/schTask.c
source/libs/scheduler/src/schTask.c
+4
-1
未找到文件。
source/libs/qworker/inc/qwInt.h
浏览文件 @
bf3a2de6
...
...
@@ -206,6 +206,8 @@ typedef struct SQWorkerMgmt {
int32_t
paramIdx
;
}
SQWorkerMgmt
;
#define QW_CTX_NOT_EXISTS_ERR_CODE(mgmt) (atomic_load_8(&(mgmt)->nodeStopped) ? TSDB_CODE_VND_STOPPED : TSDB_CODE_QRY_TASK_CTX_NOT_EXIST)
#define QW_FPARAMS_DEF SQWorker *mgmt, uint64_t sId, uint64_t qId, uint64_t tId, int64_t rId, int32_t eId
#define QW_IDS() sId, qId, tId, rId, eId
#define QW_FPARAMS() mgmt, QW_IDS()
...
...
source/libs/qworker/src/qwUtil.c
浏览文件 @
bf3a2de6
...
...
@@ -213,15 +213,9 @@ int32_t qwAcquireTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) {
QW_SET_QTID
(
id
,
qId
,
tId
,
eId
);
*
ctx
=
taosHashAcquire
(
mgmt
->
ctxHash
,
id
,
sizeof
(
id
));
int8_t
nodeStopped
=
atomic_load_8
(
&
mgmt
->
nodeStopped
);
if
(
NULL
==
(
*
ctx
))
{
if
(
!
nodeStopped
)
{
QW_TASK_DLOG_E
(
"task ctx not exist, may be dropped"
);
QW_ERR_RET
(
TSDB_CODE_QRY_TASK_CTX_NOT_EXIST
);
}
else
{
QW_TASK_DLOG_E
(
"node stopped"
);
QW_ERR_RET
(
TSDB_CODE_VND_STOPPED
);
}
QW_TASK_DLOG_E
(
"acquired task ctx not exist, may be dropped"
);
QW_ERR_RET
(
QW_CTX_NOT_EXISTS_ERR_CODE
(
mgmt
));
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -232,16 +226,9 @@ int32_t qwGetTaskCtx(QW_FPARAMS_DEF, SQWTaskCtx **ctx) {
QW_SET_QTID
(
id
,
qId
,
tId
,
eId
);
*
ctx
=
taosHashGet
(
mgmt
->
ctxHash
,
id
,
sizeof
(
id
));
int8_t
nodeStopped
=
atomic_load_8
(
&
mgmt
->
nodeStopped
);
if
(
NULL
==
(
*
ctx
))
{
if
(
!
nodeStopped
)
{
QW_TASK_DLOG_E
(
"task ctx not exist, may be dropped"
);
QW_ERR_RET
(
TSDB_CODE_QRY_TASK_CTX_NOT_EXIST
);
}
else
{
QW_TASK_DLOG_E
(
"node stopped"
);
QW_ERR_RET
(
TSDB_CODE_VND_STOPPED
);
}
QW_TASK_DLOG_E
(
"get task ctx not exist, may be dropped"
);
QW_ERR_RET
(
QW_CTX_NOT_EXISTS_ERR_CODE
(
mgmt
));
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -334,7 +321,8 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) {
SQWTaskCtx
*
ctx
=
taosHashGet
(
mgmt
->
ctxHash
,
id
,
sizeof
(
id
));
if
(
NULL
==
ctx
)
{
QW_ERR_RET
(
TSDB_CODE_QRY_TASK_CTX_NOT_EXIST
);
QW_TASK_DLOG_E
(
"drop task ctx not exist, may be dropped"
);
QW_ERR_RET
(
QW_CTX_NOT_EXISTS_ERR_CODE
(
mgmt
));
}
octx
=
*
ctx
;
...
...
@@ -346,7 +334,7 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) {
if
(
taosHashRemove
(
mgmt
->
ctxHash
,
id
,
sizeof
(
id
)))
{
QW_TASK_ELOG_E
(
"taosHashRemove from ctx hash failed"
);
QW_ERR_RET
(
TSDB_CODE_QRY_TASK_CTX_NOT_EXIST
);
QW_ERR_RET
(
QW_CTX_NOT_EXISTS_ERR_CODE
(
mgmt
)
);
}
qwFreeTaskCtx
(
&
octx
);
...
...
source/libs/scheduler/inc/schInt.h
浏览文件 @
bf3a2de6
...
...
@@ -230,6 +230,7 @@ typedef struct SSchTask {
SSchRedirectCtx
redirectCtx
;
// task redirect context
bool
waitRetry
;
// wait for retry
int32_t
execId
;
// task current execute index
int32_t
failedExecId
;
// last failed task execute index
SSchLevel
*
level
;
// level
SRWLatch
planLock
;
// task update plan lock
SSubplan
*
plan
;
// subplan
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
bf3a2de6
...
...
@@ -34,12 +34,12 @@ int32_t schValidateRspMsgType(SSchJob *pJob, SSchTask *pTask, int32_t msgType) {
if
(
lastMsgType
!=
reqMsgType
)
{
SCH_TASK_ELOG
(
"rsp msg type mis-match, last sent msgType:%s, rspType:%s"
,
TMSG_INFO
(
lastMsgType
),
TMSG_INFO
(
msgType
));
SCH_ERR_RET
(
TSDB_CODE_
SCH_STATUS
_ERROR
);
SCH_ERR_RET
(
TSDB_CODE_
QW_MSG
_ERROR
);
}
if
(
taskStatus
!=
JOB_TASK_STATUS_PART_SUCC
)
{
SCH_TASK_ELOG
(
"rsp msg conflicted with task status, status:%s, rspType:%s"
,
jobTaskStatusStr
(
taskStatus
),
TMSG_INFO
(
msgType
));
SCH_ERR_RET
(
TSDB_CODE_
SCH_STATUS
_ERROR
);
SCH_ERR_RET
(
TSDB_CODE_
QW_MSG
_ERROR
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -60,13 +60,13 @@ int32_t schValidateRspMsgType(SSchJob *pJob, SSchTask *pTask, int32_t msgType) {
if
(
lastMsgType
!=
reqMsgType
)
{
SCH_TASK_ELOG
(
"rsp msg type mis-match, last sent msgType:%s, rspType:%s"
,
TMSG_INFO
(
lastMsgType
),
TMSG_INFO
(
msgType
));
SCH_ERR_RET
(
TSDB_CODE_
SCH_STATUS
_ERROR
);
SCH_ERR_RET
(
TSDB_CODE_
QW_MSG
_ERROR
);
}
if
(
taskStatus
!=
JOB_TASK_STATUS_EXEC
)
{
SCH_TASK_ELOG
(
"rsp msg conflicted with task status, status:%s, rspType:%s"
,
jobTaskStatusStr
(
taskStatus
),
TMSG_INFO
(
msgType
));
SCH_ERR_RET
(
TSDB_CODE_
SCH_STATUS
_ERROR
);
SCH_ERR_RET
(
TSDB_CODE_
QW_MSG
_ERROR
);
}
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/scheduler/src/schTask.c
浏览文件 @
bf3a2de6
...
...
@@ -64,6 +64,7 @@ int32_t schInitTask(SSchJob *pJob, SSchTask *pTask, SSubplan *pPlan, SSchLevel *
pTask
->
plan
=
pPlan
;
pTask
->
level
=
pLevel
;
pTask
->
execId
=
-
1
;
pTask
->
failedExecId
=
-
2
;
pTask
->
timeoutUsec
=
SCH_DEFAULT_TASK_TIMEOUT_USEC
;
pTask
->
taskId
=
schGenTaskId
();
...
...
@@ -166,7 +167,7 @@ int32_t schUpdateTaskHandle(SSchJob *pJob, SSchTask *pTask, bool dropExecNode, v
schUpdateTaskExecNode
(
pJob
,
pTask
,
handle
,
execId
);
if
((
execId
!=
pTask
->
execId
)
||
pTask
->
waitRetry
)
{
// ignore it
if
((
execId
!=
pTask
->
execId
||
execId
<=
pTask
->
failedExecId
)
||
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_ERR_RET
(
TSDB_CODE_SCH_IGNORE_ERROR
);
...
...
@@ -182,6 +183,8 @@ int32_t schProcessOnTaskFailure(SSchJob *pJob, SSchTask *pTask, int32_t errCode)
return
TSDB_CODE_SCH_IGNORE_ERROR
;
}
pTask
->
failedExecId
=
pTask
->
execId
;
int8_t
jobStatus
=
0
;
if
(
schJobNeedToStop
(
pJob
,
&
jobStatus
))
{
SCH_TASK_DLOG
(
"no more task failure processing cause of job status %s"
,
jobTaskStatusStr
(
jobStatus
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录