Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7a3920bb
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看板
未验证
提交
7a3920bb
编写于
5月 26, 2023
作者:
H
Haojun Liao
提交者:
GitHub
5月 26, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #21492 from taosdata/refact/fillhistory
fix(tmq): set the correct offset rsp when no poll occuring.
上级
4b9613f2
319b2d52
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
6 deletion
+18
-6
source/client/test/clientTests.cpp
source/client/test/clientTests.cpp
+12
-3
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+6
-3
未找到文件。
source/client/test/clientTests.cpp
浏览文件 @
7a3920bb
...
...
@@ -1100,7 +1100,7 @@ TEST(clientCase, sub_tb_test) {
// 创建订阅 topics 列表
tmq_list_t
*
topicList
=
tmq_list_new
();
tmq_list_append
(
topicList
,
"t
opic_t
1"
);
tmq_list_append
(
topicList
,
"t1"
);
// 启动订阅
tmq_subscribe
(
tmq
,
topicList
);
...
...
@@ -1118,7 +1118,7 @@ TEST(clientCase, sub_tb_test) {
tmq_topic_assignment
*
pAssign
=
NULL
;
int32_t
numOfAssign
=
0
;
int32_t
code
=
tmq_get_topic_assignment
(
tmq
,
"t
opic_t
1"
,
&
pAssign
,
&
numOfAssign
);
int32_t
code
=
tmq_get_topic_assignment
(
tmq
,
"t1"
,
&
pAssign
,
&
numOfAssign
);
if
(
code
!=
0
)
{
printf
(
"error occurs:%s
\n
"
,
tmq_err2str
(
code
));
tmq_consumer_close
(
tmq
);
...
...
@@ -1127,7 +1127,16 @@ TEST(clientCase, sub_tb_test) {
return
;
}
tmq_offset_seek
(
tmq
,
"topic_t1"
,
pAssign
[
0
].
vgId
,
0
);
tmq_offset_seek
(
tmq
,
"t1"
,
pAssign
[
0
].
vgId
,
4
);
code
=
tmq_get_topic_assignment
(
tmq
,
"t1"
,
&
pAssign
,
&
numOfAssign
);
if
(
code
!=
0
)
{
printf
(
"error occurs:%s
\n
"
,
tmq_err2str
(
code
));
tmq_consumer_close
(
tmq
);
taos_close
(
pConn
);
fprintf
(
stderr
,
"%d msg consumed, include %d rows
\n
"
,
msgCnt
,
totalRows
);
return
;
}
while
(
1
)
{
TAOS_RES
*
pRes
=
tmq_consumer_poll
(
tmq
,
timeout
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
7a3920bb
...
...
@@ -510,8 +510,6 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
int64_t
sver
=
0
,
ever
=
0
;
walReaderValidVersionRange
(
pHandle
->
execHandle
.
pTqReader
->
pWalReader
,
&
sver
,
&
ever
);
int64_t
currentVer
=
walReaderGetCurrentVer
(
pHandle
->
execHandle
.
pTqReader
->
pWalReader
);
SMqDataRsp
dataRsp
=
{
0
};
tqInitDataRsp
(
&
dataRsp
,
&
req
);
...
...
@@ -537,7 +535,12 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
dataRsp
.
rspOffset
.
type
=
TMQ_OFFSET__LOG
;
if
(
reqOffset
.
type
==
TMQ_OFFSET__LOG
)
{
dataRsp
.
rspOffset
.
version
=
currentVer
;
// return current consume offset value
int64_t
currentVer
=
walReaderGetCurrentVer
(
pHandle
->
execHandle
.
pTqReader
->
pWalReader
);
if
(
currentVer
==
-
1
)
{
// not start to read data from wal yet, return req offset directly
dataRsp
.
rspOffset
.
version
=
reqOffset
.
version
;
}
else
{
dataRsp
.
rspOffset
.
version
=
currentVer
;
// return current consume offset value
}
}
else
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_EARLIEAST
)
{
dataRsp
.
rspOffset
.
version
=
sver
;
// not consume yet, set the earliest position
}
else
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_LATEST
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录