Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
4036f512
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
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,发现更多精彩内容 >>
提交
4036f512
编写于
3月 09, 2023
作者:
O
oceanoverflow
提交者:
ob-robot
3月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix backup incremental database reuse macro block do not consider table_id issue
上级
d7afce7c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
10 deletion
+14
-10
src/storage/backup/ob_partition_base_data_physical_restore_v2.cpp
...age/backup/ob_partition_base_data_physical_restore_v2.cpp
+9
-6
src/storage/backup/ob_partition_base_data_physical_restore_v2.h
...orage/backup/ob_partition_base_data_physical_restore_v2.h
+4
-3
src/storage/ob_partition_base_data_backup.cpp
src/storage/ob_partition_base_data_backup.cpp
+1
-1
未找到文件。
src/storage/backup/ob_partition_base_data_physical_restore_v2.cpp
浏览文件 @
4036f512
...
...
@@ -2224,7 +2224,7 @@ int ObPhyRestoreMacroIndexStoreV2::check_table_exist(const ObITable::TableKey &t
}
int
ObPhyRestoreMacroIndexStoreV2
::
check_major_macro_block_exist
(
const
int64_t
data_version
,
const
int64_t
data_seq
,
bool
&
is_exist
)
const
const
ObITable
::
TableKey
&
table_key
,
const
int64_t
data_version
,
const
int64_t
data_seq
,
bool
&
is_exist
)
const
{
int
ret
=
OB_SUCCESS
;
is_exist
=
false
;
...
...
@@ -2235,7 +2235,7 @@ int ObPhyRestoreMacroIndexStoreV2::check_major_macro_block_exist(
}
else
if
(
data_version
<
0
||
data_seq
<
0
)
{
ret
=
OB_INVALID_ARGUMENT
;
STORAGE_LOG
(
WARN
,
"get invalid args"
,
K
(
ret
),
K
(
data_version
),
K
(
data_seq
));
}
else
if
(
OB_FAIL
(
get_macro_index_list_
(
data_version
,
index_list
)))
{
}
else
if
(
OB_FAIL
(
get_macro_index_list_
(
table_key
,
data_version
,
index_list
)))
{
if
(
OB_HASH_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
STORAGE_LOG
(
INFO
,
"macro index not exist, may be empty sstable"
,
K
(
ret
),
K
(
data_version
),
K
(
data_seq
));
...
...
@@ -2248,7 +2248,8 @@ int ObPhyRestoreMacroIndexStoreV2::check_major_macro_block_exist(
}
else
{
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
index_list
->
count
();
++
i
)
{
const
ObBackupTableMacroIndex
&
index
=
index_list
->
at
(
i
);
if
(
data_version
==
index
.
data_version_
&&
data_seq
==
index
.
data_seq_
)
{
if
(
table_key
.
table_id_
==
index
.
table_key_ptr_
->
table_id_
&&
data_version
==
index
.
data_version_
&&
data_seq
==
index
.
data_seq_
)
{
is_exist
=
true
;
break
;
}
...
...
@@ -2257,7 +2258,7 @@ int ObPhyRestoreMacroIndexStoreV2::check_major_macro_block_exist(
return
ret
;
}
int
ObPhyRestoreMacroIndexStoreV2
::
get_macro_index_list_
(
int
ObPhyRestoreMacroIndexStoreV2
::
get_macro_index_list_
(
const
ObITable
::
TableKey
&
table_key
,
const
int64_t
data_version
,
const
common
::
ObArray
<
ObBackupTableMacroIndex
>
*&
index_list
)
const
{
int
ret
=
OB_SUCCESS
;
...
...
@@ -2269,8 +2270,10 @@ int ObPhyRestoreMacroIndexStoreV2::get_macro_index_list_(
STORAGE_LOG
(
WARN
,
"macro index store do not init"
,
K
(
ret
));
}
else
{
for
(
MacroIndexMap
::
const_iterator
iter
=
index_map_
.
begin
();
iter
!=
index_map_
.
end
()
&&
!
found
;
++
iter
)
{
const
ObITable
::
TableKey
&
table_key
=
iter
->
first
;
if
(
table_key
.
version_
.
version_
<
data_version
)
{
const
ObITable
::
TableKey
&
tmp_table_key
=
iter
->
first
;
if
(
tmp_table_key
.
version_
.
version_
<
data_version
)
{
// do nothing
}
else
if
(
table_key
.
table_id_
!=
tmp_table_key
.
table_id_
)
{
// do nothing
}
else
{
index_list
=
iter
->
second
;
...
...
src/storage/backup/ob_partition_base_data_physical_restore_v2.h
浏览文件 @
4036f512
...
...
@@ -52,7 +52,8 @@ public:
}
virtual
bool
is_inited
()
const
;
int
check_table_exist
(
const
ObITable
::
TableKey
&
table_key
,
bool
&
is_exist
)
const
;
int
check_major_macro_block_exist
(
const
int64_t
data_version
,
const
int64_t
data_seq
,
bool
&
is_exist
)
const
;
int
check_major_macro_block_exist
(
const
ObITable
::
TableKey
&
table_key
,
const
int64_t
data_version
,
const
int64_t
data_seq
,
bool
&
is_exist
)
const
;
TO_STRING_KV
(
K_
(
is_inited
));
...
...
@@ -70,8 +71,8 @@ private:
const
ObITable
::
TableKey
&
table_key
,
const
common
::
ObIArray
<
ObBackupTableMacroIndex
>
&
index_list
);
int
init_one_file
(
const
ObString
&
path
,
const
ObString
&
storage_info
);
int
get_table_key_ptr
(
const
ObITable
::
TableKey
&
table_key
,
const
ObITable
::
TableKey
*&
table_key_ptr
);
int
get_macro_index_list_
(
const
int64_t
data_version
,
const
common
::
ObArray
<
ObBackupTableMacroIndex
>
*&
index_list
)
const
;
int
get_macro_index_list_
(
const
ObITable
::
TableKey
&
table_key
,
const
int64_t
data_version
,
const
common
::
ObArray
<
ObBackupTableMacroIndex
>
*&
index_list
)
const
;
private:
static
const
int64_t
BUCKET_SIZE
=
100000
;
// 10w
...
...
src/storage/ob_partition_base_data_backup.cpp
浏览文件 @
4036f512
...
...
@@ -3147,7 +3147,7 @@ int ObBackupPhysicalPGCtx::check_major_macro_block_exist(const ObITable::TableKe
if
(
OB_UNLIKELY
(
!
macro_index_store
.
is_inited
()
||
!
table_key
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
STORAGE_LOG
(
WARN
,
"invalid argument"
,
K
(
ret
),
K
(
macro_index_store
),
K
(
table_key
));
}
else
if
(
OB_FAIL
(
macro_index_store
.
check_major_macro_block_exist
(
data_version
,
data_seq
,
is_exist
)))
{
}
else
if
(
OB_FAIL
(
macro_index_store
.
check_major_macro_block_exist
(
table_key
,
data_version
,
data_seq
,
is_exist
)))
{
STORAGE_LOG
(
WARN
,
"failed to check table exist"
,
K
(
ret
),
K
(
table_key
),
K
(
data_version
),
K
(
data_seq
));
}
return
ret
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录