Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
10799a59
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,发现更多精彩内容 >>
提交
10799a59
编写于
8月 19, 2021
作者:
T
Tyshawn
提交者:
wangzelin.wzl
8月 19, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Tmp.File] fix prefetch handle issue
上级
88a8862b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
23 deletion
+21
-23
src/storage/blocksstable/ob_tmp_file.h
src/storage/blocksstable/ob_tmp_file.h
+2
-2
src/storage/blocksstable/ob_tmp_file_cache.cpp
src/storage/blocksstable/ob_tmp_file_cache.cpp
+9
-10
src/storage/blocksstable/ob_tmp_file_cache.h
src/storage/blocksstable/ob_tmp_file_cache.h
+8
-9
src/storage/blocksstable/ob_tmp_file_store.cpp
src/storage/blocksstable/ob_tmp_file_store.cpp
+2
-2
未找到文件。
src/storage/blocksstable/ob_tmp_file.h
浏览文件 @
10799a59
...
...
@@ -374,7 +374,7 @@ private:
:
tenant_id_
(
tenant_id
),
fd_list_
(
fd_list
)
{}
~
RmTenantTmpFileOp
()
=
default
;
bool
operator
()(
common
::
hash
::
HashMapPair
<
int64_t
,
ObTmpFile
*>&
entry
)
int
operator
()(
common
::
hash
::
HashMapPair
<
int64_t
,
ObTmpFile
*>
&
entry
)
{
int
ret
=
OB_SUCCESS
;
ObTmpFile
*
tmp_file
=
entry
.
second
;
...
...
@@ -386,7 +386,7 @@ private:
STORAGE_LOG
(
WARN
,
"fd_list_ push back failed"
,
K
(
ret
));
}
}
return
OB_SUCCESS
==
ret
;
return
ret
;
}
private:
...
...
src/storage/blocksstable/ob_tmp_file_cache.cpp
浏览文件 @
10799a59
...
...
@@ -103,13 +103,12 @@ int ObTmpPageCacheValue::deep_copy(char* buf, const int64_t buf_len, ObIKVCacheV
return
ret
;
}
int
ObTmpPageCache
::
prefetch
(
const
ObTmpPageCacheKey
&
key
,
const
ObTmpBlockIOInfo
&
info
,
ObTmpFileIOHandle
&
handle
,
ObMacroBlockHandle
&
mb_handle
)
int
ObTmpPageCache
::
prefetch
(
const
ObTmpPageCacheKey
&
key
,
const
ObTmpBlockIOInfo
&
info
,
ObMacroBlockHandle
&
mb_handle
)
{
int
ret
=
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
!
key
.
is_valid
()
||
!
handle
.
is_valid
()
))
{
if
(
OB_UNLIKELY
(
!
key
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
STORAGE_LOG
(
WARN
,
"Invalid arguments"
,
K
(
ret
),
K
(
key
)
,
K
(
handle
)
);
STORAGE_LOG
(
WARN
,
"Invalid arguments"
,
K
(
ret
),
K
(
key
));
}
else
{
// fill the callback
ObTmpPageIOCallback
callback
;
...
...
@@ -122,7 +121,7 @@ int ObTmpPageCache::prefetch(const ObTmpPageCacheKey& key, const ObTmpBlockIOInf
if
(
mb_handle
.
get_io_handle
().
is_empty
())
{
// TODO: After the continuous IO has been optimized, this should
// not happen.
if
(
OB_FAIL
(
handle
.
wait
(
DEFAULT_IO_WAIT_TIME_MS
)))
{
if
(
OB_FAIL
(
mb_
handle
.
wait
(
DEFAULT_IO_WAIT_TIME_MS
)))
{
STORAGE_LOG
(
WARN
,
"fail to wait tmp page io"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
read_io
(
info
,
callback
,
mb_handle
)))
{
STORAGE_LOG
(
WARN
,
"fail to read tmp page from io"
,
K
(
ret
));
...
...
@@ -135,13 +134,13 @@ int ObTmpPageCache::prefetch(const ObTmpPageCacheKey& key, const ObTmpBlockIOInf
return
ret
;
}
int
ObTmpPageCache
::
prefetch
(
const
ObTmpBlockIOInfo
&
info
,
const
common
::
ObIArray
<
ObTmpPageIOInfo
>&
page_io_infos
,
ObTmpFileIOHandle
&
handle
,
ObMacroBlockHandle
&
mb_handle
)
int
ObTmpPageCache
::
prefetch
(
const
ObTmpBlockIOInfo
&
info
,
const
common
::
ObIArray
<
ObTmpPageIOInfo
>
&
page_io_infos
,
ObMacroBlockHandle
&
mb_handle
)
{
int
ret
=
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
page_io_infos
.
count
()
<=
0
||
!
handle
.
is_valid
()
))
{
if
(
OB_UNLIKELY
(
page_io_infos
.
count
()
<=
0
))
{
ret
=
OB_INVALID_ARGUMENT
;
STORAGE_LOG
(
WARN
,
"Invalid arguments"
,
K
(
ret
),
K
(
page_io_infos
.
count
()),
K
(
info
)
,
K
(
handle
)
);
STORAGE_LOG
(
WARN
,
"Invalid arguments"
,
K
(
ret
),
K
(
page_io_infos
.
count
()),
K
(
info
));
}
else
{
ObTmpMultiPageIOCallback
callback
;
callback
.
cache_
=
this
;
...
...
@@ -159,7 +158,7 @@ int ObTmpPageCache::prefetch(const ObTmpBlockIOInfo& info, const common::ObIArra
if
(
mb_handle
.
get_io_handle
().
is_empty
())
{
// TODO: After the continuous IO has been optimized, this should
// not happen.
if
(
OB_FAIL
(
handle
.
wait
(
DEFAULT_IO_WAIT_TIME_MS
)))
{
if
(
OB_FAIL
(
mb_
handle
.
wait
(
DEFAULT_IO_WAIT_TIME_MS
)))
{
STORAGE_LOG
(
WARN
,
"fail to wait tmp page io"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
read_io
(
info
,
callback
,
mb_handle
)))
{
STORAGE_LOG
(
WARN
,
"fail to read tmp page from io"
,
K
(
ret
));
...
...
src/storage/blocksstable/ob_tmp_file_cache.h
浏览文件 @
10799a59
...
...
@@ -108,16 +108,15 @@ public:
class
ObTmpPageCache
:
public
common
::
ObKVCache
<
ObTmpPageCacheKey
,
ObTmpPageCacheValue
>
{
public:
typedef
common
::
ObKVCache
<
ObTmpPageCacheKey
,
ObTmpPageCacheValue
>
BasePageCache
;
static
ObTmpPageCache
&
get_instance
();
int
init
(
const
char
*
cache_name
,
const
int64_t
priority
,
const
ObStorageFileHandle
&
file_handle
);
int
prefetch
(
const
ObTmpPageCacheKey
&
key
,
const
ObTmpBlockIOInfo
&
info
,
ObTmpFileIOHandle
&
handle
,
ObMacroBlockHandle
&
mb_handle
);
static
ObTmpPageCache
&
get_instance
();
int
init
(
const
char
*
cache_name
,
const
int64_t
priority
,
const
ObStorageFileHandle
&
file_handle
);
int
prefetch
(
const
ObTmpPageCacheKey
&
key
,
const
ObTmpBlockIOInfo
&
info
,
ObMacroBlockHandle
&
mb_handle
);
// multi page prefetch
int
prefetch
(
const
ObTmpBlockIOInfo
&
info
,
const
common
::
ObIArray
<
ObTmpPageIOInfo
>&
page_io_infos
,
Ob
TmpFileIOHandle
&
handle
,
ObMacroBlockHandle
&
mb_handle
);
int
get_cache_page
(
const
ObTmpPageCacheKey
&
key
,
ObTmpPageValueHandle
&
handle
);
int
get_page
(
const
ObTmpPageCacheKey
&
key
,
ObTmpPageValueHandle
&
handle
);
int
put_page
(
const
ObTmpPageCacheKey
&
key
,
const
ObTmpPageCacheValue
&
value
);
int
prefetch
(
const
ObTmpBlockIOInfo
&
info
,
const
common
::
ObIArray
<
ObTmpPageIOInfo
>
&
page_io_infos
,
Ob
MacroBlockHandle
&
mb_handle
);
int
get_cache_page
(
const
ObTmpPageCacheKey
&
key
,
ObTmpPageValueHandle
&
handle
);
int
get_page
(
const
ObTmpPageCacheKey
&
key
,
ObTmpPageValueHandle
&
handle
);
int
put_page
(
const
ObTmpPageCacheKey
&
key
,
const
ObTmpPageCacheValue
&
value
);
void
destroy
();
public:
...
...
src/storage/blocksstable/ob_tmp_file_store.cpp
浏览文件 @
10799a59
...
...
@@ -1059,7 +1059,7 @@ int ObTmpTenantFileStore::read_page(ObTmpMacroBlock* block, ObTmpBlockIOInfo& io
info
.
offset_
=
common
::
lower_align
(
io_info
.
offset_
,
ObTmpMacroBlock
::
get_default_page_size
());
info
.
size_
=
page_nums
*
ObTmpMacroBlock
::
get_default_page_size
();
info
.
macro_block_id_
=
block
->
get_macro_block_id
();
if
(
OB_FAIL
(
page_cache_
->
prefetch
(
info
,
page_io_infos
,
handle
,
mb_handle
)))
{
if
(
OB_FAIL
(
page_cache_
->
prefetch
(
info
,
page_io_infos
,
mb_handle
)))
{
STORAGE_LOG
(
WARN
,
"fail to prefetch multi tmp page"
,
K
(
ret
));
}
else
{
ObTmpFileIOHandle
::
ObIOReadHandle
read_handle
(
...
...
@@ -1076,7 +1076,7 @@ int ObTmpTenantFileStore::read_page(ObTmpMacroBlock* block, ObTmpBlockIOInfo& io
info
.
offset_
=
page_io_infos
.
at
(
i
).
key_
.
get_page_id
()
*
ObTmpMacroBlock
::
get_default_page_size
();
info
.
size_
=
ObTmpMacroBlock
::
get_default_page_size
();
info
.
macro_block_id_
=
block
->
get_macro_block_id
();
if
(
OB_FAIL
(
page_cache_
->
prefetch
(
page_io_infos
.
at
(
i
).
key_
,
info
,
handle
,
mb_handle
)))
{
if
(
OB_FAIL
(
page_cache_
->
prefetch
(
page_io_infos
.
at
(
i
).
key_
,
info
,
mb_handle
)))
{
STORAGE_LOG
(
WARN
,
"fail to prefetch tmp page"
,
K
(
ret
));
}
else
{
char
*
buf
=
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录