Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ce721a01
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看板
提交
ce721a01
编写于
8月 12, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): fix error.
上级
a89ce1a2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
15 deletion
+25
-15
include/libs/stream/tstream.h
include/libs/stream/tstream.h
+1
-0
source/dnode/vnode/src/tq/tqRestore.c
source/dnode/vnode/src/tq/tqRestore.c
+5
-3
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+2
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+12
-11
source/libs/stream/src/streamRecover.c
source/libs/stream/src/streamRecover.c
+5
-0
未找到文件。
include/libs/stream/tstream.h
浏览文件 @
ce721a01
...
...
@@ -272,6 +272,7 @@ typedef struct SStreamStatus {
int8_t
schedStatus
;
int8_t
keepTaskStatus
;
bool
transferState
;
bool
appendTranstateBlock
;
// has append the transfer state data block already
int8_t
timerActive
;
// timer is active
int8_t
pauseAllowed
;
// allowed task status to be set to be paused
}
SStreamStatus
;
...
...
source/dnode/vnode/src/tq/tqRestore.c
浏览文件 @
ce721a01
...
...
@@ -214,9 +214,11 @@ static void checkForFillHistoryVerRange(SStreamTask* pTask, int64_t ver) {
qWarn
(
"s-task:%s fill-history scan WAL, currentVer:%"
PRId64
" reach the maximum ver:%"
PRId64
", not scan wal anymore, set the transfer state flag"
,
pTask
->
id
.
idStr
,
ver
,
pTask
->
dataRange
.
range
.
maxVer
);
pTask
->
status
.
transferState
=
true
;
/*int32_t code = */
streamSchedExec
(
pTask
);
if
(
!
pTask
->
status
.
appendTranstateBlock
)
{
pTask
->
status
.
appendTranstateBlock
=
true
;
appendTranstateIntoInputQ
(
pTask
);
/*int32_t code = */
streamSchedExec
(
pTask
);
}
}
}
...
...
source/libs/stream/src/stream.c
浏览文件 @
ce721a01
...
...
@@ -385,8 +385,9 @@ int32_t tAppendDataToInputQueue(SStreamTask* pTask, SStreamQueueItem* pItem) {
destroyStreamDataBlock
((
SStreamDataBlock
*
)
pItem
);
return
code
;
}
}
else
if
(
type
==
STREAM_INPUT__CHECKPOINT
)
{
}
else
if
(
type
==
STREAM_INPUT__CHECKPOINT
||
type
==
STREAM_INPUT__TRANS_STATE
)
{
taosWriteQitem
(
pTask
->
inputQueue
->
queue
,
pItem
);
qDebug
(
"s-task:%s trans-state blockdata enqueue, total in queue:%d, size:%.2fMiB"
,
pTask
->
id
.
idStr
,
total
,
size
);
}
else
if
(
type
==
STREAM_INPUT__GET_RES
)
{
// use the default memory limit, refactor later.
taosWriteQitem
(
pTask
->
inputQueue
->
queue
,
pItem
);
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
ce721a01
...
...
@@ -391,11 +391,11 @@ static int32_t streamTransferStateToStreamTask(SStreamTask* pTask) {
streamTaskFillHistoryFinished
(
pTask
);
streamTaskEndScanWAL
(
pTask
);
code
=
streamDoTransferStateToStreamTask
(
pTask
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// todo handle this
return
code
;
}
}
else
if
(
level
==
TASK_LEVEL__AGG
)
{
// do transfer task operator states.
code
=
streamDoTransferStateToStreamTask
(
pTask
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// todo handle this
return
code
;
}
}
else
if
(
level
==
TASK_LEVEL__AGG
)
{
// do transfer task operator states.
code
=
streamDoTransferStateToStreamTask
(
pTask
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// todo handle this
return
code
;
...
...
@@ -484,9 +484,10 @@ int32_t streamProcessTranstateBlock(SStreamTask* pTask, SStreamDataBlock* pBlock
pTask
->
status
.
transferState
=
true
;
}
// dispatch the transtate block to downstream task immediately
if
(
level
==
TASK_LEVEL__SOURCE
||
level
==
TASK_LEVEL__AGG
)
{
// pBlock-> = pTask->id.taskId;
// dispatch the tran-state block to downstream task immediately
int32_t
type
=
pTask
->
outputInfo
.
type
;
if
((
level
==
TASK_LEVEL__AGG
||
level
==
TASK_LEVEL__SOURCE
)
&&
(
type
==
TASK_OUTPUT__FIXED_DISPATCH
||
type
==
TASK_OUTPUT__SHUFFLE_DISPATCH
))
{
pBlock
->
srcVgId
=
pTask
->
pMeta
->
vgId
;
code
=
taosWriteQitem
(
pTask
->
outputInfo
.
queue
->
queue
,
pBlock
);
if
(
code
==
0
)
{
...
...
@@ -640,10 +641,10 @@ int32_t streamTryExec(SStreamTask* pTask) {
// the schedStatus == TASK_SCHED_STATUS__ACTIVE, streamSchedExec cannot be executed, so execute once again by
// call this function (streamExecForAll) directly.
code
=
streamExecForAll
(
pTask
);
if
(
code
<
0
)
{
//
code = streamExecForAll(pTask);
//
if (code < 0) {
// do nothing
}
//
}
}
atomic_store_8
(
&
pTask
->
status
.
schedStatus
,
TASK_SCHED_STATUS__INACTIVE
);
...
...
source/libs/stream/src/streamRecover.c
浏览文件 @
ce721a01
...
...
@@ -427,6 +427,8 @@ int32_t appendTranstateIntoInputQ(SStreamTask* pTask) {
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pTranstate
->
type
=
STREAM_INPUT__TRANS_STATE
;
pBlock
->
info
.
type
=
STREAM_TRANS_STATE
;
pBlock
->
info
.
rows
=
1
;
pBlock
->
info
.
childId
=
pTask
->
info
.
selfChildId
;
...
...
@@ -440,7 +442,10 @@ int32_t appendTranstateIntoInputQ(SStreamTask* pTask) {
return
TSDB_CODE_OUT_OF_MEMORY
;
}
qDebug
(
"s-task:%s set sched-status:%d, prev:%d"
,
pTask
->
id
.
idStr
,
TASK_SCHED_STATUS__INACTIVE
,
pTask
->
status
.
schedStatus
);
pTask
->
status
.
schedStatus
=
TASK_SCHED_STATUS__INACTIVE
;
streamSchedExec
(
pTask
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录