Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7cf99d53
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看板
提交
7cf99d53
编写于
7月 12, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(tmq): prepare only needed
上级
ac57956a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
29 deletion
+28
-29
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+4
-3
source/libs/executor/src/executorMain.c
source/libs/executor/src/executorMain.c
+23
-25
未找到文件。
source/common/src/tglobal.c
浏览文件 @
7cf99d53
...
...
@@ -412,7 +412,7 @@ static int32_t taosAddServerCfg(SConfig *pCfg) {
tsNumOfVnodeQueryThreads
=
TMAX
(
tsNumOfVnodeQueryThreads
,
2
);
if
(
cfgAddInt32
(
pCfg
,
"numOfVnodeQueryThreads"
,
tsNumOfVnodeQueryThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
tsNumOfVnodeFetchThreads
=
TRANGE
(
tsNumOfVnodeFetchThreads
,
4
,
4
);
tsNumOfVnodeFetchThreads
=
TRANGE
(
tsNumOfVnodeFetchThreads
,
1
,
1
);
if
(
cfgAddInt32
(
pCfg
,
"numOfVnodeFetchThreads"
,
tsNumOfVnodeFetchThreads
,
1
,
1024
,
0
)
!=
0
)
return
-
1
;
tsNumOfVnodeWriteThreads
=
tsNumOfCores
;
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
7cf99d53
...
...
@@ -284,7 +284,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
fetchOffsetNew
=
pOffset
->
val
;
char
formatBuf
[
80
];
tFormatOffset
(
formatBuf
,
80
,
&
fetchOffsetNew
);
tqDebug
(
"tmq poll: consumer %"
PRId64
", subkey %s, offset reset to %s"
,
consumerId
,
pHandle
->
subKey
,
formatBuf
);
tqDebug
(
"tmq poll: consumer %"
PRId64
", subkey %s, vg %d, offset reset to %s"
,
consumerId
,
pHandle
->
subKey
,
TD_VID
(
pTq
->
pVnode
),
formatBuf
);
}
else
{
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_EARLIEAST
)
{
if
(
pReq
->
useSnapshot
&&
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
...
...
@@ -299,8 +300,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
}
}
else
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_LATEST
)
{
tqOffsetResetToLog
(
&
dataRsp
.
rspOffset
,
walGetLastVer
(
pTq
->
pVnode
->
pWal
));
tqDebug
(
"tmq poll: consumer %ld, subkey %s, offset reset to %ld"
,
consumerId
,
pHandle
->
subKey
,
dataRsp
.
rspOffset
.
version
);
tqDebug
(
"tmq poll: consumer %ld, subkey %s,
vg %d,
offset reset to %ld"
,
consumerId
,
pHandle
->
subKey
,
TD_VID
(
pTq
->
pVnode
),
dataRsp
.
rspOffset
.
version
);
if
(
tqSendDataRsp
(
pTq
,
pMsg
,
pReq
,
&
dataRsp
)
<
0
)
{
code
=
-
1
;
}
...
...
source/libs/executor/src/executorMain.c
浏览文件 @
7cf99d53
...
...
@@ -285,9 +285,7 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, const STqOffsetVal* pOffset) {
SOperatorInfo
*
pOperator
=
pTaskInfo
->
pRoot
;
ASSERT
(
pTaskInfo
->
execModel
==
OPTR_EXEC_MODEL_QUEUE
);
pTaskInfo
->
streamInfo
.
prepareStatus
=
*
pOffset
;
// TODO: optimize
if
(
pTaskInfo
->
streamInfo
.
lastStatus
.
type
!=
pOffset
->
type
||
pTaskInfo
->
streamInfo
.
prepareStatus
.
version
!=
pTaskInfo
->
streamInfo
.
lastStatus
.
version
)
{
if
(
!
tOffsetEqual
(
pOffset
,
&
pTaskInfo
->
streamInfo
.
lastStatus
))
{
while
(
1
)
{
uint8_t
type
=
pOperator
->
operatorType
;
pOperator
->
status
=
OP_OPENED
;
...
...
@@ -310,32 +308,32 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, const STqOffsetVal* pOffset) {
ts
=
INT64_MIN
;
}
}
if
(
pTaskInfo
->
streamInfo
.
lastStatus
.
type
!=
TMQ_OFFSET__SNAPSHOT_DATA
||
pTaskInfo
->
streamInfo
.
lastStatus
.
uid
!=
uid
||
pTaskInfo
->
streamInfo
.
lastStatus
.
ts
!=
ts
)
{
STableScanInfo
*
pTableScanInfo
=
pInfo
->
pTableScanOp
->
info
;
int32_t
tableSz
=
taosArrayGetSize
(
pTaskInfo
->
tableqinfoList
.
pTableList
);
bool
found
=
false
;
for
(
int32_t
i
=
0
;
i
<
tableSz
;
i
++
)
{
STableKeyInfo
*
pTableInfo
=
taosArrayGet
(
pTaskInfo
->
tableqinfoList
.
pTableList
,
i
);
if
(
pTableInfo
->
uid
==
uid
)
{
found
=
true
;
pTableScanInfo
->
currentTable
=
i
;
}
/*if (pTaskInfo->streamInfo.lastStatus.type != TMQ_OFFSET__SNAPSHOT_DATA ||*/
/*pTaskInfo->streamInfo.lastStatus.uid != uid || pTaskInfo->streamInfo.lastStatus.ts != ts) {*/
STableScanInfo
*
pTableScanInfo
=
pInfo
->
pTableScanOp
->
info
;
int32_t
tableSz
=
taosArrayGetSize
(
pTaskInfo
->
tableqinfoList
.
pTableList
);
bool
found
=
false
;
for
(
int32_t
i
=
0
;
i
<
tableSz
;
i
++
)
{
STableKeyInfo
*
pTableInfo
=
taosArrayGet
(
pTaskInfo
->
tableqinfoList
.
pTableList
,
i
);
if
(
pTableInfo
->
uid
==
uid
)
{
found
=
true
;
pTableScanInfo
->
currentTable
=
i
;
}
}
// TODO after dropping table, table may be not found
ASSERT
(
found
);
// TODO after dropping table, table may be not found
ASSERT
(
found
);
tsdbSetTableId
(
pTableScanInfo
->
dataReader
,
uid
);
int64_t
oldSkey
=
pTableScanInfo
->
cond
.
twindows
.
skey
;
pTableScanInfo
->
cond
.
twindows
.
skey
=
ts
+
1
;
tsdbReaderReset
(
pTableScanInfo
->
dataReader
,
&
pTableScanInfo
->
cond
);
pTableScanInfo
->
cond
.
twindows
.
skey
=
oldSkey
;
pTableScanInfo
->
scanTimes
=
0
;
tsdbSetTableId
(
pTableScanInfo
->
dataReader
,
uid
);
int64_t
oldSkey
=
pTableScanInfo
->
cond
.
twindows
.
skey
;
pTableScanInfo
->
cond
.
twindows
.
skey
=
ts
+
1
;
tsdbReaderReset
(
pTableScanInfo
->
dataReader
,
&
pTableScanInfo
->
cond
);
pTableScanInfo
->
cond
.
twindows
.
skey
=
oldSkey
;
pTableScanInfo
->
scanTimes
=
0
;
qDebug
(
"tsdb reader offset seek to uid %ld ts %ld, table cur set to %d , all table num %d"
,
uid
,
ts
,
pTableScanInfo
->
currentTable
,
tableSz
);
}
qDebug
(
"tsdb reader offset seek to uid %ld ts %ld, table cur set to %d , all table num %d"
,
uid
,
ts
,
pTableScanInfo
->
currentTable
,
tableSz
);
/*}*/
}
else
{
ASSERT
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录