Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
25f451ba
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看板
提交
25f451ba
编写于
5月 04, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): fix result data block info.
上级
1a8a834a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
5 deletion
+15
-5
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+2
-2
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+12
-3
未找到文件。
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
25f451ba
...
@@ -197,7 +197,7 @@ static SMqRebInfo *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) {
...
@@ -197,7 +197,7 @@ static SMqRebInfo *mndGetOrCreateRebSub(SHashObj *pHash, const char *key) {
return
pRebSub
;
return
pRebSub
;
}
}
static
void
doRemove
Existed
Consumers
(
SMqRebOutputObj
*
pOutput
,
SHashObj
*
pHash
,
const
SMqRebInputObj
*
pInput
)
{
static
void
doRemove
Lost
Consumers
(
SMqRebOutputObj
*
pOutput
,
SHashObj
*
pHash
,
const
SMqRebInputObj
*
pInput
)
{
int32_t
numOfRemoved
=
taosArrayGetSize
(
pInput
->
pRebInfo
->
removedConsumers
);
int32_t
numOfRemoved
=
taosArrayGetSize
(
pInput
->
pRebInfo
->
removedConsumers
);
const
char
*
pSubKey
=
pOutput
->
pSub
->
key
;
const
char
*
pSubKey
=
pOutput
->
pSub
->
key
;
...
@@ -339,7 +339,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
...
@@ -339,7 +339,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
SHashObj
*
pHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_NO_LOCK
);
SHashObj
*
pHash
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_INT
),
false
,
HASH_NO_LOCK
);
// 2. check and get actual removed consumers, put their vg into pHash
// 2. check and get actual removed consumers, put their vg into pHash
doRemove
Existed
Consumers
(
pOutput
,
pHash
,
pInput
);
doRemove
Lost
Consumers
(
pOutput
,
pHash
,
pInput
);
// 3. if previously no consumer, there are vgs not assigned, put these vg into pHash
// 3. if previously no consumer, there are vgs not assigned, put these vg into pHash
addUnassignedVgroups
(
pOutput
,
pHash
);
addUnassignedVgroups
(
pOutput
,
pHash
);
...
...
source/dnode/vnode/inc/vnode.h
浏览文件 @
25f451ba
...
@@ -241,6 +241,7 @@ typedef struct STqReader {
...
@@ -241,6 +241,7 @@ typedef struct STqReader {
SArray
*
pColIdList
;
// SArray<int16_t>
SArray
*
pColIdList
;
// SArray<int16_t>
int32_t
cachedSchemaVer
;
int32_t
cachedSchemaVer
;
int64_t
cachedSchemaSuid
;
int64_t
cachedSchemaSuid
;
int64_t
cachedSchemaUid
;
SSchemaWrapper
*
pSchemaWrapper
;
SSchemaWrapper
*
pSchemaWrapper
;
SSDataBlock
*
pResBlock
;
SSDataBlock
*
pResBlock
;
}
STqReader
;
}
STqReader
;
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
25f451ba
...
@@ -530,22 +530,27 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader, SSubmitTbDa
...
@@ -530,22 +530,27 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader, SSubmitTbDa
pBlock
->
info
.
id
.
uid
=
uid
;
pBlock
->
info
.
id
.
uid
=
uid
;
pBlock
->
info
.
version
=
pReader
->
msg
.
ver
;
pBlock
->
info
.
version
=
pReader
->
msg
.
ver
;
if
(
pReader
->
cachedSchemaSuid
==
0
||
pReader
->
cachedSchemaVer
!=
sversion
||
pReader
->
cachedSchemaSuid
!=
suid
)
{
if
(
(
suid
!=
0
&&
pReader
->
cachedSchemaSuid
!=
suid
)
||
(
suid
==
0
&&
pReader
->
cachedSchemaUid
!=
uid
)
||
(
pReader
->
cachedSchemaVer
!=
sversion
)
)
{
tDeleteSchemaWrapper
(
pReader
->
pSchemaWrapper
);
tDeleteSchemaWrapper
(
pReader
->
pSchemaWrapper
);
pReader
->
pSchemaWrapper
=
metaGetTableSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
pReader
->
pSchemaWrapper
=
metaGetTableSchema
(
pReader
->
pVnodeMeta
,
uid
,
sversion
,
1
);
if
(
pReader
->
pSchemaWrapper
==
NULL
)
{
if
(
pReader
->
pSchemaWrapper
==
NULL
)
{
tqWarn
(
"vgId:%d, cannot found schema wrapper for table: suid:%"
PRId64
", version %d, possibly dropped table"
,
tqWarn
(
"vgId:%d, cannot found schema wrapper for table: suid:%"
PRId64
",
uid:%"
PRId64
"
version %d, possibly dropped table"
,
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
uid
,
pReader
->
cachedSchemaVer
);
pReader
->
pWalReader
->
pWal
->
cfg
.
vgId
,
suid
,
uid
,
pReader
->
cachedSchemaVer
);
pReader
->
cachedSchemaSuid
=
0
;
pReader
->
cachedSchemaSuid
=
0
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
terrno
=
TSDB_CODE_TQ_TABLE_SCHEMA_NOT_FOUND
;
return
-
1
;
return
-
1
;
}
}
pReader
->
cachedSchemaUid
=
uid
;
pReader
->
cachedSchemaSuid
=
suid
;
pReader
->
cachedSchemaSuid
=
suid
;
pReader
->
cachedSchemaVer
=
sversion
;
pReader
->
cachedSchemaVer
=
sversion
;
SSchemaWrapper
*
pSchemaWrapper
=
pReader
->
pSchemaWrapper
;
SSchemaWrapper
*
pSchemaWrapper
=
pReader
->
pSchemaWrapper
;
if
(
blockDataGetNumOfCols
(
pBlock
)
>
0
)
{
blockDataDestroy
(
pReader
->
pResBlock
);
pReader
->
pResBlock
=
createDataBlock
();
}
int32_t
numOfCols
=
taosArrayGetSize
(
pReader
->
pColIdList
);
int32_t
numOfCols
=
taosArrayGetSize
(
pReader
->
pColIdList
);
if
(
numOfCols
==
0
)
{
// all columns are required
if
(
numOfCols
==
0
)
{
// all columns are required
...
@@ -671,8 +676,12 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader, SSubmitTbDa
...
@@ -671,8 +676,12 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader, SSubmitTbDa
SColumnInfoData
*
pColData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
j
);
SColumnInfoData
*
pColData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
j
);
while
(
1
)
{
while
(
1
)
{
SColVal
colVal
;
SColVal
colVal
;
tqDebug
(
"start to extract column id:%d, index:%d"
,
pColData
->
info
.
colId
,
sourceIdx
);
tRowGet
(
pRow
,
pTSchema
,
sourceIdx
,
&
colVal
);
tRowGet
(
pRow
,
pTSchema
,
sourceIdx
,
&
colVal
);
if
(
colVal
.
cid
<
pColData
->
info
.
colId
)
{
if
(
colVal
.
cid
<
pColData
->
info
.
colId
)
{
tqDebug
(
"colIndex:%d column id:%d in row, ignore, the required colId:%d, total cols in schema:%d"
,
sourceIdx
,
colVal
.
cid
,
pColData
->
info
.
colId
,
pTSchema
->
numOfCols
);
sourceIdx
++
;
sourceIdx
++
;
continue
;
continue
;
}
else
if
(
colVal
.
cid
==
pColData
->
info
.
colId
)
{
}
else
if
(
colVal
.
cid
==
pColData
->
info
.
colId
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录