Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6ff50d4e
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
6ff50d4e
编写于
7月 27, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): update the step2 scan wal files.
上级
c54bd55c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
29 addition
and
36 deletion
+29
-36
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+1
-1
source/dnode/vnode/src/tq/tqRestore.c
source/dnode/vnode/src/tq/tqRestore.c
+22
-22
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+2
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+1
-9
source/libs/stream/src/streamRecover.c
source/libs/stream/src/streamRecover.c
+2
-1
未找到文件。
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
6ff50d4e
...
...
@@ -310,7 +310,7 @@ int32_t extractMsgFromWal(SWalReader* pReader, void** pItem, int64_t maxVer, con
int64_t
ver
=
pReader
->
pHead
->
head
.
version
;
if
(
ver
>
maxVer
)
{
tqDebug
(
"maxVer in WAL:%"
PRId64
" reached
, do not scan wal anymore, %s"
,
maxV
er
,
id
);
tqDebug
(
"maxVer in WAL:%"
PRId64
" reached
current:%"
PRId64
", do not scan wal anymore, %s"
,
maxVer
,
v
er
,
id
);
return
TSDB_CODE_SUCCESS
;
}
...
...
source/dnode/vnode/src/tq/tqRestore.c
浏览文件 @
6ff50d4e
...
...
@@ -209,6 +209,17 @@ int32_t doSetOffsetForWalReader(SStreamTask *pTask, int32_t vgId) {
return
TSDB_CODE_SUCCESS
;
}
static
void
checkForFillHistoryVerRange
(
SStreamTask
*
pTask
,
int64_t
ver
)
{
if
((
pTask
->
info
.
fillHistory
==
1
)
&&
ver
>
pTask
->
dataRange
.
range
.
maxVer
)
{
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
);
}
}
int32_t
createStreamTaskRunReq
(
SStreamMeta
*
pStreamMeta
,
bool
*
pScanIdle
)
{
*
pScanIdle
=
true
;
bool
noDataInWal
=
true
;
...
...
@@ -251,6 +262,15 @@ int32_t createStreamTaskRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
continue
;
}
if
((
pTask
->
info
.
fillHistory
==
1
)
&&
pTask
->
status
.
transferState
)
{
ASSERT
(
status
==
TASK_STATUS__SCAN_HISTORY_WAL
);
// the maximum version of data in the WAL has reached already, the step2 is done
tqDebug
(
"s-task:%s fill-history reach the maximum ver:%"
PRId64
", not scan wal anymore"
,
pTask
->
id
.
idStr
,
pTask
->
dataRange
.
range
.
maxVer
);
streamMetaReleaseTask
(
pStreamMeta
,
pTask
);
continue
;
}
if
(
tInputQueueIsFull
(
pTask
))
{
tqTrace
(
"s-task:%s input queue is full, do nothing"
,
pTask
->
id
.
idStr
);
streamMetaReleaseTask
(
pStreamMeta
,
pTask
);
...
...
@@ -259,17 +279,6 @@ int32_t createStreamTaskRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
*
pScanIdle
=
false
;
if
(
pTask
->
info
.
fillHistory
==
1
)
{
ASSERT
(
pTask
->
status
.
taskStatus
==
TASK_STATUS__SCAN_HISTORY_WAL
);
// the maximum version of data in the WAL has reached already, the step2 is done
if
(
pTask
->
chkInfo
.
currentVer
>
pTask
->
dataRange
.
range
.
maxVer
)
{
qWarn
(
"s-task:%s fill-history scan WAL, reach the maximum ver:%"
PRId64
", not scan wal anymore"
,
pTask
->
id
.
idStr
,
pTask
->
chkInfo
.
currentVer
);
streamMetaReleaseTask
(
pStreamMeta
,
pTask
);
continue
;
}
}
// seek the stored version and extract data from WAL
int32_t
code
=
doSetOffsetForWalReader
(
pTask
,
vgId
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -284,6 +293,7 @@ int32_t createStreamTaskRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
code
=
extractMsgFromWal
(
pTask
->
exec
.
pWalReader
,
(
void
**
)
&
pItem
,
maxVer
,
pTask
->
id
.
idStr
);
if
((
code
!=
TSDB_CODE_SUCCESS
||
pItem
==
NULL
)
&&
(
numOfItemsInQ
==
0
))
{
// failed, continue
checkForFillHistoryVerRange
(
pTask
,
walReaderGetCurrentVer
(
pTask
->
exec
.
pWalReader
));
streamMetaReleaseTask
(
pStreamMeta
,
pTask
);
continue
;
}
...
...
@@ -294,18 +304,8 @@ int32_t createStreamTaskRunReq(SStreamMeta* pStreamMeta, bool* pScanIdle) {
if
(
code
==
TSDB_CODE_SUCCESS
)
{
int64_t
ver
=
walReaderGetCurrentVer
(
pTask
->
exec
.
pWalReader
);
pTask
->
chkInfo
.
currentVer
=
ver
;
checkForFillHistoryVerRange
(
pTask
,
ver
);
tqDebug
(
"s-task:%s set the ver:%"
PRId64
" from WALReader after extract block from WAL"
,
pTask
->
id
.
idStr
,
ver
);
{
if
(
pTask
->
info
.
fillHistory
==
1
)
{
// the maximum version of data in the WAL has reached already, the step2 is done
if
(
pTask
->
chkInfo
.
currentVer
>
pTask
->
dataRange
.
range
.
maxVer
)
{
qWarn
(
"s-task:%s fill-history scan WAL, reach the maximum ver:%"
PRId64
", not scan wal anymore, set the transfer state flag"
,
pTask
->
id
.
idStr
,
pTask
->
chkInfo
.
currentVer
);
pTask
->
status
.
transferState
=
true
;
}
}
}
}
else
{
tqError
(
"s-task:%s append input queue failed, too many in inputQ, ver:%"
PRId64
,
pTask
->
id
.
idStr
,
pTask
->
chkInfo
.
currentVer
);
...
...
source/libs/executor/src/executor.c
浏览文件 @
6ff50d4e
...
...
@@ -892,7 +892,7 @@ int32_t qStreamSourceScanParamForHistoryScanStep1(qTaskInfo_t tinfo, SVersionRan
pStreamInfo
->
recoverStep1Finished
=
false
;
pStreamInfo
->
recoverStep2Finished
=
false
;
qDebug
(
"%s step 1. set param for stream scanner for scan
history data, verRange:%"
PRId64
" - %"
PRId64
", window:%"
PRId64
qDebug
(
"%s step 1. set param for stream scanner for scan
-
history data, verRange:%"
PRId64
" - %"
PRId64
", window:%"
PRId64
" - %"
PRId64
,
GET_TASKID
(
pTaskInfo
),
pStreamInfo
->
fillHistoryVer
.
minVer
,
pStreamInfo
->
fillHistoryVer
.
maxVer
,
pWindow
->
skey
,
pWindow
->
ekey
);
...
...
@@ -911,7 +911,7 @@ int32_t qStreamSourceScanParamForHistoryScanStep2(qTaskInfo_t tinfo, SVersionRan
pStreamInfo
->
recoverStep1Finished
=
true
;
pStreamInfo
->
recoverStep2Finished
=
false
;
qDebug
(
"%s step 2. set param for stream scanner for scan
history data, verRange:%"
PRId64
" - %"
PRId64
qDebug
(
"%s step 2. set param for stream scanner for scan
-
history data, verRange:%"
PRId64
" - %"
PRId64
", window:%"
PRId64
" - %"
PRId64
,
GET_TASKID
(
pTaskInfo
),
pStreamInfo
->
fillHistoryVer
.
minVer
,
pStreamInfo
->
fillHistoryVer
.
maxVer
,
pWindow
->
skey
,
pWindow
->
ekey
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
6ff50d4e
...
...
@@ -1793,7 +1793,7 @@ static void doBlockDataWindowFilter(SSDataBlock* pBlock, int32_t tsIndex, STimeW
}
}
}
else
if
(
pWindow
->
ekey
!=
INT64_MAX
)
{
qDebug
(
"%s filter for additional history window, ekey:%"
PRId64
,
id
,
pWindow
->
s
key
);
qDebug
(
"%s filter for additional history window, ekey:%"
PRId64
,
id
,
pWindow
->
e
key
);
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
rows
;
++
i
)
{
int64_t
*
ts
=
(
int64_t
*
)
colDataGetData
(
pCol
,
i
);
p
[
i
]
=
(
*
ts
<=
pWindow
->
ekey
);
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
6ff50d4e
...
...
@@ -355,8 +355,7 @@ static int32_t streamTransferStateToStreamTask(SStreamTask* pTask) {
SStreamTask
*
pStreamTask
=
streamMetaAcquireTask
(
pMeta
,
pTask
->
streamTaskId
.
taskId
);
if
(
pStreamTask
==
NULL
)
{
pTask
->
status
.
transferState
=
false
;
// reset this value, to avoid transfer state again
// todo: destroy this task here
qError
(
"s-task:%s failed to find related stream task:0x%x, it may have been destroyed or closed"
,
pTask
->
id
.
idStr
,
pTask
->
streamTaskId
.
taskId
);
return
TSDB_CODE_STREAM_TASK_NOT_EXIST
;
...
...
@@ -510,13 +509,6 @@ int32_t streamExecForAll(SStreamTask* pTask) {
/*int32_t code = */
extractMsgFromInputQ
(
pTask
,
&
pInput
,
&
batchSize
,
id
);
if
(
pInput
==
NULL
)
{
ASSERT
(
batchSize
==
0
);
// if (pTask->info.fillHistory && pTask->status.transferState) {
// int32_t code = streamTransferStateToStreamTask(pTask);
// if (code != TSDB_CODE_SUCCESS) { // todo handle this
// return 0;
// }
// }
break
;
}
...
...
source/libs/stream/src/streamRecover.c
浏览文件 @
6ff50d4e
...
...
@@ -844,7 +844,8 @@ void streamTaskPause(SStreamTask* pTask) {
return
;
}
qDebug
(
"s-task:%s wait for the task can be paused, vgId:%d"
,
pTask
->
id
.
idStr
,
pMeta
->
vgId
);
const
char
*
pStatus
=
streamGetTaskStatusStr
(
status
);
qDebug
(
"s-task:%s wait for the task can be paused, status:%s, vgId:%d"
,
pTask
->
id
.
idStr
,
pStatus
,
pMeta
->
vgId
);
taosMsleep
(
100
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录