提交 d1a8226c 编写于 作者: C cd 提交者: MizuhaHimuraki

fix resize file

上级 03001c1f
...@@ -1262,13 +1262,14 @@ void ObStoreFile::set_mark_sweep_done() ...@@ -1262,13 +1262,14 @@ void ObStoreFile::set_mark_sweep_done()
int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new_data_file_disk_percentage) int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new_data_file_disk_percentage)
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
lib::ObMutexGuard guard(block_lock_);
disable_mark_sweep(); disable_mark_sweep();
if (OB_ISNULL(store_file_system_)) { if (OB_ISNULL(store_file_system_)) {
// do nothing // do nothing
} else if (OB_FAIL(wait_mark_sweep_finish())) { } else 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 if (OB_FAIL(store_file_system_->resize_file(new_data_file_size, new_data_file_disk_percentage))) { } else {
lib::ObMutexGuard guard(block_lock_);
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 { } else {
const int64_t new_total_file_size = const int64_t new_total_file_size =
...@@ -1324,6 +1325,7 @@ int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new ...@@ -1324,6 +1325,7 @@ int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new
} }
} }
} }
}
enable_mark_sweep(); enable_mark_sweep();
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册