Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cfe2cf0e
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看板
未验证
提交
cfe2cf0e
编写于
8月 16, 2023
作者:
H
Haojun Liao
提交者:
GitHub
8月 16, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22439 from taosdata/fix/liaohj
fix(stream): continue process when met with trans-state msg.
上级
6b961fc0
71c3c710
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
16 deletion
+15
-16
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+1
-1
source/libs/stream/src/streamDispatch.c
source/libs/stream/src/streamDispatch.c
+10
-5
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+4
-10
未找到文件。
source/libs/stream/src/stream.c
浏览文件 @
cfe2cf0e
...
...
@@ -378,7 +378,7 @@ int32_t tAppendDataToInputQueue(SStreamTask* pTask, SStreamQueueItem* pItem) {
}
}
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
);
qDebug
(
"s-task:%s
checkpoint/
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/streamDispatch.c
浏览文件 @
cfe2cf0e
...
...
@@ -364,7 +364,8 @@ static int32_t doSendDispatchMsg(SStreamTask* pTask, const SStreamDispatchReq* p
msg
.
pCont
=
buf
;
msg
.
msgType
=
pTask
->
msgInfo
.
msgType
;
qDebug
(
"s-task:%s dispatch msg to taskId:0x%x vgId:%d data msg"
,
pTask
->
id
.
idStr
,
pReq
->
taskId
,
vgId
);
qDebug
(
"s-task:%s dispatch msg to taskId:0x%x vgId:%d data msg, len:%d"
,
pTask
->
id
.
idStr
,
pReq
->
taskId
,
vgId
,
msg
.
contLen
);
return
tmsgSendReq
(
pEpSet
,
&
msg
);
FAIL:
...
...
@@ -730,10 +731,14 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i
// flag. here we need to retry dispatch this message to downstream task immediately. handle the case the failure
// happened too fast.
// todo handle the shuffle dispatch failure
qError
(
"s-task:%s failed to dispatch msg to task:0x%x, code:%s, retry cnt:%d"
,
id
,
pRsp
->
downstreamTaskId
,
tstrerror
(
code
),
++
pTask
->
msgInfo
.
retryCount
);
int32_t
ret
=
doDispatchAllBlocks
(
pTask
,
pTask
->
msgInfo
.
pData
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
==
TSDB_CODE_STREAM_TASK_NOT_EXIST
)
{
// destination task does not exist, not retry anymore
qWarn
(
"s-task:%s failed to dispatch msg to task:0x%x, no retry, since it is destroyed already"
,
id
,
pRsp
->
downstreamTaskId
);
}
else
{
qError
(
"s-task:%s failed to dispatch msg to task:0x%x, code:%s, retry cnt:%d"
,
id
,
pRsp
->
downstreamTaskId
,
tstrerror
(
code
),
++
pTask
->
msgInfo
.
retryCount
);
int32_t
ret
=
doDispatchAllBlocks
(
pTask
,
pTask
->
msgInfo
.
pData
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
}
}
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
cfe2cf0e
...
...
@@ -421,17 +421,12 @@ static int32_t extractBlocksFromInputQ(SStreamTask* pTask, SStreamQueueItem** pI
SStreamQueueItem
*
qItem
=
streamQueueNextItem
(
pTask
->
inputQueue
);
if
(
qItem
==
NULL
)
{
if
(
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SOURCE
&&
(
++
retryTimes
)
<
MAX_RETRY_TIMES
)
{
taosMsleep
(
10
);
qDebug
(
"===stream===try again batchSize:%d, retry:%d, %s"
,
*
numOfBlocks
,
retryTimes
,
id
);
continue
;
}
qDebug
(
"===stream===break batchSize:%d, %s"
,
*
numOfBlocks
,
id
);
return
TSDB_CODE_SUCCESS
;
}
qDebug
(
"s-task:%s sink task handle result block one-by-one"
,
id
);
qDebug
(
"s-task:%s sink task handle block one-by-one, type:%d"
,
id
,
qItem
->
type
);
*
numOfBlocks
=
1
;
*
pInput
=
qItem
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -467,8 +462,7 @@ static int32_t extractBlocksFromInputQ(SStreamTask* pTask, SStreamQueueItem** pI
return
TSDB_CODE_SUCCESS
;
}
else
{
// previous existed blocks needs to be handle, before handle the checkpoint msg block
qDebug
(
"s-task:%s checkpoint/transtate msg extracted, handle previous block first, numOfBlocks:%d"
,
id
,
*
numOfBlocks
);
qDebug
(
"s-task:%s checkpoint/transtate msg extracted, handle previous blocks, numOfBlocks:%d"
,
id
,
*
numOfBlocks
);
streamQueueProcessFail
(
pTask
->
inputQueue
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -581,7 +575,7 @@ int32_t streamExecForAll(SStreamTask* pTask) {
if
(
pInput
->
type
==
STREAM_INPUT__TRANS_STATE
)
{
streamProcessTranstateBlock
(
pTask
,
(
SStreamDataBlock
*
)
pInput
);
return
0
;
continue
;
}
if
(
pTask
->
info
.
taskLevel
==
TASK_LEVEL__SINK
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录