Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caoersss
oceanbase
提交
3427f970
O
oceanbase
项目概览
caoersss
/
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,发现更多精彩内容 >>
提交
3427f970
编写于
3月 15, 2022
作者:
L
LINxiansheng
提交者:
LINGuanRen
3月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bug 39784090: Its no effect when decrease the datafile_size
上级
a4d3ae7d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
0 deletion
+35
-0
.gitignore
.gitignore
+4
-0
src/sql/resolver/cmd/ob_alter_system_resolver.cpp
src/sql/resolver/cmd/ob_alter_system_resolver.cpp
+6
-0
src/storage/blocksstable/ob_store_file.cpp
src/storage/blocksstable/ob_store_file.cpp
+24
-0
src/storage/blocksstable/ob_store_file.h
src/storage/blocksstable/ob_store_file.h
+1
-0
未找到文件。
.gitignore
浏览文件 @
3427f970
...
@@ -106,3 +106,7 @@ cmake-build-release
...
@@ -106,3 +106,7 @@ cmake-build-release
###### OSX dir files
###### OSX dir files
.DS_Store
.DS_Store
###### Debug bin and configuration
tools/deploy/bin
tools/deploy/config2.py
src/sql/resolver/cmd/ob_alter_system_resolver.cpp
浏览文件 @
3427f970
...
@@ -2299,6 +2299,12 @@ int ObSetConfigResolver::check_param_valid(int64_t tenant_id, const ObString& na
...
@@ -2299,6 +2299,12 @@ int ObSetConfigResolver::check_param_valid(int64_t tenant_id, const ObString& na
}
}
#endif
#endif
}
}
else
if
(
0
==
name
.
case_compare
(
"datafile_size"
))
{
if
(
OB_FAIL
(
OB_STORE_FILE
.
validate_datafile_size
(
value
.
ptr
()))){
ret
=
OB_INVALID_CONFIG
;
LOG_WARN
(
"datafile_size is not valid"
,
K
(
ret
));
}
}
}
}
return
ret
;
return
ret
;
}
}
...
...
src/storage/blocksstable/ob_store_file.cpp
浏览文件 @
3427f970
...
@@ -1349,6 +1349,30 @@ int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new
...
@@ -1349,6 +1349,30 @@ int ObStoreFile::resize_file(const int64_t new_data_file_size, const int64_t new
return
ret
;
return
ret
;
}
}
int
ObStoreFile
::
validate_datafile_size
(
const
char
*
config_data_file_size
)
{
int
ret
=
OB_SUCCESS
;
if
(
OB_ISNULL
(
store_file_system_
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"The OB store file instance is not exist"
,
K
(
ret
));
}
else
{
bool
valid
=
false
;
int64_t
new_data_file_size
=
ObConfigCapacityParser
::
get
(
config_data_file_size
,
valid
);
if
(
!
valid
){
ret
=
OB_ERR_PARSE_SQL
;
LOG_USER_ERROR
(
OB_INVALID_CONFIG
,
"datafile_size can not be parsed"
);
}
else
{
const
int64_t
original_file_size
=
store_file_system_
->
get_total_data_size
();
if
(
new_data_file_size
<
original_file_size
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"datafile_size is smaller than the original configuration"
,
K
(
ret
));
LOG_USER_ERROR
(
OB_INVALID_CONFIG
,
"datafile_size can not be smaller than the original configuration"
);
}
}
}
return
ret
;
}
int
ObStoreFile
::
alloc_memory
(
const
int64_t
total_macro_block_cnt
,
uint32_t
*&
free_block_array
,
int
ObStoreFile
::
alloc_memory
(
const
int64_t
total_macro_block_cnt
,
uint32_t
*&
free_block_array
,
uint64_t
*&
macro_block_bitmap
,
ObSegmentArray
<
ObMacroBlockInfo
>&
macro_block_info_array
)
uint64_t
*&
macro_block_bitmap
,
ObSegmentArray
<
ObMacroBlockInfo
>&
macro_block_info_array
)
{
{
...
...
src/storage/blocksstable/ob_store_file.h
浏览文件 @
3427f970
...
@@ -361,6 +361,7 @@ public:
...
@@ -361,6 +361,7 @@ public:
int
drop_disk
(
const
common
::
ObString
&
diskgroup_name
,
const
common
::
ObString
&
alias_name
);
int
drop_disk
(
const
common
::
ObString
&
diskgroup_name
,
const
common
::
ObString
&
alias_name
);
int
is_free_block
(
const
int64_t
block_index
,
bool
&
is_free
);
int
is_free_block
(
const
int64_t
block_index
,
bool
&
is_free
);
int
resize_file
(
const
int64_t
new_data_file_size
,
const
int64_t
new_data_file_disk_percentage
);
int
resize_file
(
const
int64_t
new_data_file_size
,
const
int64_t
new_data_file_disk_percentage
);
int
validate_datafile_size
(
const
char
*
config_data_file_size
);
private:
private:
friend
class
ObStoreFileGCTask
;
friend
class
ObStoreFileGCTask
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录