Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4f107908
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看板
提交
4f107908
编写于
6月 30, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): reset window
上级
94f07836
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
34 deletion
+23
-34
source/client/src/tmq.c
source/client/src/tmq.c
+2
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+2
-2
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+9
-14
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-6
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+0
-2
tests/script/tsim/tmq/snapshot.sim
tests/script/tsim/tmq/snapshot.sim
+3
-6
tests/script/tsim/tmq/snapshot1.sim
tests/script/tsim/tmq/snapshot1.sim
+3
-3
未找到文件。
source/client/src/tmq.c
浏览文件 @
4f107908
...
...
@@ -1547,7 +1547,7 @@ SMqRspObj* tmqBuildRspFromWrapper(SMqPollRspWrapper* pWrapper) {
}
int32_t
tmqPollImpl
(
tmq_t
*
tmq
,
int64_t
timeout
)
{
/*
printf("call poll\n
");*/
/*
tscDebug("call poll
");*/
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
tmq
->
clientTopics
);
i
++
)
{
SMqClientTopic
*
pTopic
=
taosArrayGet
(
tmq
->
clientTopics
,
i
);
for
(
int
j
=
0
;
j
<
taosArrayGetSize
(
pTopic
->
vgs
);
j
++
)
{
...
...
@@ -1708,6 +1708,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
}
TAOS_RES
*
tmq_consumer_poll
(
tmq_t
*
tmq
,
int64_t
timeout
)
{
/*tscDebug("call poll1");*/
void
*
rspObj
;
int64_t
startTime
=
taosGetTimestampMs
();
...
...
source/common/src/tmsg.c
浏览文件 @
4f107908
...
...
@@ -5398,9 +5398,9 @@ int32_t tFormatOffset(char *buf, int32_t maxLen, const STqOffsetVal *pVal) {
}
else
if
(
pVal
->
type
==
TMQ_OFFSET__LOG
)
{
snprintf
(
buf
,
maxLen
,
"offset(log) ver:%ld"
,
pVal
->
version
);
}
else
if
(
pVal
->
type
==
TMQ_OFFSET__SNAPSHOT_DATA
)
{
snprintf
(
buf
,
maxLen
,
"offset(s
napshot
data) uid:%ld, ts:%ld"
,
pVal
->
uid
,
pVal
->
ts
);
snprintf
(
buf
,
maxLen
,
"offset(s
s
data) uid:%ld, ts:%ld"
,
pVal
->
uid
,
pVal
->
ts
);
}
else
if
(
pVal
->
type
==
TMQ_OFFSET__SNAPSHOT_META
)
{
snprintf
(
buf
,
maxLen
,
"offset(s
napshot
meta) uid:%ld, ts:%ld"
,
pVal
->
uid
,
pVal
->
ts
);
snprintf
(
buf
,
maxLen
,
"offset(s
s
meta) uid:%ld, ts:%ld"
,
pVal
->
uid
,
pVal
->
ts
);
}
else
{
ASSERT
(
0
);
}
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
4f107908
...
...
@@ -154,10 +154,10 @@ int32_t tqSendDataRsp(STQ* pTq, const SRpcMsg* pMsg, const SMqPollReq* pReq, con
};
tmsgSendRsp
(
&
rsp
);
char
buf1
[
5
0
];
char
buf2
[
5
0
];
tFormatOffset
(
buf1
,
5
0
,
&
pRsp
->
reqOffset
);
tFormatOffset
(
buf2
,
5
0
,
&
pRsp
->
rspOffset
);
char
buf1
[
8
0
];
char
buf2
[
8
0
];
tFormatOffset
(
buf1
,
8
0
,
&
pRsp
->
reqOffset
);
tFormatOffset
(
buf2
,
8
0
,
&
pRsp
->
rspOffset
);
tqDebug
(
"vg %d from consumer %ld (epoch %d) send rsp, block num: %d, reqOffset: %s, rspOffset: %s"
,
TD_VID
(
pTq
->
pVnode
),
pReq
->
consumerId
,
pReq
->
epoch
,
pRsp
->
blockNum
,
buf1
,
buf2
);
...
...
@@ -238,8 +238,8 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
STqOffsetVal
fetchOffsetNew
;
// 1.find handle
char
buf
[
5
0
];
tFormatOffset
(
buf
,
5
0
,
&
reqOffset
);
char
buf
[
8
0
];
tFormatOffset
(
buf
,
8
0
,
&
reqOffset
);
tqDebug
(
"tmq poll: consumer %ld (epoch %d) recv poll req in vg %d, req offset %s"
,
consumerId
,
pReq
->
epoch
,
TD_VID
(
pTq
->
pVnode
),
buf
);
...
...
@@ -360,7 +360,6 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
tqInfo
(
"fetch meta msg, ver: %ld, type: %d"
,
pHead
->
version
,
pHead
->
msgType
);
SMqMetaRsp
metaRsp
=
{
0
};
metaRsp
.
reqOffset
=
pReq
->
reqOffset
.
version
;
/*tqOffsetResetToLog(&metaR)*/
metaRsp
.
rspOffset
=
fetchVer
;
metaRsp
.
resMsgType
=
pHead
->
msgType
;
metaRsp
.
metaRspLen
=
pHead
->
bodyLen
;
...
...
@@ -380,18 +379,14 @@ int32_t tqProcessPollReq(STQ* pTq, SRpcMsg* pMsg, int32_t workerId) {
// 2. get data (rebuild reader if needed)
// 3. get new uid and ts
char
formatBuf
[
50
];
tFormatOffset
(
formatBuf
,
50
,
&
dataRsp
.
reqOffset
);
tqInfo
(
"retrieve using snapshot req offset %s"
,
formatBuf
);
tqInfo
(
"retrieve using snapshot req offset: uid %ld ts %ld"
,
dataRsp
.
reqOffset
.
uid
,
dataRsp
.
reqOffset
.
ts
);
if
(
tqScanSnapshot
(
pTq
,
&
pHandle
->
execHandle
,
&
dataRsp
,
fetchOffsetNew
,
workerId
)
<
0
)
{
ASSERT
(
0
);
}
// 4. send rsp
if
(
dataRsp
.
blockNum
!=
0
)
{
if
(
tqSendDataRsp
(
pTq
,
pMsg
,
pReq
,
&
dataRsp
)
<
0
)
{
code
=
-
1
;
}
if
(
tqSendDataRsp
(
pTq
,
pMsg
,
pReq
,
&
dataRsp
)
<
0
)
{
code
=
-
1
;
}
}
else
if
(
fetchOffsetNew
.
type
==
TMQ_OFFSET__SNAPSHOT_META
)
{
ASSERT
(
0
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
4f107908
...
...
@@ -2836,12 +2836,10 @@ int32_t doPrepareScan(SOperatorInfo* pOperator, uint64_t uid, int64_t ts) {
if
(
pInfo
->
lastStatus
.
uid
!=
uid
||
pInfo
->
lastStatus
.
ts
!=
ts
)
{
tsdbSetTableId
(
pInfo
->
dataReader
,
uid
);
SQueryTableDataCond
tmpCond
=
pInfo
->
cond
;
tmpCond
.
twindows
[
0
]
=
(
STimeWindow
){
.
skey
=
ts
,
.
ekey
=
INT64_MAX
,
};
tsdbResetReadHandle
(
pInfo
->
dataReader
,
&
tmpCond
,
0
);
int64_t
oldSkey
=
pInfo
->
cond
.
twindows
[
0
].
skey
;
pInfo
->
cond
.
twindows
[
0
].
skey
=
ts
;
tsdbResetReadHandle
(
pInfo
->
dataReader
,
&
pInfo
->
cond
,
0
);
pInfo
->
cond
.
twindows
[
0
].
skey
=
oldSkey
;
pInfo
->
scanTimes
=
0
;
pInfo
->
curTWinIdx
=
0
;
}
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
4f107908
...
...
@@ -518,7 +518,6 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
// if scan table by table
if
(
pInfo
->
scanMode
==
TABLE_SCAN__TABLE_ORDER
)
{
// check status
while
(
1
)
{
SSDataBlock
*
result
=
doTableScanGroup
(
pOperator
);
if
(
result
)
{
...
...
@@ -530,7 +529,6 @@ static SSDataBlock* doTableScan(SOperatorInfo* pOperator) {
return
NULL
;
}
STableKeyInfo
*
pTableInfo
=
taosArrayGet
(
pTaskInfo
->
tableqinfoList
.
pTableList
,
pInfo
->
currentTable
);
/*pTableInfo->uid */
tsdbSetTableId
(
pInfo
->
dataReader
,
pTableInfo
->
uid
);
tsdbResetReadHandle
(
pInfo
->
dataReader
,
&
pInfo
->
cond
,
0
);
pInfo
->
scanTimes
=
0
;
...
...
tests/script/tsim/tmq/snapshot.sim
浏览文件 @
4f107908
...
...
@@ -111,7 +111,7 @@ endi
$consumerId = 0
$totalMsgOfStb = $ctbNum * $rowsPerCtb
$expectmsgcnt = 1
$expectmsgcnt = 1
000000
$expectrowcnt = 100
sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit )
...
...
@@ -131,9 +131,6 @@ endi
if $data[0][1] != $consumerId then
return -1
endi
if $data[0][2] != $expectmsgcnt then
return -1
endi
if $data[0][3] != $expectrowcnt then
return -1
endi
...
...
@@ -183,7 +180,7 @@ endi
$consumerId = 0
$totalMsgOfCtb = $rowsPerCtb
$expectmsgcnt = 1
$expectmsgcnt = 1
000000
sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit )
print == start consumer to pull msgs from ctb
...
...
@@ -254,7 +251,7 @@ endi
$consumerId = 0
$totalMsgOfNtb = $rowsPerCtb
$expectmsgcnt =
$totalMsgOfNtb
$expectmsgcnt =
1000000
sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit )
print == start consumer to pull msgs from ntb
...
...
tests/script/tsim/tmq/snapshot1.sim
浏览文件 @
4f107908
...
...
@@ -80,7 +80,7 @@ $topicList = $topicList . '
$consumerId = 0
$totalMsgOfOneTopic = $ctbNum * $rowsPerCtb
$totalMsgOfStb = $totalMsgOfOneTopic * $topicNum
$expectmsgcnt =
$totalMsgOfStb
$expectmsgcnt =
1000000
sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit )
...
...
@@ -168,7 +168,7 @@ $consumerId = 0
$totalMsgOfOneTopic = $rowsPerCtb
$totalMsgOfCtb = $totalMsgOfOneTopic * $topicNum
$expectmsgcnt =
$totalMsgOfCtb
$expectmsgcnt =
1000000
sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit )
$topicList = ' . topic_ctb_function
...
...
@@ -245,7 +245,7 @@ $topicList = $topicList . '
$consumerId = 0
$totalMsgOfOneTopic = $rowsPerCtb
$totalMsgOfNtb = $totalMsgOfOneTopic * $topicNum
$expectmsgcnt =
$totalMsgOfNtb
$expectmsgcnt =
1000000
sql insert into consumeinfo values (now , $consumerId , $topicList , $keyList , $expectmsgcnt , $ifcheckdata , $ifmanualcommit )
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录