Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a4d9210b
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a4d9210b
编写于
5月 17, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): add filter for taosX poll rsp.
上级
041ffa91
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
32 deletion
+9
-32
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+7
-2
source/dnode/vnode/src/inc/tq.h
source/dnode/vnode/src/inc/tq.h
+0
-7
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-23
未找到文件。
source/client/src/clientTmq.c
浏览文件 @
a4d9210b
...
...
@@ -1430,6 +1430,9 @@ static void initClientTopicFromRsp(SMqClientTopic* pTopic, SMqSubTopicEp* pTopic
clientVg
.
offsetInfo
.
committedOffset
=
offsetNew
;
clientVg
.
offsetInfo
.
walVerBegin
=
-
1
;
clientVg
.
offsetInfo
.
walVerEnd
=
-
1
;
clientVg
.
seekUpdated
=
false
;
clientVg
.
receivedInfoFromVnode
=
false
;
taosArrayPush
(
pTopic
->
vgs
,
&
clientVg
);
}
}
...
...
@@ -1858,9 +1861,10 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
if
(
pollRspWrapper
->
metaRsp
.
head
.
epoch
==
consumerEpoch
)
{
SMqClientVg
*
pVg
=
pollRspWrapper
->
vgHandle
;
if
(
pollRspWrapper
->
metaRsp
.
rspOffset
.
type
!=
0
){
// if offset is validate
if
(
!
pVg
->
seekUpdated
)
{
pVg
->
offsetInfo
.
currentOffset
=
pollRspWrapper
->
metaRsp
.
rspOffset
;
}
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
// build rsp
SMqMetaRspObj
*
pRsp
=
tmqBuildMetaRspFromWrapper
(
pollRspWrapper
);
...
...
@@ -1878,9 +1882,10 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
if
(
pollRspWrapper
->
taosxRsp
.
head
.
epoch
==
consumerEpoch
)
{
SMqClientVg
*
pVg
=
pollRspWrapper
->
vgHandle
;
if
(
pollRspWrapper
->
taosxRsp
.
rspOffset
.
type
!=
0
){
// if offset is validate
if
(
!
pVg
->
seekUpdated
)
{
// if offset is validate
pVg
->
offsetInfo
.
currentOffset
=
pollRspWrapper
->
taosxRsp
.
rspOffset
;
}
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
if
(
pollRspWrapper
->
taosxRsp
.
blockNum
==
0
)
{
...
...
source/dnode/vnode/src/inc/tq.h
浏览文件 @
a4d9210b
...
...
@@ -110,12 +110,6 @@ typedef struct {
tq_handle_status
status
;
}
STqHandle
;
//typedef struct {
// SMqDataRsp* pDataRsp;
// char subKey[TSDB_SUBSCRIBE_KEY_LEN];
// SRpcHandleInfo info;
//} STqPushEntry;
struct
STQ
{
SVnode
*
pVnode
;
char
*
path
;
...
...
@@ -195,7 +189,6 @@ int32_t tqExtractDataForMq(STQ* pTq, STqHandle* pHandle, const SMqPollReq* pRequ
int32_t
tqDoSendDataRsp
(
const
SRpcHandleInfo
*
pRpcHandleInfo
,
const
SMqDataRsp
*
pRsp
,
int32_t
epoch
,
int64_t
consumerId
,
int32_t
type
,
int64_t
sver
,
int64_t
ever
);
int32_t
tqInitDataRsp
(
SMqDataRsp
*
pRsp
,
const
SMqPollReq
*
pReq
);
bool
tqIsHandleExecuting
(
STqHandle
*
pHandle
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
a4d9210b
...
...
@@ -307,13 +307,6 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t sversion, char* msg, int32_t
return
-
1
;
}
if
(
pOffset
->
val
.
type
==
TMQ_OFFSET__LOG
)
{
STqHandle
*
pHandle
=
taosHashGet
(
pTq
->
pHandle
,
pOffset
->
subKey
,
strlen
(
pOffset
->
subKey
));
if
(
pHandle
&&
(
walRefVer
(
pHandle
->
pRef
,
pOffset
->
val
.
version
)
<
0
))
{
return
-
1
;
}
}
return
0
;
}
...
...
@@ -381,16 +374,6 @@ int32_t tqProcessSeekReq(STQ* pTq, int64_t sversion, char* msg, int32_t msgLen)
pOffset
->
val
.
version
=
ever
;
}
ASSERT
(
0
);
if
(
offset
.
val
.
type
==
TMQ_OFFSET__LOG
)
{
taosWLockLatch
(
&
pTq
->
lock
);
STqHandle
*
pHandle
=
taosHashGet
(
pTq
->
pHandle
,
offset
.
subKey
,
strlen
(
offset
.
subKey
));
if
(
pHandle
&&
(
walSetRefVer
(
pHandle
->
pRef
,
offset
.
val
.
version
)
<
0
))
{
taosWUnLockLatch
(
&
pTq
->
lock
);
return
-
1
;
}
taosWUnLockLatch
(
&
pTq
->
lock
);
// save the new offset value
if
(
pSavedOffset
!=
NULL
)
{
tqDebug
(
"vgId:%d sub:%s seek to:%"
PRId64
" prev offset:%"
PRId64
,
vgId
,
pOffset
->
subKey
,
pOffset
->
val
.
version
,
...
...
@@ -404,7 +387,6 @@ int32_t tqProcessSeekReq(STQ* pTq, int64_t sversion, char* msg, int32_t msgLen)
return
-
1
;
}
walReaderSeekVer
(
pHandle
->
execHandle
.
pTqReader
->
pWalReader
,
vgOffset
.
offset
.
val
.
version
);
tqDebug
(
"topic:%s, vgId:%d consumer:0x%"
PRIx64
" offset is update to:%"
PRId64
,
vgOffset
.
offset
.
subKey
,
vgId
,
vgOffset
.
consumerId
,
vgOffset
.
offset
.
val
.
version
);
...
...
@@ -575,6 +557,7 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
int32_t
tqProcessDeleteSubReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
)
{
SMqVDeleteReq
*
pReq
=
(
SMqVDeleteReq
*
)
msg
;
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
tqDebug
(
"vgId:%d, tq process delete sub req %s"
,
vgId
,
pReq
->
subKey
);
int32_t
code
=
0
;
...
...
@@ -586,15 +569,11 @@ int32_t tqProcessDeleteSubReq(STQ* pTq, int64_t sversion, char* msg, int32_t msg
tqDebug
(
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
vgId
,
pHandle
->
subKey
);
taosMsleep
(
5
);
}
if
(
pHandle
->
pRef
)
{
walCloseRef
(
pTq
->
pVnode
->
pWal
,
pHandle
->
pRef
->
refId
);
}
while
(
tqIsHandleExecuting
(
pHandle
))
{
tqDebug
(
"vgId:%d, topic:%s, subscription is executing, wait for 5ms and retry"
,
vgId
,
pHandle
->
subKey
);
taosMsleep
(
5
);
}
code
=
taosHashRemove
(
pTq
->
pHandle
,
pReq
->
subKey
,
strlen
(
pReq
->
subKey
));
if
(
code
!=
0
)
{
tqError
(
"cannot process tq delete req %s, since no such handle"
,
pReq
->
subKey
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录