Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1b2fe38f
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看板
提交
1b2fe38f
编写于
4月 20, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: improve logging msg in metaSnapWrite
上级
7c5cc229
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
13 deletion
+31
-13
include/util/tutil.h
include/util/tutil.h
+2
-0
source/dnode/vnode/src/meta/metaSnapshot.c
source/dnode/vnode/src/meta/metaSnapshot.c
+4
-3
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+25
-10
未找到文件。
include/util/tutil.h
浏览文件 @
1b2fe38f
...
...
@@ -98,6 +98,8 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen,
goto LABEL; \
}
#define VND_CHECK_CODE(CODE, LINO, LABEL) TSDB_CHECK_CODE(CODE, LINO, LABEL)
#ifdef __cplusplus
}
#endif
...
...
source/dnode/vnode/src/meta/metaSnapshot.c
浏览文件 @
1b2fe38f
...
...
@@ -187,23 +187,24 @@ _err:
int32_t
metaSnapWrite
(
SMetaSnapWriter
*
pWriter
,
uint8_t
*
pData
,
uint32_t
nData
)
{
int32_t
code
=
0
;
int32_t
line
=
0
;
SMeta
*
pMeta
=
pWriter
->
pMeta
;
SMetaEntry
metaEntry
=
{
0
};
SDecoder
*
pDecoder
=
&
(
SDecoder
){
0
};
tDecoderInit
(
pDecoder
,
pData
+
sizeof
(
SSnapDataHdr
),
nData
-
sizeof
(
SSnapDataHdr
));
code
=
metaDecodeEntry
(
pDecoder
,
&
metaEntry
);
if
(
code
)
goto
_err
;
VND_CHECK_CODE
(
code
,
line
,
_err
)
;
code
=
metaHandleEntry
(
pMeta
,
&
metaEntry
);
if
(
code
)
goto
_err
;
VND_CHECK_CODE
(
code
,
line
,
_err
)
;
tDecoderClear
(
pDecoder
);
return
code
;
_err:
tDecoderClear
(
pDecoder
);
metaError
(
"vgId:%d, vnode snapshot meta write failed since %s
"
,
TD_VID
(
pMeta
->
pVnode
),
tstrerror
(
code
)
);
metaError
(
"vgId:%d, vnode snapshot meta write failed since %s
at line:%d"
,
TD_VID
(
pMeta
->
pVnode
),
terrstr
(),
line
);
return
code
;
}
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
1b2fe38f
...
...
@@ -2065,40 +2065,52 @@ _exit:
}
int
metaHandleEntry
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
int32_t
code
=
0
;
int32_t
line
=
0
;
metaWLock
(
pMeta
);
// save to table.db
if
(
metaSaveToTbDb
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaSaveToTbDb
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
// update uid.idx
if
(
metaUpdateUidIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateUidIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
// update name.idx
if
(
metaUpdateNameIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateNameIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
if
(
pME
->
type
==
TSDB_CHILD_TABLE
)
{
// update ctb.idx
if
(
metaUpdateCtbIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateCtbIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
// update tag.idx
if
(
metaUpdateTagIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateTagIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
}
else
{
// update schema.db
if
(
metaSaveToSkmDb
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaSaveToSkmDb
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
if
(
pME
->
type
==
TSDB_SUPER_TABLE
)
{
if
(
metaUpdateSuidIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateSuidIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
}
}
if
(
metaUpdateCtimeIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateCtimeIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
if
(
pME
->
type
==
TSDB_NORMAL_TABLE
)
{
if
(
metaUpdateNcolIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateNcolIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
}
if
(
pME
->
type
!=
TSDB_SUPER_TABLE
)
{
if
(
metaUpdateTtlIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
code
=
metaUpdateTtlIdx
(
pMeta
,
pME
);
VND_CHECK_CODE
(
code
,
line
,
_err
);
}
metaULock
(
pMeta
);
...
...
@@ -2106,8 +2118,11 @@ int metaHandleEntry(SMeta *pMeta, const SMetaEntry *pME) {
_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
);
return
-
1
;
}
// refactor later
void
*
metaGetIdx
(
SMeta
*
pMeta
)
{
return
pMeta
->
pTagIdx
;
}
void
*
metaGetIvtIdx
(
SMeta
*
pMeta
)
{
return
pMeta
->
pTagIvtIdx
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录