Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
df950055
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看板
提交
df950055
编写于
11月 11, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix tablemeta leak
上级
7af24443
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
13 deletion
+20
-13
source/libs/catalog/src/ctgAsync.c
source/libs/catalog/src/ctgAsync.c
+2
-1
source/libs/catalog/src/ctgCache.c
source/libs/catalog/src/ctgCache.c
+18
-12
未找到文件。
source/libs/catalog/src/ctgAsync.c
浏览文件 @
df950055
...
...
@@ -1204,11 +1204,12 @@ int32_t ctgHandleGetTbMetasRsp(SCtgTaskReq* tReq, int32_t reqType, const SDataBu
stbCtx
.
flag
=
flag
;
stbCtx
.
pName
=
&
stbName
;
STableMeta
*
stbMeta
=
NULL
;
STableMeta
*
stbMeta
=
NULL
;
ctgReadTbMetaFromCache
(
pCtg
,
&
stbCtx
,
&
stbMeta
);
if
(
stbMeta
&&
stbMeta
->
sversion
>=
pOut
->
tbMeta
->
sversion
)
{
ctgDebug
(
"use cached stb meta, tbName:%s"
,
tNameGetTableName
(
pName
));
exist
=
1
;
taosMemoryFreeClear
(
stbMeta
);
}
else
{
ctgDebug
(
"need to get/update stb meta, tbName:%s"
,
tNameGetTableName
(
pName
));
taosMemoryFreeClear
(
pOut
->
tbMeta
);
...
...
source/libs/catalog/src/ctgCache.c
浏览文件 @
df950055
...
...
@@ -72,8 +72,8 @@ void ctgRUnlockVgInfo(SCtgDBCache *dbCache) { CTG_UNLOCK(CTG_READ, &dbCache->vgC
void
ctgWUnlockVgInfo
(
SCtgDBCache
*
dbCache
)
{
CTG_UNLOCK
(
CTG_WRITE
,
&
dbCache
->
vgCache
.
vgLock
);
}
void
ctgReleaseDBCache
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
)
{
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
dbLock
);
void
ctgReleaseDBCache
(
SCatalog
*
pCtg
,
SCtgDBCache
*
dbCache
)
{
CTG_UNLOCK
(
CTG_READ
,
&
dbCache
->
dbLock
);
taosHashRelease
(
pCtg
->
dbCache
,
dbCache
);
}
...
...
@@ -90,7 +90,7 @@ int32_t ctgAcquireDBCacheImpl(SCatalog *pCtg, const char *dbFName, SCtgDBCache *
}
else
{
dbCache
=
(
SCtgDBCache
*
)
taosHashGet
(
pCtg
->
dbCache
,
dbFName
,
strlen
(
dbFName
));
}
if
(
NULL
==
dbCache
)
{
*
pCache
=
NULL
;
ctgDebug
(
"db not in cache, dbFName:%s"
,
dbFName
);
...
...
@@ -422,6 +422,7 @@ _return:
ctgReleaseTbMetaToCache
(
pCtg
,
dbCache
,
tbCache
);
taosMemoryFreeClear
(
*
pTableMeta
);
*
pTableMeta
=
NULL
;
CTG_RET
(
code
);
}
...
...
@@ -1436,7 +1437,7 @@ int32_t ctgWriteTbMetaToCache(SCatalog *pCtg, SCtgDBCache *dbCache, char *dbFNam
if
(
pCache
)
{
CTG_ERR_RET
(
ctgUpdateRentStbVersion
(
pCtg
,
dbFName
,
tbName
,
dbId
,
meta
->
suid
,
pCache
));
}
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1565,7 +1566,8 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
}
bool
newAdded
=
false
;
SDbVgVersion
vgVersion
=
{.
dbId
=
msg
->
dbId
,
.
vgVersion
=
dbInfo
->
vgVersion
,
.
numOfTable
=
dbInfo
->
numOfTable
,
.
stateTs
=
dbInfo
->
stateTs
};
SDbVgVersion
vgVersion
=
{
.
dbId
=
msg
->
dbId
,
.
vgVersion
=
dbInfo
->
vgVersion
,
.
numOfTable
=
dbInfo
->
numOfTable
,
.
stateTs
=
dbInfo
->
stateTs
};
SCtgDBCache
*
dbCache
=
NULL
;
CTG_ERR_JRET
(
ctgGetAddDBCache
(
msg
->
pCtg
,
dbFName
,
msg
->
dbId
,
&
dbCache
));
...
...
@@ -1581,15 +1583,17 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
SDBVgInfo
*
vgInfo
=
vgCache
->
vgInfo
;
if
(
dbInfo
->
vgVersion
<
vgInfo
->
vgVersion
)
{
ctgDebug
(
"db updateVgroup is ignored, dbFName:%s, vgVer:%d, curVer:%d"
,
dbFName
,
dbInfo
->
vgVersion
,
vgInfo
->
vgVersion
);
ctgDebug
(
"db updateVgroup is ignored, dbFName:%s, vgVer:%d, curVer:%d"
,
dbFName
,
dbInfo
->
vgVersion
,
vgInfo
->
vgVersion
);
ctgWUnlockVgInfo
(
dbCache
);
goto
_return
;
}
if
(
dbInfo
->
vgVersion
==
vgInfo
->
vgVersion
&&
dbInfo
->
numOfTable
==
vgInfo
->
numOfTable
&&
dbInfo
->
stateTs
==
vgInfo
->
stateTs
)
{
ctgDebug
(
"no new db vgroup update info, dbFName:%s, vgVer:%d, numOfTable:%d, stateTs:%"
PRId64
,
dbFName
,
dbInfo
->
vgVersion
,
dbInfo
->
numOfTable
,
dbInfo
->
stateTs
);
if
(
dbInfo
->
vgVersion
==
vgInfo
->
vgVersion
&&
dbInfo
->
numOfTable
==
vgInfo
->
numOfTable
&&
dbInfo
->
stateTs
==
vgInfo
->
stateTs
)
{
ctgDebug
(
"no new db vgroup update info, dbFName:%s, vgVer:%d, numOfTable:%d, stateTs:%"
PRId64
,
dbFName
,
dbInfo
->
vgVersion
,
dbInfo
->
numOfTable
,
dbInfo
->
stateTs
);
ctgWUnlockVgInfo
(
dbCache
);
goto
_return
;
...
...
@@ -1601,7 +1605,8 @@ int32_t ctgOpUpdateVgroup(SCtgCacheOperation *operation) {
vgCache
->
vgInfo
=
dbInfo
;
msg
->
dbInfo
=
NULL
;
ctgDebug
(
"db vgInfo updated, dbFName:%s, vgVer:%d, stateTs:%"
PRId64
", dbId:0x%"
PRIx64
,
dbFName
,
vgVersion
.
vgVersion
,
vgVersion
.
stateTs
,
vgVersion
.
dbId
);
ctgDebug
(
"db vgInfo updated, dbFName:%s, vgVer:%d, stateTs:%"
PRId64
", dbId:0x%"
PRIx64
,
dbFName
,
vgVersion
.
vgVersion
,
vgVersion
.
stateTs
,
vgVersion
.
dbId
);
ctgWUnlockVgInfo
(
dbCache
);
...
...
@@ -1692,7 +1697,7 @@ int32_t ctgOpUpdateTbMeta(SCtgCacheOperation *operation) {
if
(
pCtg
->
stopUpdate
)
{
goto
_return
;
}
if
((
!
CTG_IS_META_CTABLE
(
pMeta
->
metaType
))
&&
NULL
==
pMeta
->
tbMeta
)
{
ctgError
(
"no valid tbmeta got from meta rsp, dbFName:%s, tbName:%s"
,
pMeta
->
dbFName
,
pMeta
->
tbName
);
CTG_ERR_JRET
(
TSDB_CODE_CTG_INTERNAL_ERROR
);
...
...
@@ -1902,7 +1907,7 @@ int32_t ctgOpUpdateEpset(SCtgCacheOperation *operation) {
int32_t
code
=
0
;
SCtgUpdateEpsetMsg
*
msg
=
operation
->
data
;
SCatalog
*
pCtg
=
msg
->
pCtg
;
SCtgDBCache
*
dbCache
=
NULL
;
SCtgDBCache
*
dbCache
=
NULL
;
if
(
pCtg
->
stopUpdate
)
{
goto
_return
;
...
...
@@ -2209,6 +2214,7 @@ int32_t ctgGetTbMetaFromCache(SCatalog *pCtg, SCtgTbMetaCtx *ctx, STableMeta **p
}
taosMemoryFreeClear
(
*
pTableMeta
);
*
pTableMeta
=
NULL
;
}
if
(
CTG_FLAG_IS_UNKNOWN_STB
(
ctx
->
flag
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录