Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5f4cb41e
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看板
提交
5f4cb41e
编写于
3月 29, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): set correct start offset value.
上级
c8ad465a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
14 deletion
+22
-14
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+8
-4
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+2
-2
source/dnode/vnode/src/tq/tqScan.c
source/dnode/vnode/src/tq/tqScan.c
+1
-1
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+11
-7
未找到文件。
source/client/src/clientTmq.c
浏览文件 @
5f4cb41e
...
...
@@ -535,10 +535,14 @@ static int32_t doSendCommitMsg(tmq_t* tmq, SMqClientVg* pVg, const char* pTopicN
atomic_add_fetch_32
(
&
pParamSet
->
totalRspNum
,
1
);
SEp
*
pEp
=
GET_ACTIVE_EP
(
&
pVg
->
epSet
);
tscDebug
(
"consumer:0x%"
PRIx64
" topic:%s on vgId:%d send offset:%"
PRId64
" prev:%"
PRId64
", ep:%s:%d, ordinal:%d/%d, req:0x%"
PRIx64
,
tmq
->
consumerId
,
pOffset
->
subKey
,
pVg
->
vgId
,
pOffset
->
val
.
version
,
pVg
->
committedOffset
.
version
,
pEp
->
fqdn
,
pEp
->
port
,
index
+
1
,
totalVgroups
,
pMsgSendInfo
->
requestId
);
char
offsetBuf
[
80
]
=
{
0
};
tFormatOffset
(
offsetBuf
,
tListLen
(
offsetBuf
),
&
pOffset
->
val
);
char
commitBuf
[
80
]
=
{
0
};
tFormatOffset
(
commitBuf
,
tListLen
(
commitBuf
),
&
pVg
->
committedOffset
);
tscDebug
(
"consumer:0x%"
PRIx64
" topic:%s on vgId:%d send offset:%s prev:%s, ep:%s:%d, ordinal:%d/%d, req:0x%"
PRIx64
,
tmq
->
consumerId
,
pOffset
->
subKey
,
pVg
->
vgId
,
offsetBuf
,
commitBuf
,
pEp
->
fqdn
,
pEp
->
port
,
index
+
1
,
totalVgroups
,
pMsgSendInfo
->
requestId
);
int64_t
transporterId
=
0
;
asyncSendMsgToServer
(
tmq
->
pTscObj
->
pAppInfo
->
pTransporter
,
&
pVg
->
epSet
,
&
transporterId
,
pMsgSendInfo
);
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
5f4cb41e
...
...
@@ -399,8 +399,8 @@ 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, existed offset found, offset reset to %s and continue.
"
,
consumerId
,
pHandle
->
subKey
,
vgId
,
formatBuf
);
tqDebug
(
"tmq poll: consumer:0x%"
PRIx64
", subkey %s, vgId:%d, existed offset found, offset reset to %s and continue.
reqId:0x%"
PRIx64
,
consumerId
,
pHandle
->
subKey
,
vgId
,
formatBuf
,
pRequest
->
reqId
);
return
0
;
}
else
{
// no poll occurs in this vnode for this topic, let's seek to the right offset value.
...
...
source/dnode/vnode/src/tq/tqScan.c
浏览文件 @
5f4cb41e
...
...
@@ -92,7 +92,7 @@ int32_t tqScanData(STQ* pTq, const STqHandle* pHandle, SMqDataRsp* pRsp, STqOffs
SSDataBlock
*
pDataBlock
=
NULL
;
uint64_t
ts
=
0
;
tqDebug
(
"vgId:%d, tmq task start to execute, consumer:0x%"
PRIx64
,
vgId
,
pHandle
->
consumerId
);
tqDebug
(
"vgId:%d, tmq task start to execute, consumer:0x%"
PRIx64
,
vgId
,
pHandle
->
consumerId
);
code
=
qExecTask
(
task
,
&
pDataBlock
,
&
ts
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
source/libs/executor/src/executor.c
浏览文件 @
5f4cb41e
...
...
@@ -1156,6 +1156,11 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
}
STableKeyInfo
keyInfo
=
{.
uid
=
uid
};
int64_t
oldSkey
=
pScanBaseInfo
->
cond
.
twindows
.
skey
;
// let's start from the next ts that returned to consumer.
pScanBaseInfo
->
cond
.
twindows
.
skey
=
ts
+
1
;
if
(
pScanBaseInfo
->
dataReader
==
NULL
)
{
int32_t
code
=
tsdbReaderOpen
(
pScanBaseInfo
->
readHandle
.
vnode
,
&
pScanBaseInfo
->
cond
,
&
keyInfo
,
1
,
pScanInfo
->
pResBlock
,
&
pScanBaseInfo
->
dataReader
,
NULL
);
...
...
@@ -1164,21 +1169,20 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
terrno
=
code
;
return
-
1
;
}
qDebug
(
"tsdb reader created with offset(snapshot) uid:%"
PRId64
" ts %"
PRId64
" table index:%d, total:%d, %s"
,
uid
,
ts
,
pScanInfo
->
currentTable
,
numOfTables
,
id
);
}
else
{
tsdbSetTableList
(
pScanBaseInfo
->
dataReader
,
&
keyInfo
,
1
);
int64_t
oldSkey
=
pScanBaseInfo
->
cond
.
twindows
.
skey
;
// let's start from the next ts that returned to consumer.
pScanBaseInfo
->
cond
.
twindows
.
skey
=
ts
+
1
;
tsdbReaderReset
(
pScanBaseInfo
->
dataReader
,
&
pScanBaseInfo
->
cond
);
// restore the key value
pScanBaseInfo
->
cond
.
twindows
.
skey
=
oldSkey
;
pScanInfo
->
scanTimes
=
0
;
qDebug
(
"tsdb reader offset seek snapshot to uid:%"
PRId64
" ts %"
PRId64
" table index:%d numOfTable:%d, %s"
,
uid
,
ts
,
pScanInfo
->
currentTable
,
numOfTables
,
id
);
}
// restore the key value
pScanBaseInfo
->
cond
.
twindows
.
skey
=
oldSkey
;
}
else
{
qError
(
"invalid pOffset->type:%d, %s"
,
pOffset
->
type
,
id
);
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录