Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
06673596
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看板
提交
06673596
编写于
11月 18, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
other: merge with original branch.
上级
0d10294b
35b9dc6b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
8 deletion
+21
-8
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+1
-1
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+16
-3
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbMemTable.c
source/dnode/vnode/src/tsdb/tsdbMemTable.c
+3
-3
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
06673596
...
...
@@ -142,7 +142,7 @@ typedef struct SMetaInfo {
int64_t
version
;
int32_t
skmVer
;
}
SMetaInfo
;
int32_t
metaGetInfo
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
);
int32_t
metaGetInfo
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
,
SMetaReader
*
pReader
);
typedef
struct
{
int64_t
uid
;
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
06673596
...
...
@@ -165,8 +165,9 @@ int metaGetTableEntryByUid(SMetaReader *pReader, tb_uid_t uid) {
version1 = ((SUidIdxVal *)pReader->pBuf)[0].version;
return metaGetTableEntryByVersion(pReader, version1, uid);
*/
SMetaInfo
info
;
if
(
metaGetInfo
(
pMeta
,
uid
,
&
info
)
==
TSDB_CODE_NOT_FOUND
)
{
if
(
metaGetInfo
(
pMeta
,
uid
,
&
info
,
pReader
)
==
TSDB_CODE_NOT_FOUND
)
{
terrno
=
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
return
-
1
;
}
...
...
@@ -623,7 +624,7 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv
SSkmDbKey
skmDbKey
;
if
(
sver
<=
0
)
{
SMetaInfo
info
;
if
(
metaGetInfo
(
pMeta
,
suid
?
suid
:
uid
,
&
info
)
==
0
)
{
if
(
metaGetInfo
(
pMeta
,
suid
?
suid
:
uid
,
&
info
,
NULL
)
==
0
)
{
sver
=
info
.
skmVer
;
}
else
{
TBC
*
pSkmDbC
=
NULL
;
...
...
@@ -1388,10 +1389,11 @@ int32_t metaGetTableTags(SMeta *pMeta, uint64_t suid, SArray *uidList, SHashObj
int32_t
metaCacheGet
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
);
int32_t
metaGetInfo
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
)
{
int32_t
metaGetInfo
(
SMeta
*
pMeta
,
int64_t
uid
,
SMetaInfo
*
pInfo
,
SMetaReader
*
pReader
)
{
int32_t
code
=
0
;
void
*
pData
=
NULL
;
int
nData
=
0
;
int
lock
=
0
;
metaRLock
(
pMeta
);
...
...
@@ -1416,11 +1418,22 @@ int32_t metaGetInfo(SMeta *pMeta, int64_t uid, SMetaInfo *pInfo) {
pInfo
->
version
=
((
SUidIdxVal
*
)
pData
)
->
version
;
pInfo
->
skmVer
=
((
SUidIdxVal
*
)
pData
)
->
skmVer
;
if
(
pReader
!=
NULL
)
{
lock
=
!
(
pReader
->
flags
&
META_READER_NOLOCK
);
if
(
lock
)
{
metaULock
(
pReader
->
pMeta
);
// metaReaderReleaseLock(pReader);
}
}
// upsert the cache
metaWLock
(
pMeta
);
metaCacheUpsert
(
pMeta
,
pInfo
);
metaULock
(
pMeta
);
if
(
lock
)
{
metaRLock
(
pReader
->
pMeta
);
}
_exit:
tdbFree
(
pData
);
return
code
;
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
06673596
...
...
@@ -207,7 +207,7 @@ int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
tb_uid_t
uid
=
*
(
tb_uid_t
*
)
pData
;
tdbFree
(
pData
);
SMetaInfo
info
;
metaGetInfo
(
pMeta
,
uid
,
&
info
);
metaGetInfo
(
pMeta
,
uid
,
&
info
,
NULL
);
if
(
info
.
uid
==
info
.
suid
)
{
return
0
;
}
else
{
...
...
source/dnode/vnode/src/tsdb/tsdbMemTable.c
浏览文件 @
06673596
...
...
@@ -104,7 +104,7 @@ int32_t tsdbInsertTableData(STsdb *pTsdb, int64_t version, SSubmitMsgIter *pMsgI
tb_uid_t
uid
=
pMsgIter
->
uid
;
SMetaInfo
info
;
code
=
metaGetInfo
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
&
info
);
code
=
metaGetInfo
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
&
info
,
NULL
);
if
(
code
)
{
code
=
TSDB_CODE_TDB_TABLE_NOT_EXIST
;
goto
_err
;
...
...
@@ -114,7 +114,7 @@ int32_t tsdbInsertTableData(STsdb *pTsdb, int64_t version, SSubmitMsgIter *pMsgI
goto
_err
;
}
if
(
info
.
suid
)
{
metaGetInfo
(
pTsdb
->
pVnode
->
pMeta
,
info
.
suid
,
&
info
);
metaGetInfo
(
pTsdb
->
pVnode
->
pMeta
,
info
.
suid
,
&
info
,
NULL
);
}
if
(
pMsgIter
->
sversion
!=
info
.
skmVer
)
{
tsdbError
(
"vgId:%d, req sver:%d, skmVer:%d suid:%"
PRId64
" uid:%"
PRId64
,
TD_VID
(
pTsdb
->
pVnode
),
...
...
@@ -153,7 +153,7 @@ int32_t tsdbDeleteTableData(STsdb *pTsdb, int64_t version, tb_uid_t suid, tb_uid
// check if table exists
SMetaInfo
info
;
code
=
metaGetInfo
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
&
info
);
code
=
metaGetInfo
(
pTsdb
->
pVnode
->
pMeta
,
uid
,
&
info
,
NULL
);
if
(
code
)
{
code
=
TSDB_CODE_TDB_TABLE_NOT_EXIST
;
goto
_err
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录