Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
kp22424
oceanbase
提交
36af412e
O
oceanbase
项目概览
kp22424
/
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,体验更适合开发者的 AI 搜索 >>
提交
36af412e
编写于
12月 20, 2021
作者:
T
Tyshawn
提交者:
LINGuanRen
12月 20, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BUGFIX] fix sstable double free both gc by iter and gc by queue.
上级
18de895d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
3 deletion
+20
-3
src/storage/ob_pg_sstable_garbage_collector.cpp
src/storage/ob_pg_sstable_garbage_collector.cpp
+13
-0
src/storage/ob_sstable.cpp
src/storage/ob_sstable.cpp
+7
-3
未找到文件。
src/storage/ob_pg_sstable_garbage_collector.cpp
浏览文件 @
36af412e
...
...
@@ -103,6 +103,19 @@ int ObPGSSTableGarbageCollector::gc_free_sstable_by_pg_iter()
left_recycle_cnt
-=
recycle_cnt
;
}
}
if
(
OB_SUCC
(
ret
))
{
while
(
OB_SUCC
(
ret
)
&&
free_sstables_queue_
.
size
()
>
0
)
{
ObLink
*
ptr
=
NULL
;
if
(
OB_FAIL
(
free_sstables_queue_
.
pop
(
ptr
)))
{
LOG_WARN
(
"fail to pop item"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
ptr
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"unexpected error, ptr is nullptr"
,
K
(
ret
),
KP
(
ptr
));
}
else
{
free_sstable_gc_item
(
static_cast
<
ObSSTableGCItem
*>
(
ptr
));
}
}
}
}
if
(
nullptr
!=
partition_iter
)
{
ObPartitionService
::
get_instance
().
revert_pg_iter
(
partition_iter
);
...
...
src/storage/ob_sstable.cpp
浏览文件 @
36af412e
...
...
@@ -3203,15 +3203,19 @@ int ObSSTable::add_macro_ref()
int64_t
ObSSTable
::
dec_ref
()
{
int64_t
ref_cnt
=
ATOMIC_SAF
(
&
ref_cnt_
,
1
/* just sub 1 */
);
if
(
0
==
ref_cnt
)
{
// If current ref_cnt is 1, it should be pushed into gc queue firstly. Then, decrease reference
// counts. The reason is that gc by iter may be faster than gc by queue.
if
(
1
==
get_ref
()
)
{
int
ret
=
OB_SUCCESS
;
if
(
OB_FAIL
(
ObPGSSTableGarbageCollector
::
get_instance
().
push_sstable_into_gc_queue
(
key_
)))
{
LOG_WARN
(
"fail to push sstable into gc queue"
,
K
(
ret
),
K
(
key_
));
}
}
int64_t
ref_cnt
=
ATOMIC_SAF
(
&
ref_cnt_
,
1
/* just sub 1 */
);
if
(
OB_UNLIKELY
(
ref_cnt
<
0
))
{
LOG_ERROR
(
"Unexpected ref cnt of sstable"
,
K
(
ref_cnt
),
K
(
key_
));
}
return
ref_cnt
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录