Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
5456ef83
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看板
提交
5456ef83
编写于
6月 12, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
6月 12, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bugfix: fix dead lock in extend_file_size_task process
上级
dccc4431
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
3 deletion
+7
-3
src/storage/blocksstable/ob_store_file.cpp
src/storage/blocksstable/ob_store_file.cpp
+6
-3
src/storage/blocksstable/ob_store_file.h
src/storage/blocksstable/ob_store_file.h
+1
-0
未找到文件。
src/storage/blocksstable/ob_store_file.cpp
浏览文件 @
5456ef83
...
@@ -430,7 +430,8 @@ ObStoreFile::ObStoreFile()
...
@@ -430,7 +430,8 @@ ObStoreFile::ObStoreFile()
cond_
(),
cond_
(),
is_fs_support_punch_hole_
(
true
),
is_fs_support_punch_hole_
(
true
),
block_file_fd_
(
OB_INVALID_FD
),
block_file_fd_
(
OB_INVALID_FD
),
alloc_lock_
()
alloc_lock_
(),
resize_file_lock_
()
{
{
MEMSET
(
used_macro_cnt_
,
0
,
sizeof
(
used_macro_cnt_
));
MEMSET
(
used_macro_cnt_
,
0
,
sizeof
(
used_macro_cnt_
));
}
}
...
@@ -1180,7 +1181,7 @@ int ObStoreFile::mark_macro_blocks()
...
@@ -1180,7 +1181,7 @@ int ObStoreFile::mark_macro_blocks()
// should lock before using to protect free_block_cnt_ opt
// should lock before using to protect free_block_cnt_ opt
int
ObStoreFile
::
extend_file_size_task
()
int
ObStoreFile
::
extend_file_size_task
()
{
{
lib
::
ObMutexGuard
guard
(
block_lock_
);
// lock block info updat
e opt
lib
::
ObMutexGuard
guard
(
resize_file_lock_
);
// lock resize fil
e opt
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
if
(
OB_ISNULL
(
store_file_system_
))
{
if
(
OB_ISNULL
(
store_file_system_
))
{
}
else
{
}
else
{
...
@@ -1204,6 +1205,7 @@ int ObStoreFile::extend_file_size_task()
...
@@ -1204,6 +1205,7 @@ int ObStoreFile::extend_file_size_task()
if
(
OB_FAIL
(
wait_mark_sweep_finish
()))
{
if
(
OB_FAIL
(
wait_mark_sweep_finish
()))
{
LOG_WARN
(
"fail to wait mark and sweep finish"
,
K
(
ret
));
LOG_WARN
(
"fail to wait mark and sweep finish"
,
K
(
ret
));
}
else
{
}
else
{
lib
::
ObMutexGuard
guard
(
block_lock_
);
// lock block info update opt
bool
is_extend_size
=
false
;
bool
is_extend_size
=
false
;
int64_t
total_block_cnt
=
store_file_system_
->
get_total_macro_block_count
();
int64_t
total_block_cnt
=
store_file_system_
->
get_total_macro_block_count
();
int64_t
free_block_cnt_to_extend
=
int64_t
free_block_cnt_to_extend
=
...
@@ -1543,11 +1545,12 @@ int ObStoreFile::resize_file(
...
@@ -1543,11 +1545,12 @@ int ObStoreFile::resize_file(
if
(
OB_ISNULL
(
store_file_system_
))
{
if
(
OB_ISNULL
(
store_file_system_
))
{
LOG_DEBUG
(
"Do resize file fail, store_file_system_ is null pointer"
);
LOG_DEBUG
(
"Do resize file fail, store_file_system_ is null pointer"
);
}
else
{
}
else
{
lib
::
ObMutexGuard
guard
(
block
_lock_
);
lib
::
ObMutexGuard
guard
(
resize_file
_lock_
);
disable_mark_sweep
();
disable_mark_sweep
();
if
(
OB_FAIL
(
wait_mark_sweep_finish
()))
{
if
(
OB_FAIL
(
wait_mark_sweep_finish
()))
{
LOG_WARN
(
"fail to wait mark and sweep finish"
,
K
(
ret
));
LOG_WARN
(
"fail to wait mark and sweep finish"
,
K
(
ret
));
}
else
{
}
else
{
lib
::
ObMutexGuard
guard
(
block_lock_
);
if
(
OB_FAIL
(
store_file_system_
->
resize_file
(
new_data_file_size
,
new_data_file_disk_percentage
)))
{
if
(
OB_FAIL
(
store_file_system_
->
resize_file
(
new_data_file_size
,
new_data_file_disk_percentage
)))
{
LOG_WARN
(
"fail to resize file"
,
K
(
ret
));
LOG_WARN
(
"fail to resize file"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
refresh_block_meta
()))
{
}
else
if
(
OB_FAIL
(
refresh_block_meta
()))
{
...
...
src/storage/blocksstable/ob_store_file.h
浏览文件 @
5456ef83
...
@@ -445,6 +445,7 @@ private:
...
@@ -445,6 +445,7 @@ private:
bool
is_fs_support_punch_hole_
;
bool
is_fs_support_punch_hole_
;
int
block_file_fd_
;
int
block_file_fd_
;
lib
::
ObMutex
alloc_lock_
;
lib
::
ObMutex
alloc_lock_
;
lib
::
ObMutex
resize_file_lock_
;
};
};
OB_INLINE
bool
ObStoreFile
::
is_valid
(
const
MacroBlockId
macro_id
)
OB_INLINE
bool
ObStoreFile
::
is_valid
(
const
MacroBlockId
macro_id
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录