Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3c535162
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看板
提交
3c535162
编写于
4月 21, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: use tdbTbUpsert for metaUpdate functions
上级
1b2fe38f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
8 deletion
+10
-8
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+10
-8
未找到文件。
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
3c535162
...
...
@@ -1029,7 +1029,7 @@ int metaUpdateCtimeIdx(SMeta *pMeta, const SMetaEntry *pME) {
metaTrace
(
"vgId:%d, start to save version:%"
PRId64
" uid:%"
PRId64
" ctime:%"
PRId64
,
TD_VID
(
pMeta
->
pVnode
),
pME
->
version
,
pME
->
uid
,
ctimeKey
.
ctime
);
return
tdbTb
In
sert
(
pMeta
->
pCtimeIdx
,
&
ctimeKey
,
sizeof
(
ctimeKey
),
NULL
,
0
,
pMeta
->
txn
);
return
tdbTb
Up
sert
(
pMeta
->
pCtimeIdx
,
&
ctimeKey
,
sizeof
(
ctimeKey
),
NULL
,
0
,
pMeta
->
txn
);
}
int
metaDeleteCtimeIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
...
...
@@ -1044,7 +1044,7 @@ int metaUpdateNcolIdx(SMeta *pMeta, const SMetaEntry *pME) {
if
(
metaBuildNColIdxKey
(
&
ncolKey
,
pME
)
<
0
)
{
return
0
;
}
return
tdbTb
In
sert
(
pMeta
->
pNcolIdx
,
&
ncolKey
,
sizeof
(
ncolKey
),
NULL
,
0
,
pMeta
->
txn
);
return
tdbTb
Up
sert
(
pMeta
->
pNcolIdx
,
&
ncolKey
,
sizeof
(
ncolKey
),
NULL
,
0
,
pMeta
->
txn
);
}
int
metaDeleteNcolIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
...
...
@@ -1878,24 +1878,24 @@ static int metaUpdateUidIdx(SMeta *pMeta, const SMetaEntry *pME) {
}
static
int
metaUpdateSuidIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
return
tdbTb
In
sert
(
pMeta
->
pSuidIdx
,
&
pME
->
uid
,
sizeof
(
tb_uid_t
),
NULL
,
0
,
pMeta
->
txn
);
return
tdbTb
Up
sert
(
pMeta
->
pSuidIdx
,
&
pME
->
uid
,
sizeof
(
tb_uid_t
),
NULL
,
0
,
pMeta
->
txn
);
}
static
int
metaUpdateNameIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
return
tdbTb
In
sert
(
pMeta
->
pNameIdx
,
pME
->
name
,
strlen
(
pME
->
name
)
+
1
,
&
pME
->
uid
,
sizeof
(
tb_uid_t
),
pMeta
->
txn
);
return
tdbTb
Up
sert
(
pMeta
->
pNameIdx
,
pME
->
name
,
strlen
(
pME
->
name
)
+
1
,
&
pME
->
uid
,
sizeof
(
tb_uid_t
),
pMeta
->
txn
);
}
static
int
metaUpdateTtlIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
STtlIdxKey
ttlKey
=
{
0
};
metaBuildTtlIdxKey
(
&
ttlKey
,
pME
);
if
(
ttlKey
.
dtime
==
0
)
return
0
;
return
tdbTb
In
sert
(
pMeta
->
pTtlIdx
,
&
ttlKey
,
sizeof
(
ttlKey
),
NULL
,
0
,
pMeta
->
txn
);
return
tdbTb
Up
sert
(
pMeta
->
pTtlIdx
,
&
ttlKey
,
sizeof
(
ttlKey
),
NULL
,
0
,
pMeta
->
txn
);
}
static
int
metaUpdateCtbIdx
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
SCtbIdxKey
ctbIdxKey
=
{.
suid
=
pME
->
ctbEntry
.
suid
,
.
uid
=
pME
->
uid
};
return
tdbTb
In
sert
(
pMeta
->
pCtbIdx
,
&
ctbIdxKey
,
sizeof
(
ctbIdxKey
),
pME
->
ctbEntry
.
pTags
,
return
tdbTb
Up
sert
(
pMeta
->
pCtbIdx
,
&
ctbIdxKey
,
sizeof
(
ctbIdxKey
),
pME
->
ctbEntry
.
pTags
,
((
STag
*
)(
pME
->
ctbEntry
.
pTags
))
->
len
,
pMeta
->
txn
);
}
...
...
@@ -2114,12 +2114,14 @@ int metaHandleEntry(SMeta *pMeta, const SMetaEntry *pME) {
}
metaULock
(
pMeta
);
metaDebug
(
"vgId:%d, handle meta entry, ver:%"
PRId64
", uid:%"
PRId64
", name:%s"
,
TD_VID
(
pMeta
->
pVnode
),
pME
->
version
,
pME
->
uid
,
pME
->
name
);
return
0
;
_err:
metaULock
(
pMeta
);
metaError
(
"vgId:%d, failed to handle meta entry since %s at line:%d, ver:%"
PRId64
", uid:%"
PRId64
,
TD_VID
(
pMeta
->
pVnode
),
terrstr
(),
line
,
pME
->
version
,
pME
->
uid
);
metaError
(
"vgId:%d, failed to handle meta entry since %s at line:%d, ver:%"
PRId64
", uid:%"
PRId64
", name:%s"
,
TD_VID
(
pMeta
->
pVnode
),
terrstr
(),
line
,
pME
->
version
,
pME
->
uid
,
pME
->
name
);
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录