Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7a48d05f
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
7a48d05f
编写于
7月 07, 2023
作者:
J
jiajingbin
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'main' of
https://github.com/taosdata/TDengine
into main
上级
32a33161
b7bf4925
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
58 addition
and
81 deletion
+58
-81
docs/en/12-taos-sql/22-meta.md
docs/en/12-taos-sql/22-meta.md
+2
-0
docs/zh/12-taos-sql/22-meta.md
docs/zh/12-taos-sql/22-meta.md
+2
-0
packaging/checkPackageRuning.py
packaging/checkPackageRuning.py
+2
-2
packaging/testpackage.sh
packaging/testpackage.sh
+1
-1
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+29
-40
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+1
-1
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+21
-37
未找到文件。
docs/en/12-taos-sql/22-meta.md
浏览文件 @
7a48d05f
...
...
@@ -283,6 +283,8 @@ Provides dnode configuration information.
| 2 | consumer_group | BINARY(193) | Subscribed consumer group |
| 3 | vgroup_id | INT | Vgroup ID for the consumer |
| 4 | consumer_id | BIGINT | Consumer ID |
| 5 | offset | BINARY(64) | Consumption progress |
| 6 | rows | BIGINT | Number of consumption items |
## INS_STREAMS
...
...
docs/zh/12-taos-sql/22-meta.md
浏览文件 @
7a48d05f
...
...
@@ -284,6 +284,8 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数
| 2 | consumer_group | BINARY(193) | 订阅者的消费者组 |
| 3 | vgroup_id | INT | 消费者被分配的 vgroup id |
| 4 | consumer_id | BIGINT | 消费者的唯一 id |
| 5 | offset | BINARY(64) | 消费者的消费进度 |
| 6 | rows | BIGINT | 消费者的消费的数据条数 |
## INS_STREAMS
...
...
packaging/checkPackageRuning.py
浏览文件 @
7a48d05f
...
...
@@ -87,7 +87,7 @@ os.system("rm -rf /tmp/dumpdata/*")
# dump data out
print
(
"taosdump dump out data"
)
os
.
system
(
"taosdump -o /tmp/dumpdata -D test -
y -
h %s "
%
serverHost
)
os
.
system
(
"taosdump -o /tmp/dumpdata -D test -h %s "
%
serverHost
)
# drop database of test
print
(
"drop database test"
)
...
...
@@ -95,7 +95,7 @@ os.system(" taos -s ' drop database test ;' -h %s "%serverHost)
# dump data in
print
(
"taosdump dump data in"
)
os
.
system
(
"taosdump -i /tmp/dumpdata
-y
-h %s "
%
serverHost
)
os
.
system
(
"taosdump -i /tmp/dumpdata -h %s "
%
serverHost
)
result
=
conn
.
query
(
"SELECT count(*) from test.meters"
)
...
...
packaging/testpackage.sh
浏览文件 @
7a48d05f
...
...
@@ -152,7 +152,7 @@ function wgetFile {
file
=
$1
versionPath
=
$2
sourceP
=
$3
nasServerIP
=
"192.168.1.
131
"
nasServerIP
=
"192.168.1.
213
"
packagePath
=
"/nas/TDengine/v
${
versionPath
}
/
${
verMode
}
"
if
[
-f
${
file
}
]
;
then
echoColor YD
"
${
file
}
already exists ,it will delete it and download it again "
...
...
source/client/src/clientTmq.c
浏览文件 @
7a48d05f
...
...
@@ -1877,6 +1877,23 @@ static int32_t tmqHandleNoPollRsp(tmq_t* tmq, SMqRspWrapper* rspWrapper, bool* p
return
0
;
}
static
void
updateVgInfo
(
SMqClientVg
*
pVg
,
STqOffsetVal
*
offset
,
int64_t
sver
,
int64_t
ever
,
int64_t
consumerId
){
if
(
!
pVg
->
seekUpdated
)
{
tscDebug
(
"consumer:0x%"
PRIx64
" local offset is update, since seekupdate not set"
,
consumerId
);
pVg
->
offsetInfo
.
currentOffset
=
*
offset
;
}
else
{
tscDebug
(
"consumer:0x%"
PRIx64
" local offset is NOT update, since seekupdate is set"
,
consumerId
);
}
// update the status
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
// update the valid wal version range
pVg
->
offsetInfo
.
walVerBegin
=
sver
;
pVg
->
offsetInfo
.
walVerEnd
=
ever
;
pVg
->
receivedInfoFromVnode
=
true
;
}
static
void
*
tmqHandleAllRsp
(
tmq_t
*
tmq
,
int64_t
timeout
,
bool
pollIfReset
)
{
tscDebug
(
"consumer:0x%"
PRIx64
" start to handle the rsp, total:%d"
,
tmq
->
consumerId
,
tmq
->
qall
->
numOfItems
);
...
...
@@ -1925,22 +1942,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
pVg
->
epSet
=
*
pollRspWrapper
->
pEpset
;
}
// update the local offset value only for the returned values, only when the local offset is NOT updated
// by tmq_offset_seek function
if
(
!
pVg
->
seekUpdated
)
{
tscDebug
(
"consumer:0x%"
PRIx64
" local offset is update, since seekupdate not set"
,
tmq
->
consumerId
);
pVg
->
offsetInfo
.
currentOffset
=
pDataRsp
->
rspOffset
;
}
else
{
tscDebug
(
"consumer:0x%"
PRIx64
" local offset is NOT update, since seekupdate is set"
,
tmq
->
consumerId
);
}
// update the status
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
// update the valid wal version range
pVg
->
offsetInfo
.
walVerBegin
=
pDataRsp
->
head
.
walsver
;
pVg
->
offsetInfo
.
walVerEnd
=
pDataRsp
->
head
.
walever
;
pVg
->
receivedInfoFromVnode
=
true
;
updateVgInfo
(
pVg
,
&
pDataRsp
->
rspOffset
,
pDataRsp
->
head
.
walsver
,
pDataRsp
->
head
.
walever
,
tmq
->
consumerId
);
char
buf
[
TSDB_OFFSET_LEN
];
tFormatOffset
(
buf
,
TSDB_OFFSET_LEN
,
&
pDataRsp
->
rspOffset
);
...
...
@@ -1990,11 +1992,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
return
NULL
;
}
if
(
pollRspWrapper
->
metaRsp
.
rspOffset
.
type
!=
0
){
// if offset is validate
pVg
->
offsetInfo
.
currentOffset
=
pollRspWrapper
->
metaRsp
.
rspOffset
;
}
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
updateVgInfo
(
pVg
,
&
pollRspWrapper
->
metaRsp
.
rspOffset
,
pollRspWrapper
->
metaRsp
.
head
.
walsver
,
pollRspWrapper
->
metaRsp
.
head
.
walever
,
tmq
->
consumerId
);
// build rsp
SMqMetaRspObj
*
pRsp
=
tmqBuildMetaRspFromWrapper
(
pollRspWrapper
);
taosFreeQitem
(
pollRspWrapper
);
...
...
@@ -2022,18 +2020,7 @@ static void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
return
NULL
;
}
// update the local offset value only for the returned values, only when the local offset is NOT updated
// by tmq_offset_seek function
if
(
!
pVg
->
seekUpdated
)
{
if
(
pollRspWrapper
->
taosxRsp
.
rspOffset
.
type
!=
0
)
{
// if offset is validate
tscDebug
(
"consumer:0x%"
PRIx64
" local offset is update, since seekupdate not set"
,
tmq
->
consumerId
);
pVg
->
offsetInfo
.
currentOffset
=
pollRspWrapper
->
taosxRsp
.
rspOffset
;
}
}
else
{
tscDebug
(
"consumer:0x%"
PRIx64
" local offset is NOT update, since seekupdate is set"
,
tmq
->
consumerId
);
}
atomic_store_32
(
&
pVg
->
vgStatus
,
TMQ_VG_STATUS__IDLE
);
updateVgInfo
(
pVg
,
&
pollRspWrapper
->
taosxRsp
.
rspOffset
,
pollRspWrapper
->
taosxRsp
.
head
.
walsver
,
pollRspWrapper
->
taosxRsp
.
head
.
walever
,
tmq
->
consumerId
);
if
(
pollRspWrapper
->
taosxRsp
.
blockNum
==
0
)
{
tscDebug
(
"consumer:0x%"
PRIx64
" taosx empty block received, vgId:%d, vg total:%"
PRId64
", reqId:0x%"
PRIx64
,
...
...
@@ -2615,6 +2602,8 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
pAssignment
->
begin
=
pClientVg
->
offsetInfo
.
walVerBegin
;
pAssignment
->
end
=
pClientVg
->
offsetInfo
.
walVerEnd
;
pAssignment
->
vgId
=
pClientVg
->
vgId
;
tscInfo
(
"consumer:0x%"
PRIx64
" get assignment from local:%d->%"
PRId64
,
tmq
->
consumerId
,
pAssignment
->
vgId
,
pAssignment
->
currentOffset
);
}
if
(
needFetch
)
{
...
...
@@ -2718,17 +2707,17 @@ int32_t tmq_get_topic_assignment(tmq_t* tmq, const char* pTopicName, tmq_topic_a
SVgOffsetInfo
*
pOffsetInfo
=
&
pClientVg
->
offsetInfo
;
pOffsetInfo
->
currentOffset
.
type
=
TMQ_OFFSET__LOG
;
//
pOffsetInfo->currentOffset.type = TMQ_OFFSET__LOG;
char
offsetBuf
[
TSDB_OFFSET_LEN
]
=
{
0
};
tFormatOffset
(
offsetBuf
,
tListLen
(
offsetBuf
),
&
pOffsetInfo
->
currentOffset
);
//
char offsetBuf[TSDB_OFFSET_LEN] = {0};
//
tFormatOffset(offsetBuf, tListLen(offsetBuf), &pOffsetInfo->currentOffset);
tscInfo
(
"vgId:%d offset is
update to:%s"
,
p
->
vgId
,
offsetBuf
);
tscInfo
(
"vgId:%d offset is
old to:%"
PRId64
,
p
->
vgId
,
p
->
currentOffset
);
pOffsetInfo
->
walVerBegin
=
p
->
begin
;
pOffsetInfo
->
walVerEnd
=
p
->
end
;
pOffsetInfo
->
currentOffset
.
version
=
p
->
currentOffset
;
pOffsetInfo
->
committedOffset
.
version
=
p
->
currentOffset
;
//
pOffsetInfo->currentOffset.version = p->currentOffset;
//
pOffsetInfo->committedOffset.version = p->currentOffset;
}
}
}
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
7a48d05f
...
...
@@ -275,7 +275,7 @@ static void doAddNewConsumers(SMqRebOutputObj *pOutput, const SMqRebInputObj *pI
taosHashPut
(
pOutput
->
pSub
->
consumerHash
,
&
consumerId
,
sizeof
(
int64_t
),
&
newConsumerEp
,
sizeof
(
SMqConsumerEp
));
taosArrayPush
(
pOutput
->
newConsumers
,
&
consumerId
);
mInfo
(
"sub:%s mq rebalance add new consumer:%"
PRIx64
,
pSubKey
,
consumerId
);
mInfo
(
"sub:%s mq rebalance add new consumer:
0x
%"
PRIx64
,
pSubKey
,
consumerId
);
}
}
...
...
source/dnode/vnode/src/tq/tq.c
浏览文件 @
7a48d05f
...
...
@@ -560,18 +560,6 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
SMqDataRsp
dataRsp
=
{
0
};
tqInitDataRsp
(
&
dataRsp
,
&
req
);
STqOffset
*
pOffset
=
tqOffsetRead
(
pTq
->
pOffsetStore
,
req
.
subKey
);
if
(
pOffset
!=
NULL
)
{
if
(
pOffset
->
val
.
type
!=
TMQ_OFFSET__LOG
)
{
tqError
(
"consumer:0x%"
PRIx64
" vgId:%d subkey:%s use snapshot, no valid wal info"
,
consumerId
,
vgId
,
req
.
subKey
);
terrno
=
TSDB_CODE_INVALID_PARA
;
tDeleteMqDataRsp
(
&
dataRsp
);
return
-
1
;
}
dataRsp
.
rspOffset
.
type
=
TMQ_OFFSET__LOG
;
dataRsp
.
rspOffset
.
version
=
pOffset
->
val
.
version
;
}
else
{
if
(
req
.
useSnapshot
==
true
)
{
tqError
(
"consumer:0x%"
PRIx64
" vgId:%d subkey:%s snapshot not support wal info"
,
consumerId
,
vgId
,
req
.
subKey
);
terrno
=
TSDB_CODE_INVALID_PARA
;
...
...
@@ -582,12 +570,7 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
dataRsp
.
rspOffset
.
type
=
TMQ_OFFSET__LOG
;
if
(
reqOffset
.
type
==
TMQ_OFFSET__LOG
)
{
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_EARLIEST
)
{
dataRsp
.
rspOffset
.
version
=
sver
;
// not consume yet, set the earliest position
}
else
if
(
reqOffset
.
type
==
TMQ_OFFSET__RESET_LATEST
)
{
...
...
@@ -599,9 +582,10 @@ int32_t tqProcessVgWalInfoReq(STQ* pTq, SRpcMsg* pMsg) {
tDeleteMqDataRsp
(
&
dataRsp
);
return
-
1
;
}
}
tqInfo
(
"consumer:0x%"
PRIx64
" vgId:%d subkey:%s get assignment from init:%"
PRId64
,
consumerId
,
vgId
,
req
.
subKey
,
dataRsp
.
rspOffset
.
version
);
tqDoSendDataRsp
(
&
pMsg
->
info
,
&
dataRsp
,
req
.
epoch
,
req
.
consumerId
,
TMQ_MSG_TYPE__WALINFO_RSP
,
sver
,
ever
);
tDeleteMqDataRsp
(
&
dataRsp
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录