Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0948216c
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0948216c
编写于
11月 26, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix dead lock.
上级
9997ff9a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
27 addition
and
17 deletion
+27
-17
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+1
-0
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+4
-2
source/dnode/vnode/src/meta/metaSma.c
source/dnode/vnode/src/meta/metaSma.c
+1
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+2
-2
source/dnode/vnode/src/tq/tqExec.c
source/dnode/vnode/src/tq/tqExec.c
+1
-1
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+2
-2
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+2
-2
source/libs/executor/src/executor.c
source/libs/executor/src/executor.c
+1
-1
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+2
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-2
source/libs/executor/src/sysscanoperator.c
source/libs/executor/src/sysscanoperator.c
+7
-0
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
0948216c
...
...
@@ -99,6 +99,7 @@ void metaReaderInit(SMetaReader *pReader, SMeta *pMeta, int32_t flags);
void
metaReaderReleaseLock
(
SMetaReader
*
pReader
);
void
metaReaderClear
(
SMetaReader
*
pReader
);
int32_t
metaGetTableEntryByUid
(
SMetaReader
*
pReader
,
tb_uid_t
uid
);
int32_t
metaGetTableEntryByUidCache
(
SMetaReader
*
pReader
,
tb_uid_t
uid
);
int
metaGetTableEntryByName
(
SMetaReader
*
pReader
,
const
char
*
name
);
int32_t
metaGetTableTags
(
SMeta
*
pMeta
,
uint64_t
suid
,
SArray
*
uidList
,
SHashObj
*
tags
);
int32_t
metaGetTableTagsByUids
(
SMeta
*
pMeta
,
int64_t
suid
,
SArray
*
uidList
,
SHashObj
*
tags
);
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
0948216c
...
...
@@ -153,7 +153,6 @@ bool metaIsTableExist(SMeta *pMeta, tb_uid_t uid) {
int
metaGetTableEntryByUid
(
SMetaReader
*
pReader
,
tb_uid_t
uid
)
{
SMeta
*
pMeta
=
pReader
->
pMeta
;
/*
int64_t
version1
;
// query uid.idx
...
...
@@ -164,7 +163,10 @@ int metaGetTableEntryByUid(SMetaReader *pReader, tb_uid_t uid) {
version1
=
((
SUidIdxVal
*
)
pReader
->
pBuf
)[
0
].
version
;
return
metaGetTableEntryByVersion
(
pReader
,
version1
,
uid
);
*/
}
int
metaGetTableEntryByUidCache
(
SMetaReader
*
pReader
,
tb_uid_t
uid
)
{
SMeta
*
pMeta
=
pReader
->
pMeta
;
SMetaInfo
info
;
if
(
metaGetInfo
(
pMeta
,
uid
,
&
info
,
pReader
)
==
TSDB_CODE_NOT_FOUND
)
{
...
...
source/dnode/vnode/src/meta/metaSma.c
浏览文件 @
0948216c
...
...
@@ -36,7 +36,7 @@ int32_t metaCreateTSma(SMeta *pMeta, int64_t version, SSmaCfg *pCfg) {
// validate req
// save smaIndex
metaReaderInit
(
&
mr
,
pMeta
,
0
);
if
(
metaGetTableEntryByUid
(
&
mr
,
pCfg
->
indexUid
)
==
0
)
{
if
(
metaGetTableEntryByUid
Cache
(
&
mr
,
pCfg
->
indexUid
)
==
0
)
{
#if 1
terrno
=
TSDB_CODE_TSMA_ALREADY_EXIST
;
metaReaderClear
(
&
mr
);
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
0948216c
...
...
@@ -921,7 +921,7 @@ static int32_t tdRSmaInfoClone(SSma *pSma, SRSmaInfo *pInfo) {
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
SMA_META
(
pSma
),
0
);
smaDebug
(
"vgId:%d, rsma clone qTaskInfo for suid:%"
PRIi64
,
SMA_VID
(
pSma
),
pInfo
->
suid
);
if
(
metaGetTableEntryByUid
(
&
mr
,
pInfo
->
suid
)
<
0
)
{
if
(
metaGetTableEntryByUid
Cache
(
&
mr
,
pInfo
->
suid
)
<
0
)
{
smaError
(
"vgId:%d, rsma clone, failed to get table meta for %"
PRIi64
" since %s"
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
terrstr
());
goto
_err
;
...
...
@@ -1125,7 +1125,7 @@ static int32_t tdRSmaRestoreQTaskInfoInit(SSma *pSma, int64_t *nTables) {
for
(
int64_t
i
=
0
;
i
<
arrSize
;
++
i
)
{
tb_uid_t
suid
=
*
(
tb_uid_t
*
)
taosArrayGet
(
suidList
,
i
);
smaDebug
(
"vgId:%d, rsma restore, suid is %"
PRIi64
,
TD_VID
(
pVnode
),
suid
);
if
(
metaGetTableEntryByUid
(
&
mr
,
suid
)
<
0
)
{
if
(
metaGetTableEntryByUid
Cache
(
&
mr
,
suid
)
<
0
)
{
smaError
(
"vgId:%d, rsma restore, failed to get table meta for %"
PRIi64
" since %s"
,
TD_VID
(
pVnode
),
suid
,
terrstr
());
goto
_err
;
...
...
source/dnode/vnode/src/tq/tqExec.c
浏览文件 @
0948216c
...
...
@@ -48,7 +48,7 @@ static int32_t tqAddTbNameToRsp(const STQ* pTq, int64_t uid, SMqDataRsp* pRsp, i
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pTq
->
pVnode
->
pMeta
,
0
);
// TODO add reference to gurantee success
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
<
0
)
{
if
(
metaGetTableEntryByUid
Cache
(
&
mr
,
uid
)
<
0
)
{
metaReaderClear
(
&
mr
);
return
-
1
;
}
...
...
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
0948216c
...
...
@@ -766,7 +766,7 @@ int32_t tqUpdateTbUidList(STQ* pTq, const SArray* tbUidList, bool isAdd) {
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
tbUidList
);
++
i
)
{
uint64_t
*
id
=
(
uint64_t
*
)
taosArrayGet
(
tbUidList
,
i
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
*
id
);
int32_t
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
*
id
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table meta, uid:%"
PRIu64
" code:%s"
,
*
id
,
tstrerror
(
terrno
));
continue
;
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
0948216c
...
...
@@ -392,7 +392,7 @@ static tb_uid_t getTableSuidByUid(tb_uid_t uid, STsdb *pTsdb) {
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pTsdb
->
pVnode
->
pMeta
,
0
);
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
<
0
)
{
if
(
metaGetTableEntryByUid
Cache
(
&
mr
,
uid
)
<
0
)
{
metaReaderClear
(
&
mr
);
// table not esist
return
0
;
}
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
0948216c
...
...
@@ -4350,7 +4350,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pVnode
->
pMeta
,
0
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
uid
);
int32_t
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
TSDB_CODE_TDB_INVALID_TABLE_ID
;
metaReaderClear
(
&
mr
);
...
...
@@ -4362,7 +4362,7 @@ int32_t tsdbGetTableSchema(SVnode* pVnode, int64_t uid, STSchema** pSchema, int6
if
(
mr
.
me
.
type
==
TSDB_CHILD_TABLE
)
{
tDecoderClear
(
&
mr
.
coder
);
*
suid
=
mr
.
me
.
ctbEntry
.
suid
;
code
=
metaGetTableEntryByUid
(
&
mr
,
*
suid
);
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
*
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
TSDB_CODE_TDB_INVALID_TABLE_ID
;
metaReaderClear
(
&
mr
);
...
...
source/libs/executor/src/executil.c
浏览文件 @
0948216c
...
...
@@ -290,7 +290,7 @@ int32_t isQualifiedTable(STableKeyInfo* info, SNode* pTagCond, void* metaHandle,
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
metaHandle
,
0
);
code
=
metaGetTableEntryByUid
(
&
mr
,
info
->
uid
);
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
info
->
uid
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
metaReaderClear
(
&
mr
);
*
pQualified
=
false
;
...
...
@@ -1092,7 +1092,7 @@ size_t getTableTagsBufLen(const SNodeList* pGroups) {
int32_t
getGroupIdFromTagsVal
(
void
*
pMeta
,
uint64_t
uid
,
SNodeList
*
pGroupNode
,
char
*
keyBuf
,
uint64_t
*
pGroupId
)
{
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pMeta
,
0
);
if
(
metaGetTableEntryByUid
(
&
mr
,
uid
)
!=
0
)
{
// table not exist
if
(
metaGetTableEntryByUid
Cache
(
&
mr
,
uid
)
!=
0
)
{
// table not exist
metaReaderClear
(
&
mr
);
return
TSDB_CODE_PAR_TABLE_NOT_EXIST
;
}
...
...
source/libs/executor/src/executor.c
浏览文件 @
0948216c
...
...
@@ -287,7 +287,7 @@ static SArray* filterUnqualifiedTables(const SStreamScanInfo* pScanInfo, const S
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
tableIdList
);
++
i
)
{
uint64_t
*
id
=
(
uint64_t
*
)
taosArrayGet
(
tableIdList
,
i
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
*
id
);
int32_t
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
*
id
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table meta, uid:%"
PRIu64
" code:%s, %s"
,
*
id
,
tstrerror
(
terrno
),
idstr
);
continue
;
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
0948216c
...
...
@@ -2317,7 +2317,7 @@ SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode);
int32_t
extractTableSchemaInfo
(
SReadHandle
*
pHandle
,
SScanPhysiNode
*
pScanNode
,
SExecTaskInfo
*
pTaskInfo
)
{
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pHandle
->
meta
,
0
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
pScanNode
->
uid
);
int32_t
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
pScanNode
->
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get the table meta, uid:0x%"
PRIx64
", suid:0x%"
PRIx64
", %s"
,
pScanNode
->
uid
,
pScanNode
->
suid
,
GET_TASKID
(
pTaskInfo
));
...
...
@@ -2336,7 +2336,7 @@ int32_t extractTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode,
tDecoderClear
(
&
mr
.
coder
);
tb_uid_t
suid
=
mr
.
me
.
ctbEntry
.
suid
;
metaGetTableEntryByUid
(
&
mr
,
suid
);
metaGetTableEntryByUid
Cache
(
&
mr
,
suid
);
pSchemaInfo
->
sw
=
tCloneSSchemaWrapper
(
&
mr
.
me
.
stbEntry
.
schemaRow
);
pSchemaInfo
->
tversion
=
mr
.
me
.
stbEntry
.
schemaTag
.
version
;
}
else
{
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
0948216c
...
...
@@ -484,7 +484,7 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int
// 1. check if it is existed in meta cache
if
(
pCache
==
NULL
)
{
metaReaderInit
(
&
mr
,
pHandle
->
meta
,
0
);
code
=
metaGetTableEntryByUid
(
&
mr
,
pBlock
->
info
.
uid
);
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
pBlock
->
info
.
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
terrno
==
TSDB_CODE_PAR_TABLE_NOT_EXIST
)
{
qWarn
(
"failed to get table meta, table may have been dropped, uid:0x%"
PRIx64
", code:%s, %s"
,
pBlock
->
info
.
uid
,
...
...
@@ -508,7 +508,7 @@ int32_t addTagPseudoColumnData(SReadHandle* pHandle, const SExprInfo* pExpr, int
h
=
taosLRUCacheLookup
(
pCache
->
pTableMetaEntryCache
,
&
pBlock
->
info
.
uid
,
sizeof
(
pBlock
->
info
.
uid
));
if
(
h
==
NULL
)
{
metaReaderInit
(
&
mr
,
pHandle
->
meta
,
0
);
code
=
metaGetTableEntryByUid
(
&
mr
,
pBlock
->
info
.
uid
);
code
=
metaGetTableEntryByUid
Cache
(
&
mr
,
pBlock
->
info
.
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
terrno
==
TSDB_CODE_PAR_TABLE_NOT_EXIST
)
{
qWarn
(
"failed to get table meta, table may have been dropped, uid:0x%"
PRIx64
", code:%s, %s"
,
...
...
source/libs/executor/src/sysscanoperator.c
浏览文件 @
0948216c
...
...
@@ -441,6 +441,9 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
int32_t
code
=
metaGetTableEntryByName
(
&
smrChildTable
,
condTableName
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// terrno has been set by metaGetTableEntryByName, therefore, return directly
metaReaderClear
(
&
smrChildTable
);
blockDataDestroy
(
dataBlock
);
pInfo
->
loadInfo
.
totalRows
=
0
;
return
NULL
;
}
...
...
@@ -456,12 +459,16 @@ static SSDataBlock* sysTableScanUserTags(SOperatorInfo* pOperator) {
code
=
metaGetTableEntryByUid
(
&
smrSuperTable
,
smrChildTable
.
me
.
ctbEntry
.
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// terrno has been set by metaGetTableEntryByUid
metaReaderClear
(
&
smrSuperTable
);
metaReaderClear
(
&
smrChildTable
);
blockDataDestroy
(
dataBlock
);
return
NULL
;
}
sysTableUserTagsFillOneTableTags
(
pInfo
,
&
smrSuperTable
,
&
smrChildTable
,
dbname
,
tableName
,
&
numOfRows
,
dataBlock
);
metaReaderClear
(
&
smrSuperTable
);
metaReaderClear
(
&
smrChildTable
);
if
(
numOfRows
>
0
)
{
relocateAndFilterSysTagsScanResult
(
pInfo
,
numOfRows
,
dataBlock
,
pOperator
->
exprSupp
.
pFilterInfo
);
numOfRows
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录