Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ae509e87
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看板
提交
ae509e87
编写于
5月 11, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: concurrent r/w meta
上级
f57a652a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
20 addition
and
7 deletion
+20
-7
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+4
-0
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+14
-7
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-0
未找到文件。
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
ae509e87
...
@@ -19,9 +19,13 @@ void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags) {
...
@@ -19,9 +19,13 @@ void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags) {
memset
(
pReader
,
0
,
sizeof
(
*
pReader
));
memset
(
pReader
,
0
,
sizeof
(
*
pReader
));
pReader
->
flags
=
flags
;
pReader
->
flags
=
flags
;
pReader
->
pMeta
=
pMeta
;
pReader
->
pMeta
=
pMeta
;
metaRLock
(
pMeta
);
}
}
void
metaReaderClear
(
SMetaReader
*
pReader
)
{
void
metaReaderClear
(
SMetaReader
*
pReader
)
{
if
(
pReader
->
pMeta
)
{
metaULock
(
pReader
->
pMeta
);
}
tDecoderClear
(
&
pReader
->
coder
);
tDecoderClear
(
&
pReader
->
coder
);
tdbFree
(
pReader
->
pBuf
);
tdbFree
(
pReader
->
pBuf
);
}
}
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
ae509e87
...
@@ -439,29 +439,36 @@ _exit:
...
@@ -439,29 +439,36 @@ _exit:
}
}
static
int
metaHandleEntry
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
static
int
metaHandleEntry
(
SMeta
*
pMeta
,
const
SMetaEntry
*
pME
)
{
metaWLock
(
pMeta
);
// save to table.db
// save to table.db
if
(
metaSaveToTbDb
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaSaveToTbDb
(
pMeta
,
pME
)
<
0
)
goto
_err
;
// update uid.idx
// update uid.idx
if
(
metaUpdateUidIdx
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaUpdateUidIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
// update name.idx
// update name.idx
if
(
metaUpdateNameIdx
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaUpdateNameIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
if
(
pME
->
type
==
TSDB_CHILD_TABLE
)
{
if
(
pME
->
type
==
TSDB_CHILD_TABLE
)
{
// update ctb.idx
// update ctb.idx
if
(
metaUpdateCtbIdx
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaUpdateCtbIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
// update tag.idx
// update tag.idx
if
(
metaUpdateTagIdx
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaUpdateTagIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
}
else
{
}
else
{
// update schema.db
// update schema.db
if
(
metaSaveToSkmDb
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaSaveToSkmDb
(
pMeta
,
pME
)
<
0
)
goto
_err
;
}
}
if
(
pME
->
type
!=
TSDB_SUPER_TABLE
)
{
if
(
pME
->
type
!=
TSDB_SUPER_TABLE
)
{
if
(
metaUpdateTtlIdx
(
pMeta
,
pME
)
<
0
)
return
-
1
;
if
(
metaUpdateTtlIdx
(
pMeta
,
pME
)
<
0
)
goto
_err
;
}
}
metaULock
(
pMeta
);
return
0
;
return
0
;
_err:
metaULock
(
pMeta
);
return
-
1
;
}
}
\ No newline at end of file
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
ae509e87
...
@@ -3870,6 +3870,7 @@ int32_t tsdbQuerySTableByTagCond(void* pMeta, uint64_t uid, TSKEY skey, const ch
...
@@ -3870,6 +3870,7 @@ int32_t tsdbQuerySTableByTagCond(void* pMeta, uint64_t uid, TSKEY skey, const ch
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
<
0
)
{
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
<
0
)
{
tsdbError
(
"%p failed to get stable, uid:%"
PRIu64
", TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
pMeta
,
uid
,
taskId
,
reqId
);
tsdbError
(
"%p failed to get stable, uid:%"
PRIu64
", TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
pMeta
,
uid
,
taskId
,
reqId
);
metaReaderClear
(
&
mr
);
terrno
=
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
terrno
=
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
goto
_error
;
goto
_error
;
}
else
{
}
else
{
...
@@ -3880,6 +3881,7 @@ int32_t tsdbQuerySTableByTagCond(void* pMeta, uint64_t uid, TSKEY skey, const ch
...
@@ -3880,6 +3881,7 @@ int32_t tsdbQuerySTableByTagCond(void* pMeta, uint64_t uid, TSKEY skey, const ch
tsdbError
(
"%p query normal tag not allowed, uid:%"
PRIu64
", TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
pMeta
,
uid
,
taskId
,
tsdbError
(
"%p query normal tag not allowed, uid:%"
PRIu64
", TID:0x%"
PRIx64
" QID:0x%"
PRIx64
,
pMeta
,
uid
,
taskId
,
reqId
);
reqId
);
terrno
=
TSDB_CODE_OPS_NOT_SUPPORT
;
// basically, this error is caused by invalid sql issued by client
terrno
=
TSDB_CODE_OPS_NOT_SUPPORT
;
// basically, this error is caused by invalid sql issued by client
metaReaderClear
(
&
mr
);
goto
_error
;
goto
_error
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录