Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
e44cddde
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e44cddde
编写于
6月 24, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
6月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix hash join hang leads mem leak
上级
fe6e4016
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
6 deletion
+12
-6
src/sql/engine/basic/ob_chunk_datum_store.cpp
src/sql/engine/basic/ob_chunk_datum_store.cpp
+2
-2
src/sql/engine/basic/ob_chunk_datum_store.h
src/sql/engine/basic/ob_chunk_datum_store.h
+2
-2
src/sql/engine/join/ob_hash_join.cpp
src/sql/engine/join/ob_hash_join.cpp
+3
-0
src/sql/engine/join/ob_hash_join_op.cpp
src/sql/engine/join/ob_hash_join_op.cpp
+3
-1
src/sql/engine/join/ob_hash_join_op.h
src/sql/engine/join/ob_hash_join_op.h
+2
-1
未找到文件。
src/sql/engine/basic/ob_chunk_datum_store.cpp
浏览文件 @
e44cddde
...
...
@@ -831,7 +831,7 @@ int ObChunkDatumStore::add_row(const common::ObIArray<ObExpr*>& exprs, ObEvalCtx
if
(
NULL
==
cur_blk_
)
{
int64_t
min_buf_size
=
0
;
Block
*
new_blk
=
nullptr
;
if
(
OB_FAIL
(
Block
::
min_buf_size
(
exprs
,
*
ctx
,
min_buf_size
)))
{
if
(
OB_FAIL
(
Block
::
min_buf_size
(
exprs
,
row_extend_size_
,
*
ctx
,
min_buf_size
)))
{
}
else
if
(
OB_FAIL
(
alloc_block_buffer
(
new_blk
,
min_buf_size
,
false
)))
{
LOG_WARN
(
"alloc block failed"
,
K
(
ret
));
}
else
{
...
...
@@ -844,7 +844,7 @@ int ObChunkDatumStore::add_row(const common::ObIArray<ObExpr*>& exprs, ObEvalCtx
if
(
OB_FAIL
(
cur_blk_
->
append_row
(
exprs
,
ctx
,
cur_blk_buffer_
,
row_extend_size_
,
stored_row
)))
{
if
(
OB_BUF_NOT_ENOUGH
==
ret
)
{
int64_t
min_buf_size
=
0
;
if
(
OB_FAIL
(
Block
::
min_buf_size
(
exprs
,
*
ctx
,
min_buf_size
)))
{
if
(
OB_FAIL
(
Block
::
min_buf_size
(
exprs
,
row_extend_size_
,
*
ctx
,
min_buf_size
)))
{
}
else
if
(
OB_FAIL
(
switch_block
(
min_buf_size
)))
{
if
(
OB_EXCEED_MEM_LIMIT
!=
ret
)
{
LOG_WARN
(
"switch block failed"
,
K
(
ret
));
...
...
src/sql/engine/basic/ob_chunk_datum_store.h
浏览文件 @
e44cddde
...
...
@@ -307,14 +307,14 @@ public:
Block
()
:
magic_
(
0
),
blk_size_
(
0
),
rows_
(
0
)
{}
static
int
inline
min_buf_size
(
const
common
::
ObIArray
<
ObExpr
*>&
exprs
,
ObEvalCtx
&
ctx
,
int64_t
&
size
)
static
int
inline
min_buf_size
(
const
common
::
ObIArray
<
ObExpr
*>&
exprs
,
int64_t
row_extend_size
,
ObEvalCtx
&
ctx
,
int64_t
&
size
)
{
int
ret
=
OB_SUCCESS
;
size
=
0
;
if
(
OB_FAIL
(
row_store_size
(
exprs
,
ctx
,
size
)))
{
SQL_ENG_LOG
(
WARN
,
"failed to calc store row size"
,
K
(
ret
));
}
else
{
size
+=
BlockBuffer
::
HEAD_SIZE
+
sizeof
(
BlockBuffer
);
size
+=
BlockBuffer
::
HEAD_SIZE
+
sizeof
(
BlockBuffer
)
+
row_extend_size
;
}
return
ret
;
}
...
...
src/sql/engine/join/ob_hash_join.cpp
浏览文件 @
e44cddde
...
...
@@ -861,6 +861,7 @@ int64_t ObHashJoin::auto_calc_partition_count(int64_t input_size, int64_t min_ne
if
(
input_size
>
min_need_size
)
{
// one pass
int64_t
need_part_cnt
=
min_need_size
/
ObChunkRowStore
::
BLOCK_SIZE
;
need_part_cnt
=
max
(
0
,
need_part_cnt
);
while
(
partition_cnt
<
need_part_cnt
)
{
partition_cnt
<<=
1
;
}
...
...
@@ -868,6 +869,7 @@ int64_t ObHashJoin::auto_calc_partition_count(int64_t input_size, int64_t min_ne
// all in memory, use the least memory
int64_t
max_chunk_size
=
input_size
/
ObChunkRowStore
::
BLOCK_SIZE
;
int64_t
square_partition_cnt
=
partition_cnt
*
partition_cnt
;
max_chunk_size
=
max
(
0
,
max_chunk_size
);
while
(
square_partition_cnt
<
max_chunk_size
)
{
partition_cnt
<<=
1
;
square_partition_cnt
=
partition_cnt
*
partition_cnt
;
...
...
@@ -884,6 +886,7 @@ int64_t ObHashJoin::calc_partition_count(int64_t input_size, int64_t part_size,
{
int64_t
estimate_part_count
=
input_size
/
part_size
+
1
;
int64_t
partition_cnt
=
8
;
estimate_part_count
=
max
(
0
,
estimate_part_count
);
while
(
partition_cnt
<
estimate_part_count
)
{
partition_cnt
<<=
1
;
}
...
...
src/sql/engine/join/ob_hash_join_op.cpp
浏览文件 @
e44cddde
...
...
@@ -807,6 +807,7 @@ int64_t ObHashJoinOp::calc_partition_count(int64_t input_size, int64_t part_size
{
int64_t
estimate_part_count
=
input_size
/
part_size
+
1
;
int64_t
partition_cnt
=
8
;
estimate_part_count
=
max
(
0
,
estimate_part_count
);
while
(
partition_cnt
<
estimate_part_count
)
{
partition_cnt
<<=
1
;
}
...
...
@@ -825,6 +826,7 @@ int64_t ObHashJoinOp::calc_partition_count_by_cache_aware(
if
(
max_part_count
<
partition_cnt
)
{
partition_cnt
=
max_part_count
;
}
global_mem_bound_size
=
max
(
0
,
global_mem_bound_size
);
while
(
partition_cnt
*
PAGE_SIZE
>
global_mem_bound_size
)
{
partition_cnt
>>=
1
;
}
...
...
@@ -854,7 +856,7 @@ int ObHashJoinOp::get_max_memory_size(int64_t input_size)
const
int64_t
tenant_id
=
ctx_
.
get_my_session
()
->
get_effective_tenant_id
();
// default data memory size: 80%
int64_t
extra_memory_size
=
get_extra_memory_size
();
int64_t
memory_size
=
extra_memory_size
+
input_size
;
int64_t
memory_size
=
(
extra_memory_size
+
input_size
)
<
0
?
input_size
:
(
extra_memory_size
+
input_size
)
;
if
(
OB_FAIL
(
ObSqlWorkareaUtil
::
get_workarea_size
(
ObSqlWorkAreaType
::
HASH_WORK_AREA
,
tenant_id
,
hash_area_size
)))
{
LOG_WARN
(
"failed to get workarea size"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
FALSE_IT
(
remain_data_memory_size_
=
hash_area_size
*
80
/
100
))
{
...
...
src/sql/engine/join/ob_hash_join_op.h
浏览文件 @
e44cddde
...
...
@@ -554,9 +554,10 @@ private:
{
int64_t
row_count
=
profile_
.
get_row_count
();
int64_t
bucket_cnt
=
profile_
.
get_bucket_size
();
const
int64_t
DEFAULT_EXTRA_SIZE
=
2
*
1024
*
1024
;
int64_t
extra_memory_size
=
bucket_cnt
*
(
sizeof
(
HashTableCell
*
)
+
sizeof
(
uint8_t
));
extra_memory_size
+=
(
row_count
*
sizeof
(
HashTableCell
));
return
extra_memory_size
;
return
extra_memory_size
<
0
?
DEFAULT_EXTRA_SIZE
:
extra_memory_size
;
}
void
clean_nest_loop_chunk
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录