Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
528a51f7
O
oceanbase
项目概览
clmforever
/
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 搜索 >>
提交
528a51f7
编写于
3月 02, 2023
作者:
S
saltonz
提交者:
ob-robot
3月 02, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[bugfix ] fix encoding under estimate upper store size for var-length data
上级
08a372ab
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
1 deletion
+22
-1
src/storage/blocksstable/encoding/ob_encoding_util.h
src/storage/blocksstable/encoding/ob_encoding_util.h
+6
-0
src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp
src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp
+16
-1
未找到文件。
src/storage/blocksstable/encoding/ob_encoding_util.h
浏览文件 @
528a51f7
...
...
@@ -82,6 +82,12 @@ OB_INLINE bool store_class_might_contain_lob_locator(const ObObjTypeStoreClass s
return
(
sc
==
ObTextSC
||
sc
==
ObLobSC
||
sc
==
ObJsonSC
||
sc
==
ObGeometrySC
);
}
OB_INLINE
bool
is_var_length_type
(
const
ObObjTypeStoreClass
sc
)
{
return
(
sc
==
ObNumberSC
||
sc
==
ObStringSC
||
sc
==
ObTextSC
||
sc
==
ObLobSC
||
sc
==
ObJsonSC
||
sc
==
ObGeometrySC
);
}
OB_INLINE
ObObjTypeStoreClass
*
get_store_class_map
()
{
static
ObObjTypeStoreClass
store_class_map
[]
=
{
...
...
src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp
浏览文件 @
528a51f7
...
...
@@ -994,6 +994,13 @@ int ObMicroBlockEncoder::copy_cell(
LOG_WARN
(
"unsupported store extend datum type"
,
K
(
ret
),
K
(
src
));
}
else
{
datum_size
=
is_int_sc
?
sizeof
(
uint64_t
)
:
dest
.
len_
;
if
(
ctx_
.
major_working_cluster_version_
>=
DATA_VERSION_4_1_0_0
)
{
if
(
is_var_length_type
(
store_class
))
{
// For var-length type column, we need to add extra 8 bytes for estimate safety
// e.g: ref size for dictionary, meta data for encoding etc.
datum_size
+=
sizeof
(
uint64_t
);
}
}
}
if
(
OB_FAIL
(
ret
))
{
...
...
@@ -1024,6 +1031,7 @@ int ObMicroBlockEncoder::process_large_row(
// store_size represents for the serialized data size on disk,
const
int64_t
datums_len
=
sizeof
(
ObDatum
)
*
src
.
get_column_count
();
int64_t
copy_size
=
datums_len
;
int64_t
var_len_column_cnt
=
0
;
for
(
int64_t
col_idx
=
0
;
col_idx
<
src
.
get_column_count
();
++
col_idx
)
{
const
ObColDesc
&
col_desc
=
ctx_
.
col_descs_
->
at
(
col_idx
);
ObObjTypeStoreClass
store_class
=
get_store_class_map
()[
col_desc
.
col_type_
.
get_type_class
()];
...
...
@@ -1033,12 +1041,19 @@ int ObMicroBlockEncoder::process_large_row(
copy_size
+=
sizeof
(
uint64_t
);
}
else
{
copy_size
+=
datum
.
len_
;
if
(
is_var_length_type
(
store_class
))
{
++
var_len_column_cnt
;
}
}
}
else
{
copy_size
+=
sizeof
(
uint64_t
);
}
}
store_size
=
copy_size
-
datums_len
;
if
(
ctx_
.
major_working_cluster_version_
>=
DATA_VERSION_4_1_0_0
)
{
store_size
=
copy_size
-
datums_len
+
var_len_column_cnt
*
sizeof
(
uint64_t
);
}
else
{
store_size
=
copy_size
-
datums_len
;
}
if
(
OB_FAIL
(
row_buf_holder_
.
try_alloc
(
copy_size
)))
{
LOG_WARN
(
"Fail to alloc large row buffer"
,
K
(
ret
),
K
(
copy_size
));
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录