Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3cdb1635
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看板
提交
3cdb1635
编写于
8月 09, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): avoid launching check downstream when failed to add stream task into stream meta.
上级
bb39d94f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
24 deletion
+17
-24
include/libs/executor/executor.h
include/libs/executor/executor.h
+1
-3
source/dnode/snode/src/snode.c
source/dnode/snode/src/snode.c
+1
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+11
-16
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+2
-2
source/libs/stream/src/streamTask.c
source/libs/stream/src/streamTask.c
+1
-1
未找到文件。
include/libs/executor/executor.h
浏览文件 @
3cdb1635
...
...
@@ -74,7 +74,7 @@ typedef enum {
* @param vgId
* @return
*/
qTaskInfo_t
qCreateStreamExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
vgId
);
qTaskInfo_t
qCreateStreamExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
vgId
,
int32_t
taskId
);
/**
* Create the exec task for queue mode
...
...
@@ -95,8 +95,6 @@ int32_t qGetTableList(int64_t suid, void* pVnode, void* node, SArray **tableList
*/
void
qSetTaskId
(
qTaskInfo_t
tinfo
,
uint64_t
taskId
,
uint64_t
queryId
);
//void qSetTaskCode(qTaskInfo_t tinfo, int32_t code);
int32_t
qSetStreamOpOpen
(
qTaskInfo_t
tinfo
);
// todo refactor
...
...
source/dnode/snode/src/snode.c
浏览文件 @
3cdb1635
...
...
@@ -88,7 +88,7 @@ int32_t sndExpandTask(SSnode *pSnode, SStreamTask *pTask, int64_t ver) {
SReadHandle
handle
=
{
.
vnode
=
NULL
,
.
numOfVgroups
=
numOfChildEp
,
.
pStateBackend
=
pTask
->
pState
,
.
fillHistory
=
pTask
->
info
.
fillHistory
};
initStreamStateAPI
(
&
handle
.
api
);
pTask
->
exec
.
pExecutor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
,
0
);
pTask
->
exec
.
pExecutor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
,
0
,
pTask
->
id
.
taskId
);
ASSERT
(
pTask
->
exec
.
pExecutor
);
taosThreadMutexInit
(
&
pTask
->
lock
,
NULL
);
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
3cdb1635
...
...
@@ -267,7 +267,7 @@ static int32_t tdSetRSmaInfoItemParams(SSma *pSma, SRSmaParam *param, SRSmaStat
SReadHandle
handle
=
{.
vnode
=
pVnode
,
.
initTqReader
=
1
,
.
pStateBackend
=
pStreamState
};
initStorageAPI
(
&
handle
.
api
);
pRSmaInfo
->
taskInfo
[
idx
]
=
qCreateStreamExecTaskInfo
(
param
->
qmsg
[
idx
],
&
handle
,
TD_VID
(
pVnode
));
pRSmaInfo
->
taskInfo
[
idx
]
=
qCreateStreamExecTaskInfo
(
param
->
qmsg
[
idx
],
&
handle
,
TD_VID
(
pVnode
)
,
0
);
if
(
!
pRSmaInfo
->
taskInfo
[
idx
])
{
terrno
=
TSDB_CODE_RSMA_QTASKINFO_CREATE
;
return
TSDB_CODE_FAILED
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
3cdb1635
...
...
@@ -956,7 +956,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
.
winRange
=
pTask
->
dataRange
.
window
};
initStorageAPI
(
&
handle
.
api
);
pTask
->
exec
.
pExecutor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
,
vgId
);
pTask
->
exec
.
pExecutor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
,
vgId
,
pTask
->
id
.
taskId
);
if
(
pTask
->
exec
.
pExecutor
==
NULL
)
{
return
-
1
;
}
...
...
@@ -983,7 +983,7 @@ int32_t tqExpandTask(STQ* pTq, SStreamTask* pTask, int64_t ver) {
.
winRange
=
pTask
->
dataRange
.
window
};
initStorageAPI
(
&
handle
.
api
);
pTask
->
exec
.
pExecutor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
,
vgId
);
pTask
->
exec
.
pExecutor
=
qCreateStreamExecTaskInfo
(
pTask
->
exec
.
qmsg
,
&
handle
,
vgId
,
pTask
->
id
.
taskId
);
if
(
pTask
->
exec
.
pExecutor
==
NULL
)
{
return
-
1
;
}
...
...
@@ -1149,32 +1149,27 @@ int32_t tqProcessTaskDeployReq(STQ* pTq, int64_t sversion, char* msg, int32_t ms
taosWLockLatch
(
&
pStreamMeta
->
lock
);
code
=
streamMetaRegisterTask
(
pStreamMeta
,
sversion
,
pTask
,
&
added
);
int32_t
numOfTasks
=
streamMetaGetNumOfTasks
(
pStreamMeta
);
taosWUnLockLatch
(
&
pStreamMeta
->
lock
);
if
(
code
<
0
)
{
tqError
(
"vgId:%d failed to add s-task:0x%x, total:%d"
,
vgId
,
pTask
->
id
.
taskId
,
numOfTasks
);
tFreeStreamTask
(
pTask
);
taosWUnLockLatch
(
&
pStreamMeta
->
lock
);
return
-
1
;
}
// not added into meta store
if
(
!
added
)
{
if
(
added
)
{
tqDebug
(
"vgId:%d s-task:0x%x is deployed and add into meta, numOfTasks:%d"
,
vgId
,
taskId
,
numOfTasks
);
SStreamTask
*
p
=
streamMetaAcquireTask
(
pStreamMeta
,
taskId
);
if
(
p
!=
NULL
)
{
// reset the downstreamReady flag.
streamTaskCheckDownstreamTasks
(
p
);
}
streamMetaReleaseTask
(
pStreamMeta
,
p
);
}
else
{
tqWarn
(
"vgId:%d failed to add s-task:0x%x, already exists in meta store"
,
vgId
,
taskId
);
tFreeStreamTask
(
pTask
);
pTask
=
NULL
;
}
taosWUnLockLatch
(
&
pStreamMeta
->
lock
);
tqDebug
(
"vgId:%d s-task:0x%x is deployed and add into meta, numOfTasks:%d"
,
vgId
,
taskId
,
numOfTasks
);
// 3. It's an fill history task, do nothing. wait for the main task to start it
SStreamTask
*
p
=
streamMetaAcquireTask
(
pStreamMeta
,
taskId
);
if
(
p
!=
NULL
)
{
// reset the downstreamReady flag.
streamTaskCheckDownstreamTasks
(
p
);
}
streamMetaReleaseTask
(
pStreamMeta
,
p
);
return
0
;
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
3cdb1635
...
...
@@ -304,7 +304,7 @@ qTaskInfo_t qCreateQueueExecTaskInfo(void* msg, SReadHandle* pReaderHandle, int3
return
pTaskInfo
;
}
qTaskInfo_t
qCreateStreamExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
vgId
)
{
qTaskInfo_t
qCreateStreamExecTaskInfo
(
void
*
msg
,
SReadHandle
*
readers
,
int32_t
vgId
,
int32_t
taskId
)
{
if
(
msg
==
NULL
)
{
return
NULL
;
}
...
...
@@ -317,7 +317,7 @@ qTaskInfo_t qCreateStreamExecTaskInfo(void* msg, SReadHandle* readers, int32_t v
}
qTaskInfo_t
pTaskInfo
=
NULL
;
code
=
qCreateExecTask
(
readers
,
vgId
,
0
,
pPlan
,
&
pTaskInfo
,
NULL
,
NULL
,
OPTR_EXEC_MODEL_STREAM
);
code
=
qCreateExecTask
(
readers
,
vgId
,
taskId
,
pPlan
,
&
pTaskInfo
,
NULL
,
NULL
,
OPTR_EXEC_MODEL_STREAM
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
nodesDestroyNode
((
SNode
*
)
pPlan
);
qDestroyTask
(
pTaskInfo
);
...
...
source/libs/stream/src/streamTask.c
浏览文件 @
3cdb1635
...
...
@@ -216,7 +216,7 @@ static void freeItem(void* p) {
}
void
tFreeStreamTask
(
SStreamTask
*
pTask
)
{
qDebug
(
"free s-task:
%s, %p"
,
pTask
->
id
.
idStr
,
pTask
);
qDebug
(
"free s-task:
0x%x, %p"
,
pTask
->
id
.
taskId
,
pTask
);
int32_t
status
=
atomic_load_8
((
int8_t
*
)
&
(
pTask
->
status
.
taskStatus
));
if
(
pTask
->
inputQueue
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录