Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a3abe255
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
a3abe255
编写于
5月 31, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
65b81a80
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
14 deletion
+16
-14
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+4
-2
source/dnode/vnode/src/tq/tqSink.c
source/dnode/vnode/src/tq/tqSink.c
+5
-7
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+6
-4
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+1
-1
未找到文件。
source/dnode/vnode/src/tq/tq.c
浏览文件 @
a3abe255
...
...
@@ -1272,13 +1272,15 @@ int32_t tqProcessTaskDispatchRsp(STQ* pTq, SRpcMsg* pMsg) {
SStreamDispatchRsp
*
pRsp
=
POINTER_SHIFT
(
pMsg
->
pCont
,
sizeof
(
SMsgHead
));
int32_t
taskId
=
ntohl
(
pRsp
->
upstreamTaskId
);
SStreamTask
*
pTask
=
streamMetaAcquireTask
(
pTq
->
pStreamMeta
,
taskId
);
tqDebug
(
"recv dispatch rsp, code:%x"
,
pMsg
->
code
);
int32_t
vgId
=
pTq
->
pStreamMeta
->
vgId
;
tqDebug
(
"vgId:%d recv dispatch rsp, code:%d"
,
vgId
,
pMsg
->
code
);
if
(
pTask
)
{
streamProcessDispatchRsp
(
pTask
,
pRsp
,
pMsg
->
code
);
streamMetaReleaseTask
(
pTq
->
pStreamMeta
,
pTask
);
return
0
;
}
else
{
return
-
1
;
tqDebug
(
"vgId:%d failed to find task:0x%x"
,
vgId
,
taskId
)
;
}
}
...
...
source/dnode/vnode/src/tq/tqSink.c
浏览文件 @
a3abe255
...
...
@@ -137,7 +137,7 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
int32_t
blockSz
=
taosArrayGetSize
(
pBlocks
);
tqDebug
(
"vgId:%d, s-task:%s write results
blocks:%d
into table"
,
TD_VID
(
pVnode
),
pTask
->
id
.
idStr
,
blockSz
);
tqDebug
(
"vgId:%d, s-task:%s write results
%d blocks
into table"
,
TD_VID
(
pVnode
),
pTask
->
id
.
idStr
,
blockSz
);
void
*
pBuf
=
NULL
;
SArray
*
tagArray
=
NULL
;
...
...
@@ -482,17 +482,15 @@ void tqSinkToTablePipeline(SStreamTask* pTask, void* vnode, int64_t ver, void* d
tEncoderClear
(
&
encoder
);
tDestroySubmitReq
(
&
submitReq
,
TSDB_MSG_FLG_ENCODE
);
SRpcMsg
msg
=
{
.
msgType
=
TDMT_VND_SUBMIT
,
.
pCont
=
pBuf
,
.
contLen
=
len
,
};
SRpcMsg
msg
=
{
.
msgType
=
TDMT_VND_SUBMIT
,
.
pCont
=
pBuf
,
.
contLen
=
len
};
if
(
tmsgPutToQueue
(
&
pVnode
->
msgCb
,
WRITE_QUEUE
,
&
msg
)
!=
0
)
{
tqDebug
(
"failed to put into write-queue since %s"
,
terrstr
());
}
}
}
tqDebug
(
"vgId:%d, s-task:%s write results completed"
,
TD_VID
(
pVnode
),
pTask
->
id
.
idStr
);
_end:
taosArrayDestroy
(
tagArray
);
taosArrayDestroy
(
pVals
);
...
...
source/libs/stream/src/stream.c
浏览文件 @
a3abe255
...
...
@@ -126,7 +126,7 @@ int32_t streamTaskEnqueueBlocks(SStreamTask* pTask, const SStreamDispatchReq* pR
if
(
pBlock
==
NULL
)
{
streamTaskInputFail
(
pTask
);
status
=
TASK_INPUT_STATUS__FAILED
;
q
Debug
(
"vgId:%d, s-task:%s failed to receive dispatch msg, reason: out of memory"
,
pTask
->
pMeta
->
vgId
,
q
Error
(
"vgId:%d, s-task:%s failed to receive dispatch msg, reason: out of memory"
,
pTask
->
pMeta
->
vgId
,
pTask
->
id
.
idStr
);
}
else
{
int32_t
code
=
tAppendDataToInputQueue
(
pTask
,
(
SStreamQueueItem
*
)
pBlock
);
...
...
@@ -233,7 +233,7 @@ int32_t streamProcessDispatchMsg(SStreamTask* pTask, SStreamDispatchReq* pReq, S
}
int32_t
streamProcessDispatchRsp
(
SStreamTask
*
pTask
,
SStreamDispatchRsp
*
pRsp
,
int32_t
code
)
{
qDebug
(
"s-task:%s receive dispatch rsp, status:%d code:%d"
,
pTask
->
id
.
idStr
,
pRsp
->
inputStatus
,
code
);
qDebug
(
"s-task:%s receive dispatch rsp,
output
status:%d code:%d"
,
pTask
->
id
.
idStr
,
pRsp
->
inputStatus
,
code
);
if
(
pTask
->
outputType
==
TASK_OUTPUT__SHUFFLE_DISPATCH
)
{
int32_t
leftRsp
=
atomic_sub_fetch_32
(
&
pTask
->
shuffleDispatcher
.
waitingRspCnt
,
1
);
...
...
@@ -246,13 +246,15 @@ int32_t streamProcessDispatchRsp(SStreamTask* pTask, SStreamDispatchRsp* pRsp, i
int8_t
old
=
atomic_exchange_8
(
&
pTask
->
outputStatus
,
pRsp
->
inputStatus
);
ASSERT
(
old
==
TASK_OUTPUT_STATUS__WAIT
);
qDebug
(
"s-task:%s receive dispatch rsp, output status:%d"
,
pTask
->
id
.
idStr
,
pTask
->
outputStatus
);
// the input queue of the (down stream) task that receive the output data is full, so the TASK_INPUT_STATUS_BLOCKED is rsp
// todo we need to send EMPTY PACKAGE to detect if the input queue is available for output of upstream task, every 50 ms.
if
(
pRsp
->
inputStatus
==
TASK_INPUT_STATUS__BLOCKED
)
{
// TODO: init recover timer
qError
(
"s-task:%s inputQ of downstream task:0x%x is full, need to block output"
,
pTask
->
id
.
idStr
,
pRsp
->
downstreamTaskId
);
atomic_store_8
(
&
pTask
->
outputStatus
,
TASK_OUTPUT_STATUS__NORMAL
);
qError
(
"s-task:%s ignore error, and reset task output status:%d"
,
pTask
->
id
.
idStr
,
pTask
->
outputStatus
);
return
0
;
}
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
a3abe255
...
...
@@ -385,7 +385,7 @@ int32_t streamExecForAll(SStreamTask* pTask) {
if
(
pTask
->
taskLevel
==
TASK_LEVEL__SINK
)
{
ASSERT
(
pInput
->
type
==
STREAM_INPUT__DATA_BLOCK
);
qDebug
(
"s-task:%s sink
node start to sink result. numOfBlocks:%d
"
,
pTask
->
id
.
idStr
,
batchSize
);
qDebug
(
"s-task:%s sink
task start to sink %d blocks
"
,
pTask
->
id
.
idStr
,
batchSize
);
streamTaskOutputResultBlock
(
pTask
,
(
SStreamDataBlock
*
)
pInput
);
continue
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录