Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4cb1c51d
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4cb1c51d
编写于
3月 20, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): update some logs.
上级
a5e9fad0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
11 deletion
+15
-11
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+13
-9
source/dnode/vnode/src/tq/tqExec.c
source/dnode/vnode/src/tq/tqExec.c
+2
-2
未找到文件。
source/dnode/vnode/src/tq/tq.c
浏览文件 @
4cb1c51d
...
...
@@ -425,6 +425,7 @@ static FORCE_INLINE bool tqOffsetLessOrEqual(const STqOffset* pLeft, const STqOf
int32_t
tqProcessOffsetCommitReq
(
STQ
*
pTq
,
int64_t
sversion
,
char
*
msg
,
int32_t
msgLen
)
{
STqOffset
offset
=
{
0
};
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
SDecoder
decoder
;
tDecoderInit
(
&
decoder
,
(
uint8_t
*
)
msg
,
msgLen
);
...
...
@@ -436,10 +437,10 @@ int32_t tqProcessOffsetCommitReq(STQ* pTq, int64_t sversion, char* msg, int32_t
if
(
offset
.
val
.
type
==
TMQ_OFFSET__SNAPSHOT_DATA
||
offset
.
val
.
type
==
TMQ_OFFSET__SNAPSHOT_META
)
{
tqDebug
(
"receive offset commit msg to %s on vgId:%d, offset(type:snapshot) uid:%"
PRId64
", ts:%"
PRId64
,
offset
.
subKey
,
TD_VID
(
pTq
->
pVnode
)
,
offset
.
val
.
uid
,
offset
.
val
.
ts
);
offset
.
subKey
,
vgId
,
offset
.
val
.
uid
,
offset
.
val
.
ts
);
}
else
if
(
offset
.
val
.
type
==
TMQ_OFFSET__LOG
)
{
tqDebug
(
"receive offset commit msg to %s on vgId:%d, offset(type:log) version:%"
PRId64
,
offset
.
subKey
,
TD_VID
(
pTq
->
pVnode
)
,
offset
.
val
.
version
);
vgId
,
offset
.
val
.
version
);
if
(
offset
.
val
.
version
+
1
==
sversion
)
{
offset
.
val
.
version
+=
1
;
}
...
...
@@ -542,6 +543,8 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
uint64_t
consumerId
=
pRequest
->
consumerId
;
STqOffsetVal
reqOffset
=
pRequest
->
reqOffset
;
STqOffset
*
pOffset
=
tqOffsetRead
(
pTq
->
pOffsetStore
,
pRequest
->
subKey
);
int32_t
vgId
=
TD_VID
(
pTq
->
pVnode
);
*
pBlockReturned
=
false
;
// In this vnode, data has been polled by consumer for this topic, so let's continue from the last offset value.
...
...
@@ -551,12 +554,15 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
char
formatBuf
[
80
];
tFormatOffset
(
formatBuf
,
80
,
pOffsetVal
);
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
", subkey %s, vgId:%d, prev offset found, offset reset to %s and continue."
,
consumerId
,
pHandle
->
subKey
,
TD_VID
(
pTq
->
pVnode
)
,
formatBuf
);
consumerId
,
pHandle
->
subKey
,
vgId
,
formatBuf
);
return
0
;
}
else
{
// no poll occurs in this vnode for this topic, let's seek to the right offset value.
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_EARLIEAST
)
{
if
(
pRequest
->
useSnapshot
)
{
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
", subkey:%s, vgId:%d, (earliest) set offset to be snapshot"
,
consumerId
,
pHandle
->
subKey
,
vgId
);
if
(
pHandle
->
fetchMeta
)
{
tqOffsetResetToMeta
(
pOffsetVal
,
0
);
}
else
{
...
...
@@ -577,8 +583,8 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
tqInitDataRsp
(
&
dataRsp
,
pRequest
,
pHandle
->
execHandle
.
subType
);
tqOffsetResetToLog
(
&
dataRsp
.
rspOffset
,
walGetLastVer
(
pTq
->
pVnode
->
pWal
));
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
", subkey %s, vgId:%d, offset reset to %"
PRId64
,
consumerId
,
pHandle
->
subKey
,
TD_VID
(
pTq
->
pVnode
)
,
dataRsp
.
rspOffset
.
version
);
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
", subkey %s, vgId:%d,
(latest)
offset reset to %"
PRId64
,
consumerId
,
pHandle
->
subKey
,
vgId
,
dataRsp
.
rspOffset
.
version
);
int32_t
code
=
tqSendDataRsp
(
pTq
,
pMsg
,
pRequest
,
&
dataRsp
,
TMQ_MSG_TYPE__POLL_RSP
);
tDeleteSMqDataRsp
(
&
dataRsp
);
...
...
@@ -589,16 +595,14 @@ static int32_t extractResetOffsetVal(STqOffsetVal* pOffsetVal, STQ* pTq, STqHand
tqInitTaosxRsp
(
&
taosxRsp
,
pRequest
);
tqOffsetResetToLog
(
&
taosxRsp
.
rspOffset
,
walGetLastVer
(
pTq
->
pVnode
->
pWal
));
int32_t
code
=
tqSendDataRsp
(
pTq
,
pMsg
,
pRequest
,
(
SMqDataRsp
*
)
&
taosxRsp
,
TMQ_MSG_TYPE__TAOSX_RSP
);
// int32_t code = tqSendTaosxRsp(pTq, pMsg, pRequest, &taosxRsp);
tDeleteSTaosxRsp
(
&
taosxRsp
);
*
pBlockReturned
=
true
;
return
code
;
}
}
else
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_NONE
)
{
tqError
(
"tmq poll: subkey %s, no offset committed for consumer:0x%"
PRIx64
" in vg %d, subkey %s, reset none failed"
,
pHandle
->
subKey
,
consumerId
,
TD_VID
(
pTq
->
pVnode
),
pRequest
->
subKey
);
tqError
(
"tmq poll: subkey:%s, no offset committed for consumer:0x%"
PRIx64
" in vg %d, subkey %s, reset none failed"
,
pHandle
->
subKey
,
consumerId
,
vgId
,
pRequest
->
subKey
);
terrno
=
TSDB_CODE_TQ_NO_COMMITTED_OFFSET
;
return
-
1
;
}
...
...
source/dnode/vnode/src/tq/tqExec.c
浏览文件 @
4cb1c51d
...
...
@@ -92,7 +92,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
return
-
1
;
}
tqDebug
(
"
vgId:%d, tmq task executed, get %p"
,
pTq
->
pVnode
->
config
.
vgId
,
pDataBlock
);
tqDebug
(
"
consumer:0x%"
PRIx64
" vgId:%d, tmq task executed, get %p"
,
pHandle
->
consumerId
,
pTq
->
pVnode
->
config
.
vgId
,
pDataBlock
);
// current scan should be stopped asap, since the rebalance occurs.
if
(
pDataBlock
==
NULL
)
{
...
...
@@ -120,7 +120,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
return
-
1
;
}
if
(
pRsp
->
withTbName
||
pRsp
->
withSchema
)
{
if
(
pRsp
->
withTbName
||
pRsp
->
withSchema
)
{
tqError
(
"get column should not with meta:%d,%d"
,
pRsp
->
withTbName
,
pRsp
->
withSchema
);
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录