Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1740c1d2
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看板
未验证
提交
1740c1d2
编写于
9月 23, 2022
作者:
L
Liu Jicong
提交者:
GitHub
9月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17026 from taosdata/feature/tq
fix(tmq): save ntb check to another tb
上级
74ca7abf
3e0e7a87
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
16 deletion
+15
-16
source/dnode/vnode/src/tq/tqMeta.c
source/dnode/vnode/src/tq/tqMeta.c
+15
-16
未找到文件。
source/dnode/vnode/src/tq/tqMeta.c
浏览文件 @
1740c1d2
...
...
@@ -25,17 +25,17 @@ int32_t tEncodeSTqHandle(SEncoder* pEncoder, const STqHandle* pHandle) {
if
(
tEncodeI8
(
pEncoder
,
pHandle
->
execHandle
.
subType
)
<
0
)
return
-
1
;
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
if
(
tEncodeCStr
(
pEncoder
,
pHandle
->
execHandle
.
execCol
.
qmsg
)
<
0
)
return
-
1
;
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__DB
)
{
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__DB
)
{
int32_t
size
=
taosHashGetSize
(
pHandle
->
execHandle
.
execDb
.
pFilterOutTbUid
);
if
(
tEncodeI32
(
pEncoder
,
size
)
<
0
)
return
-
1
;
void
*
pIter
=
NULL
;
void
*
pIter
=
NULL
;
pIter
=
taosHashIterate
(
pHandle
->
execHandle
.
execDb
.
pFilterOutTbUid
,
pIter
);
while
(
pIter
)
{
int64_t
*
tbUid
=
(
int64_t
*
)
taosHashGetKey
(
pIter
,
NULL
);
while
(
pIter
)
{
int64_t
*
tbUid
=
(
int64_t
*
)
taosHashGetKey
(
pIter
,
NULL
);
if
(
tEncodeI64
(
pEncoder
,
*
tbUid
)
<
0
)
return
-
1
;
pIter
=
taosHashIterate
(
pHandle
->
execHandle
.
execDb
.
pFilterOutTbUid
,
pIter
);
}
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
if
(
tEncodeI64
(
pEncoder
,
pHandle
->
execHandle
.
execTb
.
suid
)
<
0
)
return
-
1
;
}
tEndEncode
(
pEncoder
);
...
...
@@ -52,17 +52,17 @@ int32_t tDecodeSTqHandle(SDecoder* pDecoder, STqHandle* pHandle) {
if
(
tDecodeI8
(
pDecoder
,
&
pHandle
->
execHandle
.
subType
)
<
0
)
return
-
1
;
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
if
(
tDecodeCStrAlloc
(
pDecoder
,
&
pHandle
->
execHandle
.
execCol
.
qmsg
)
<
0
)
return
-
1
;
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__DB
)
{
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__DB
)
{
pHandle
->
execHandle
.
execDb
.
pFilterOutTbUid
=
taosHashInit
(
64
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
false
,
HASH_NO_LOCK
);
int32_t
size
=
0
;
if
(
tDecodeI32
(
pDecoder
,
&
size
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
int64_t
tbUid
=
0
;
if
(
tDecodeI64
(
pDecoder
,
&
tbUid
)
<
0
)
return
-
1
;
taosHashPut
(
pHandle
->
execHandle
.
execDb
.
pFilterOutTbUid
,
&
tbUid
,
sizeof
(
int64_t
),
NULL
,
0
);
}
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
}
else
if
(
pHandle
->
execHandle
.
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
if
(
tDecodeI64
(
pDecoder
,
&
pHandle
->
execHandle
.
execTb
.
suid
)
<
0
)
return
-
1
;
}
tEndDecode
(
pDecoder
);
...
...
@@ -117,7 +117,7 @@ int32_t tqMetaSaveCheckInfo(STQ* pTq, const char* key, const void* value, int32_
return
-
1
;
}
if
(
tdbTbUpsert
(
pTq
->
p
Exec
Store
,
key
,
strlen
(
key
),
value
,
vLen
,
&
txn
)
<
0
)
{
if
(
tdbTbUpsert
(
pTq
->
p
Check
Store
,
key
,
strlen
(
key
),
value
,
vLen
,
&
txn
)
<
0
)
{
return
-
1
;
}
...
...
@@ -284,7 +284,6 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
};
if
(
handle
.
execHandle
.
subType
==
TOPIC_SUB_TYPE__COLUMN
)
{
handle
.
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
handle
.
execHandle
.
execCol
.
qmsg
,
&
reader
,
&
handle
.
execHandle
.
numOfCols
,
&
handle
.
execHandle
.
pSchemaWrapper
);
ASSERT
(
handle
.
execHandle
.
task
);
...
...
@@ -297,9 +296,9 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
handle
.
pWalReader
=
walOpenReader
(
pTq
->
pVnode
->
pWal
,
NULL
);
handle
.
execHandle
.
pExecReader
=
tqOpenReader
(
pTq
->
pVnode
);
buildSnapContext
(
reader
.
meta
,
reader
.
version
,
0
,
handle
.
execHandle
.
subType
,
handle
.
fetchMeta
,
(
SSnapContext
**
)(
&
reader
.
sContext
));
handle
.
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
NULL
,
&
reader
,
NULL
,
NULL
);
buildSnapContext
(
reader
.
meta
,
reader
.
version
,
0
,
handle
.
execHandle
.
subType
,
handle
.
fetchMeta
,
(
SSnapContext
**
)(
&
reader
.
sContext
));
handle
.
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
NULL
,
&
reader
,
NULL
,
NULL
);
}
else
if
(
handle
.
execHandle
.
subType
==
TOPIC_SUB_TYPE__TABLE
)
{
handle
.
pWalReader
=
walOpenReader
(
pTq
->
pVnode
->
pWal
,
NULL
);
...
...
@@ -314,9 +313,9 @@ int32_t tqMetaRestoreHandle(STQ* pTq) {
tqReaderSetTbUidList
(
handle
.
execHandle
.
pExecReader
,
tbUidList
);
taosArrayDestroy
(
tbUidList
);
buildSnapContext
(
reader
.
meta
,
reader
.
version
,
handle
.
execHandle
.
execTb
.
suid
,
handle
.
execHandle
.
subType
,
handle
.
fetchMeta
,
(
SSnapContext
**
)(
&
reader
.
sContext
));
handle
.
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
NULL
,
&
reader
,
NULL
,
NULL
);
buildSnapContext
(
reader
.
meta
,
reader
.
version
,
handle
.
execHandle
.
execTb
.
suid
,
handle
.
execHandle
.
subType
,
handle
.
fetchMeta
,
(
SSnapContext
**
)(
&
reader
.
sContext
));
handle
.
execHandle
.
task
=
qCreateQueueExecTaskInfo
(
NULL
,
&
reader
,
NULL
,
NULL
);
}
tqDebug
(
"tq restore %s consumer %"
PRId64
" vgId:%d"
,
handle
.
subKey
,
handle
.
consumerId
,
TD_VID
(
pTq
->
pVnode
));
taosHashPut
(
pTq
->
pHandle
,
pKey
,
kLen
,
&
handle
,
sizeof
(
STqHandle
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录