Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0f2a175e
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看板
提交
0f2a175e
编写于
1月 06, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] fix a race condition.
上级
284e7943
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
7 deletion
+16
-7
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+1
-1
source/libs/scheduler/src/scheduler.c
source/libs/scheduler/src/scheduler.c
+15
-6
未找到文件。
source/libs/catalog/src/catalog.c
浏览文件 @
0f2a175e
...
...
@@ -310,7 +310,7 @@ int32_t ctgGetVgInfoFromHashValue(SDBVgroupInfo *dbInfo, const SName *pTableName
}
if
(
NULL
==
vgInfo
)
{
ctgError
(
"no hash range found for hashvalue [%u], numOfVgId:%d"
,
hashValue
,
taosHashGetSize
(
dbInfo
->
vgInfo
));
ctgError
(
"no hash range found for hash
value [%u], numOfVgId:%d"
,
hashValue
,
taosHashGetSize
(
dbInfo
->
vgInfo
));
void
*
pIter1
=
taosHashIterate
(
dbInfo
->
vgInfo
,
NULL
);
while
(
pIter1
)
{
...
...
source/libs/scheduler/src/scheduler.c
浏览文件 @
0f2a175e
...
...
@@ -274,12 +274,14 @@ int32_t schSetTaskCandidateAddrs(SSchJob *job, SSchTask *task) {
}
int32_t
schPushTaskToExecList
(
SSchJob
*
job
,
SSchTask
*
t
ask
)
{
if
(
0
!=
taosHashPut
(
job
->
execTasks
,
&
task
->
taskId
,
sizeof
(
task
->
taskId
),
&
t
ask
,
POINTER_BYTES
))
{
qError
(
"
taosHashPut failed"
);
int32_t
schPushTaskToExecList
(
SSchJob
*
pJob
,
SSchTask
*
pT
ask
)
{
if
(
0
!=
taosHashPut
(
pJob
->
execTasks
,
&
pTask
->
taskId
,
sizeof
(
pTask
->
taskId
),
&
pT
ask
,
POINTER_BYTES
))
{
qError
(
"
failed to add new task, taskId:%"
PRId64
", reqId:0x"
PRIx64
", out of memory"
,
pJob
->
queryId
);
SCH_ERR_RET
(
TSDB_CODE_QRY_OUT_OF_MEMORY
);
}
qDebug
(
"add one task, taskId:%"
PRId64
", numOfTasks:%d, reqId:0x%"
PRIx64
,
pTask
->
taskId
,
taosHashGetSize
(
pJob
->
execTasks
),
pJob
->
queryId
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -583,8 +585,14 @@ int32_t schHandleCallback(void* param, const SDataBuf* pMsg, int32_t msgType, in
SCH_ERR_JRET
(
TSDB_CODE_SCH_INTERNAL_ERROR
);
}
int32_t
s
=
taosHashGetSize
((
*
job
)
->
execTasks
);
assert
(
s
!=
0
);
SSchTask
**
task
=
taosHashGet
((
*
job
)
->
execTasks
,
&
pParam
->
taskId
,
sizeof
(
pParam
->
taskId
));
if
(
NULL
==
task
||
NULL
==
(
*
task
))
{
void
*
f1
=
taosHashGet
((
*
job
)
->
execTasks
,
&
pParam
->
taskId
,
sizeof
(
pParam
->
taskId
));
assert
(
0
);
qError
(
"taosHashGet taskId:%"
PRIx64
" not exist"
,
pParam
->
taskId
);
SCH_ERR_JRET
(
TSDB_CODE_SCH_INTERNAL_ERROR
);
}
...
...
@@ -819,12 +827,13 @@ int32_t schLaunchTask(SSchJob *job, SSchTask *task) {
SCH_ERR_RET
(
schSetTaskCandidateAddrs
(
job
,
task
));
if
(
NULL
==
task
->
candidateAddrs
||
taosArrayGetSize
(
task
->
candidateAddrs
)
<=
0
)
{
SCH_TASK_ERR_LOG
(
"no valid c
o
ndidate node for task:%"
PRIx64
,
task
->
taskId
);
SCH_TASK_ERR_LOG
(
"no valid c
a
ndidate node for task:%"
PRIx64
,
task
->
taskId
);
SCH_ERR_RET
(
TSDB_CODE_SCH_INTERNAL_ERROR
);
}
SCH_ERR_RET
(
schBuildAndSendMsg
(
job
,
task
,
plan
->
msgType
));
// NOTE: race condition: the task should be put into the hash table before send msg to server
SCH_ERR_RET
(
schPushTaskToExecList
(
job
,
task
));
SCH_ERR_RET
(
schBuildAndSendMsg
(
job
,
task
,
plan
->
msgType
));
task
->
status
=
JOB_TASK_STATUS_EXECUTING
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -975,7 +984,7 @@ _return:
}
int32_t
scheduleExecJob
(
void
*
transport
,
SArray
*
nodeList
,
SQueryDag
*
pDag
,
void
**
pJob
,
SQueryResult
*
pRes
)
{
if
(
NULL
==
transport
||
/* NULL == nodeList || */
NULL
==
pDag
||
NULL
==
pDag
->
pSubplans
||
NULL
==
pJob
||
NULL
==
pRes
)
{
if
(
NULL
==
transport
||
NULL
==
pDag
||
NULL
==
pDag
->
pSubplans
||
NULL
==
pJob
||
NULL
==
pRes
)
{
SCH_ERR_RET
(
TSDB_CODE_QRY_INVALID_INPUT
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录