Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d29f835a
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看板
提交
d29f835a
编写于
7月 25, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): set the correct step2 scan time window range.
上级
a2694b9c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
38 addition
and
36 deletion
+38
-36
source/dnode/vnode/src/inc/tq.h
source/dnode/vnode/src/inc/tq.h
+0
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+6
-4
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+1
-0
source/dnode/vnode/src/tq/tqUtil.c
source/dnode/vnode/src/tq/tqUtil.c
+0
-15
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+4
-2
source/libs/stream/src/stream.c
source/libs/stream/src/stream.c
+11
-11
source/libs/stream/src/streamData.c
source/libs/stream/src/streamData.c
+7
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+9
-2
未找到文件。
source/dnode/vnode/src/inc/tq.h
浏览文件 @
d29f835a
...
...
@@ -172,7 +172,6 @@ int32_t tqStreamTasksStatusCheck(STQ* pTq);
// tq util
int32_t
extractDelDataBlock
(
const
void
*
pData
,
int32_t
len
,
int64_t
ver
,
SStreamRefDataBlock
**
pRefBlock
);
int32_t
tqAddInputBlockNLaunchTask
(
SStreamTask
*
pTask
,
SStreamQueueItem
*
pQueueItem
);
int32_t
tqExtractDataForMq
(
STQ
*
pTq
,
STqHandle
*
pHandle
,
const
SMqPollReq
*
pRequest
,
SRpcMsg
*
pMsg
);
int32_t
tqDoSendDataRsp
(
const
SRpcHandleInfo
*
pRpcHandleInfo
,
const
SMqDataRsp
*
pRsp
,
int32_t
epoch
,
int64_t
consumerId
,
int32_t
type
,
int64_t
sver
,
int64_t
ever
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
d29f835a
...
...
@@ -1136,7 +1136,7 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) {
pTask
->
streamTaskId
.
taskId
,
pTask
->
id
.
idStr
);
pTask
->
status
.
taskStatus
=
TASK_STATUS__DROPPING
;
tqDebug
(
"s-task:%s
scan-history-
task set status to be dropping"
,
id
);
tqDebug
(
"s-task:%s
fill-history
task set status to be dropping"
,
id
);
streamMetaSaveTask
(
pMeta
,
pTask
);
streamMetaReleaseTask
(
pMeta
,
pTask
);
...
...
@@ -1166,12 +1166,14 @@ int32_t tqProcessTaskScanHistory(STQ* pTq, SRpcMsg* pMsg) {
}
if
(
!
streamTaskRecoverScanStep1Finished
(
pTask
))
{
tqDebug
(
"s-task:%s level:%d verRange:%"
PRId64
" - %"
PRId64
" do secondary scan-history-data after halt the related stream task:%s"
,
id
,
pTask
->
info
.
taskLevel
,
pRange
->
minVer
,
pRange
->
maxVer
,
id
);
STimeWindow
*
pWindow
=
&
pTask
->
dataRange
.
window
;
tqDebug
(
"s-task:%s level:%d verRange:%"
PRId64
" - %"
PRId64
" window:%"
PRId64
"-%"
PRId64
", do secondary scan-history data after halt the related stream task:%s"
,
id
,
pTask
->
info
.
taskLevel
,
pRange
->
minVer
,
pRange
->
maxVer
,
pWindow
->
skey
,
pWindow
->
ekey
,
id
);
ASSERT
(
pTask
->
status
.
schedStatus
==
TASK_SCHED_STATUS__WAITING
);
st
=
taosGetTimestampMs
();
streamSetParamForStreamScannerStep2
(
pTask
,
pRange
,
&
pTask
->
dataRange
.
w
indow
);
streamSetParamForStreamScannerStep2
(
pTask
,
pRange
,
pW
indow
);
}
if
(
!
streamTaskRecoverScanStep2Finished
(
pTask
))
{
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
d29f835a
...
...
@@ -336,6 +336,7 @@ int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, const char* id) {
int32_t
len
=
pReader
->
pHead
->
head
.
bodyLen
-
sizeof
(
SMsgHead
);
extractDelDataBlock
(
pBody
,
len
,
ver
,
(
SStreamRefDataBlock
**
)
pItem
);
tqDebug
(
"s-task:%s delete msg extract from WAL, len:%d, ver:%"
PRId64
,
id
,
len
,
ver
);
}
else
{
ASSERT
(
0
);
}
...
...
source/dnode/vnode/src/tq/tqUtil.c
浏览文件 @
d29f835a
...
...
@@ -20,21 +20,6 @@
static
int32_t
tqSendMetaPollRsp
(
STqHandle
*
pHandle
,
const
SRpcMsg
*
pMsg
,
const
SMqPollReq
*
pReq
,
const
SMqMetaRsp
*
pRsp
,
int32_t
vgId
);
int32_t
tqAddInputBlockNLaunchTask
(
SStreamTask
*
pTask
,
SStreamQueueItem
*
pQueueItem
)
{
int32_t
code
=
tAppendDataToInputQueue
(
pTask
,
pQueueItem
);
if
(
code
<
0
)
{
tqError
(
"s-task:%s failed to put into queue, too many"
,
pTask
->
id
.
idStr
);
return
-
1
;
}
if
(
streamSchedExec
(
pTask
)
<
0
)
{
tqError
(
"stream task:%d failed to be launched, code:%s"
,
pTask
->
id
.
taskId
,
tstrerror
(
terrno
));
return
-
1
;
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
tqInitDataRsp
(
SMqDataRsp
*
pRsp
,
const
SMqPollReq
*
pReq
)
{
pRsp
->
reqOffset
=
pReq
->
reqOffset
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
d29f835a
...
...
@@ -1800,8 +1800,10 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
}
else
{
pTSInfo
->
base
.
cond
.
startVersion
=
pStreamInfo
->
fillHistoryVer
.
minVer
;
pTSInfo
->
base
.
cond
.
endVersion
=
pStreamInfo
->
fillHistoryVer
.
maxVer
;
qDebug
(
"stream recover step2, verRange:%"
PRId64
" - %"
PRId64
", %s"
,
pTSInfo
->
base
.
cond
.
startVersion
,
pTSInfo
->
base
.
cond
.
endVersion
,
id
);
pTSInfo
->
base
.
cond
.
twindows
=
pStreamInfo
->
fillHistoryWindow
;
qDebug
(
"stream recover step2, verRange:%"
PRId64
" - %"
PRId64
", window:%"
PRId64
"-%"
PRId64
", %s"
,
pTSInfo
->
base
.
cond
.
startVersion
,
pTSInfo
->
base
.
cond
.
endVersion
,
pTSInfo
->
base
.
cond
.
twindows
.
skey
,
pTSInfo
->
base
.
cond
.
twindows
.
ekey
,
id
);
pStreamInfo
->
recoverStep
=
STREAM_RECOVER_STEP__SCAN2
;
}
...
...
source/libs/stream/src/stream.c
浏览文件 @
d29f835a
...
...
@@ -65,7 +65,7 @@ static void streamSchedByTimer(void* param, void* tmrId) {
SStreamTask
*
pTask
=
(
void
*
)
param
;
int8_t
status
=
atomic_load_8
(
&
pTask
->
triggerStatus
);
qDebug
(
"s-task:%s in scheduler
timer, trigger status:%d"
,
pTask
->
id
.
idStr
,
status
);
qDebug
(
"s-task:%s in scheduler
, trigger status:%d, next:%dms"
,
pTask
->
id
.
idStr
,
status
,
(
int32_t
)
pTask
->
triggerParam
);
if
(
streamTaskShouldStop
(
&
pTask
->
status
)
||
streamTaskShouldPause
(
&
pTask
->
status
))
{
streamMetaReleaseTask
(
NULL
,
pTask
);
...
...
@@ -74,23 +74,22 @@ static void streamSchedByTimer(void* param, void* tmrId) {
}
if
(
status
==
TASK_TRIGGER_STATUS__ACTIVE
)
{
SStreamTrigger
*
t
rigger
=
taosAllocateQitem
(
sizeof
(
SStreamTrigger
),
DEF_QITEM
,
0
);
if
(
t
rigger
==
NULL
)
{
SStreamTrigger
*
pT
rigger
=
taosAllocateQitem
(
sizeof
(
SStreamTrigger
),
DEF_QITEM
,
0
);
if
(
pT
rigger
==
NULL
)
{
return
;
}
t
rigger
->
type
=
STREAM_INPUT__GET_RES
;
t
rigger
->
pBlock
=
taosMemoryCalloc
(
1
,
sizeof
(
SSDataBlock
));
if
(
t
rigger
->
pBlock
==
NULL
)
{
taosFreeQitem
(
t
rigger
);
pT
rigger
->
type
=
STREAM_INPUT__GET_RES
;
pT
rigger
->
pBlock
=
taosMemoryCalloc
(
1
,
sizeof
(
SSDataBlock
));
if
(
pT
rigger
->
pBlock
==
NULL
)
{
taosFreeQitem
(
pT
rigger
);
return
;
}
trigger
->
pBlock
->
info
.
type
=
STREAM_GET_ALL
;
atomic_store_8
(
&
pTask
->
triggerStatus
,
TASK_TRIGGER_STATUS__INACTIVE
);
if
(
tAppendDataToInputQueue
(
pTask
,
(
SStreamQueueItem
*
)
t
rigger
)
<
0
)
{
taosFreeQitem
(
t
rigger
);
pTrigger
->
pBlock
->
info
.
type
=
STREAM_GET_ALL
;
if
(
tAppendDataToInputQueue
(
pTask
,
(
SStreamQueueItem
*
)
pT
rigger
)
<
0
)
{
taosFreeQitem
(
pT
rigger
);
taosTmrReset
(
streamSchedByTimer
,
(
int32_t
)
pTask
->
triggerParam
,
pTask
,
streamEnv
.
timer
,
&
pTask
->
schedTimer
);
return
;
}
...
...
@@ -399,6 +398,7 @@ int32_t tAppendDataToInputQueue(SStreamTask* pTask, SStreamQueueItem* pItem) {
if
(
type
!=
STREAM_INPUT__GET_RES
&&
type
!=
STREAM_INPUT__CHECKPOINT
&&
pTask
->
triggerParam
!=
0
)
{
atomic_val_compare_exchange_8
(
&
pTask
->
triggerStatus
,
TASK_TRIGGER_STATUS__INACTIVE
,
TASK_TRIGGER_STATUS__ACTIVE
);
qDebug
(
"s-task:%s new data arrived, active the trigger, trigerStatus:%d"
,
pTask
->
id
.
idStr
,
pTask
->
triggerStatus
);
}
return
0
;
...
...
source/libs/stream/src/streamData.c
浏览文件 @
d29f835a
...
...
@@ -166,6 +166,8 @@ int32_t streamMergeSubmit(SStreamMergedSubmit* pMerged, SStreamDataSubmit* pSubm
}
SStreamQueueItem
*
streamMergeQueueItem
(
SStreamQueueItem
*
dst
,
SStreamQueueItem
*
pElem
)
{
terrno
=
0
;
if
(
dst
->
type
==
STREAM_INPUT__DATA_BLOCK
&&
pElem
->
type
==
STREAM_INPUT__DATA_BLOCK
)
{
SStreamDataBlock
*
pBlock
=
(
SStreamDataBlock
*
)
dst
;
SStreamDataBlock
*
pBlockSrc
=
(
SStreamDataBlock
*
)
pElem
;
...
...
@@ -181,7 +183,10 @@ SStreamQueueItem* streamMergeQueueItem(SStreamQueueItem* dst, SStreamQueueItem*
return
dst
;
}
else
if
(
dst
->
type
==
STREAM_INPUT__DATA_SUBMIT
&&
pElem
->
type
==
STREAM_INPUT__DATA_SUBMIT
)
{
SStreamMergedSubmit
*
pMerged
=
streamMergedSubmitNew
();
// todo handle error
if
(
pMerged
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
}
streamMergeSubmit
(
pMerged
,
(
SStreamDataSubmit
*
)
dst
);
streamMergeSubmit
(
pMerged
,
(
SStreamDataSubmit
*
)
pElem
);
...
...
@@ -189,6 +194,7 @@ SStreamQueueItem* streamMergeQueueItem(SStreamQueueItem* dst, SStreamQueueItem*
taosFreeQitem
(
pElem
);
return
(
SStreamQueueItem
*
)
pMerged
;
}
else
{
qDebug
(
"block type:%d not merged with existed blocks list, type:%d"
,
pElem
->
type
,
dst
->
type
);
return
NULL
;
}
}
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
d29f835a
...
...
@@ -407,9 +407,11 @@ static int32_t streamTransferStateToStreamTask(SStreamTask* pTask) {
streamTaskResumeFromHalt
(
pStreamTask
);
pTask
->
status
.
taskStatus
=
TASK_STATUS__DROPPING
;
qDebug
(
"s-task:%s fill-history task set status to be dropping, save the state into disk"
,
pTask
->
id
.
idStr
);
pTask
->
status
.
taskStatus
=
TASK_STATUS__DROPPING
;
streamMetaRemoveTask
(
pMeta
,
pTask
->
id
.
taskId
);
// save to disk
taosWLockLatch
(
&
pMeta
->
lock
);
streamMetaSaveTask
(
pMeta
,
pTask
);
...
...
@@ -464,7 +466,12 @@ static int32_t extractMsgFromInputQ(SStreamTask* pTask, SStreamQueueItem** pInpu
// todo we need to sort the data block, instead of just appending into the array list.
void
*
newRet
=
streamMergeQueueItem
(
*
pInput
,
qItem
);
if
(
newRet
==
NULL
)
{
qError
(
"s-task:%s failed to merge blocks from inputQ, numOfBlocks:%d"
,
id
,
*
numOfBlocks
);
if
(
terrno
==
0
)
{
qDebug
(
"s-task:%s failed to merge blocks from inputQ, numOfBlocks:%d"
,
id
,
*
numOfBlocks
);
}
else
{
qDebug
(
"s-task:%s failed to merge blocks from inputQ, numOfBlocks:%d, code:%s"
,
id
,
*
numOfBlocks
,
tstrerror
(
terrno
));
}
streamQueueProcessFail
(
pTask
->
inputQueue
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录