Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
7122a4bf
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7122a4bf
编写于
9月 02, 2021
作者:
T
Tyshawn
提交者:
wangzelin.wzl
9月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Tmp.File] fix some memory leak issue.
上级
2cc75c49
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
5 deletion
+13
-5
src/storage/blocksstable/ob_tmp_file_cache.cpp
src/storage/blocksstable/ob_tmp_file_cache.cpp
+5
-2
src/storage/blocksstable/ob_tmp_file_store.cpp
src/storage/blocksstable/ob_tmp_file_store.cpp
+8
-3
未找到文件。
src/storage/blocksstable/ob_tmp_file_cache.cpp
浏览文件 @
7122a4bf
...
...
@@ -168,6 +168,9 @@ int ObTmpPageCache::prefetch(
}
}
}
if
(
OB_FAIL
(
ret
)
&&
OB_NOT_NULL
(
buf
))
{
allocator_
.
free
(
buf
);
}
}
return
ret
;
}
...
...
@@ -732,6 +735,8 @@ int ObTmpTenantMemBlockManager::free_macro_block(const int64_t block_id)
STORAGE_LOG
(
WARN
,
"invalid argument"
,
K
(
ret
),
K
(
block_id
));
}
else
if
(
OB_FAIL
(
t_mblk_map_
.
erase_refactored
(
block_id
)))
{
STORAGE_LOG
(
WARN
,
"fail to erase tmp macro block"
,
K
(
ret
));
}
else
{
free_page_nums_
-=
mblk_page_nums_
;
}
return
ret
;
}
...
...
@@ -959,12 +964,10 @@ int ObTmpTenantMemBlockManager::wash_with_no_wait(const uint64_t tenant_id, ObTm
}
else
if
(
NULL
==
wash_block
)
{
STORAGE_LOG
(
WARN
,
"The washing block is null"
,
K
(
ret
));
}
else
{
int64_t
free_page_nums
=
wash_block
->
get_free_page_nums
();
bool
is_all_close
=
false
;
if
(
OB_FAIL
(
wash_block
->
close
(
is_all_close
)))
{
STORAGE_LOG
(
WARN
,
"fail to close the wash block"
,
K
(
ret
));
}
else
if
(
is_all_close
)
{
free_page_nums_
=
free_page_nums_
+
wash_block
->
get_free_page_nums
()
-
free_page_nums
;
if
(
wash_block
->
is_empty
())
{
// this block don't need to wash.
if
(
OB_FAIL
(
refresh_dir_to_blk_map
(
wash_block
->
get_dir_id
(),
wash_block
)))
{
...
...
src/storage/blocksstable/ob_tmp_file_store.cpp
浏览文件 @
7122a4bf
...
...
@@ -564,11 +564,11 @@ int ObTmpTenantMacroBlockManager::alloc_macro_block(
if
(
OB_FAIL
(
ret
))
{
if
(
NULL
!=
t_mblk
)
{
int
tmp_ret
=
OB_SUCCESS
;
t_mblk
->~
ObTmpMacroBlock
();
allocator_
->
free
(
block_buf
);
if
(
OB_SUCCESS
!=
(
tmp_ret
=
blocks_
.
erase_refactored
(
t_mblk
->
get_block_id
())))
{
STORAGE_LOG
(
WARN
,
"fail to erase from tmp macro block map"
,
K
(
tmp_ret
),
K
(
t_mblk
));
}
t_mblk
->~
ObTmpMacroBlock
();
allocator_
->
free
(
block_buf
);
}
}
return
ret
;
...
...
@@ -953,6 +953,7 @@ int ObTmpTenantFileStore::free_macro_block(ObTmpMacroBlock*& t_mblk)
int
ObTmpTenantFileStore
::
alloc_macro_block
(
const
int64_t
dir_id
,
const
uint64_t
tenant_id
,
ObTmpMacroBlock
*&
t_mblk
)
{
int
ret
=
OB_SUCCESS
;
t_mblk
=
nullptr
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
STORAGE_LOG
(
WARN
,
"ObTmpMacroBlockManager has not been inited"
,
K
(
ret
));
...
...
@@ -973,7 +974,11 @@ int ObTmpTenantFileStore::alloc_macro_block(const int64_t dir_id, const uint64_t
t_mblk
->
give_back_buf_into_cache
();
}
}
if
(
OB_FAIL
(
ret
)
&&
OB_NOT_NULL
(
t_mblk
))
{
allocator_
.
free
(
t_mblk
);
}
}
return
ret
;
}
...
...
@@ -1266,7 +1271,7 @@ int ObTmpFileStore::free_tenant_file_store(const uint64_t tenant_id)
}
}
else
if
(
OB_ISNULL
(
store
))
{
ret
=
OB_ERR_UNEXPECTED
;
STORAGE_LOG
(
WARN
,
"unex
cep
ted error, store is null"
,
K
(
ret
));
STORAGE_LOG
(
WARN
,
"unex
pec
ted error, store is null"
,
K
(
ret
));
}
else
{
store
->~
ObTmpTenantFileStore
();
allocator_
.
free
(
store
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录