Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
bd925074
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,发现更多精彩内容 >>
提交
bd925074
编写于
12月 29, 2021
作者:
G
godyangfight
提交者:
LINGuanRen
12月 29, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix physical backup clean backup piece bug
上级
320605c6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
51 addition
and
16 deletion
+51
-16
src/rootserver/backup/ob_tenant_backup_data_clean_mgr.cpp
src/rootserver/backup/ob_tenant_backup_data_clean_mgr.cpp
+43
-16
src/rootserver/ob_backup_data_clean.h
src/rootserver/ob_backup_data_clean.h
+8
-0
未找到文件。
src/rootserver/backup/ob_tenant_backup_data_clean_mgr.cpp
浏览文件 @
bd925074
...
...
@@ -1366,7 +1366,8 @@ int ObTenantBackupClogDataCleanTask::do_clean()
"cost"
,
ObTimeUtil
::
current_time
()
-
start_ts
,
K
(
ret
),
K
(
clean_tenant_
.
simple_clean_tenant_
));
K
(
clean_tenant_
.
simple_clean_tenant_
),
K
(
start_replay_log_ts
));
return
ret
;
}
...
...
@@ -1873,7 +1874,21 @@ int ObTenantBackupClogDataCleanTask::generate_backup_piece_pg_tasks(
}
else
if
(
start_replay_log_ts
<
log_archive_round
.
checkpoint_ts_
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
DELETE_ARCHIVE_LOG
;
}
else
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
DELETE_BACKUP_PIECE
;
const
hash
::
ObHashSet
<
ObSimpleArchiveRound
>
&
sys_tenant_deleted_backup_round
=
data_clean_
->
get_sys_tenant_deleted_backup_round
();
ObSimpleArchiveRound
simple_archive_round
;
simple_archive_round
.
copy_id_
=
log_archive_round
.
copy_id_
;
simple_archive_round
.
incarnation_
=
clean_element
.
incarnation_
;
simple_archive_round
.
round_id_
=
log_archive_round
.
log_archive_round_
;
int
hash_ret
=
sys_tenant_deleted_backup_round
.
exist_refactored
(
simple_archive_round
);
if
(
OB_HASH_EXIST
==
hash_ret
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
DELETE_BACKUP_PIECE
;
}
else
if
(
OB_HASH_NOT_EXIST
==
hash_ret
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
DELETE_ARCHIVE_LOG
;
}
else
{
ret
=
OB_SUCCESS
==
hash_ret
?
OB_ERR_UNEXPECTED
:
hash_ret
;
LOG_WARN
(
"failed to check archive round exist"
,
K
(
ret
),
K
(
hash_ret
),
K
(
simple_archive_round
));
}
}
}
else
if
((
ObLogArchiveStatus
::
DOING
==
log_archive_round
.
log_archive_status_
||
ObLogArchiveStatus
::
INTERRUPTED
==
log_archive_round
.
log_archive_status_
)
&&
...
...
@@ -1883,22 +1898,34 @@ int ObTenantBackupClogDataCleanTask::generate_backup_piece_pg_tasks(
}
else
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
NONE
;
}
}
else
if
(
ObBackupPieceStatus
::
BACKUP_PIECE_FROZEN
==
backup_piece_info
.
status_
)
{
if
(
ObBackupFileStatus
::
BACKUP_FILE_DELETED
==
backup_piece_info
.
file_status_
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"backup file status is unexpected"
,
K
(
ret
),
K
(
backup_piece_info
));
}
else
if
(
ObBackupFileStatus
::
BACKUP_FILE_COPYING
==
backup_piece_info
.
file_status_
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
NONE
;
}
else
if
(
backup_piece_info
.
max_ts_
>
start_replay_log_ts
||
backup_piece_info
.
copies_num_
<
backup_copies
)
{
}
else
{
const
hash
::
ObHashSet
<
ObSimplePieceKey
>
&
sys_tenant_deleted_backup_piece
=
data_clean_
->
get_sys_tenant_deleted_backup_piece
();
ObSimplePieceKey
simple_piece_key
;
simple_piece_key
.
backup_piece_id_
=
backup_piece_info
.
backup_piece_id_
;
simple_piece_key
.
copy_id_
=
log_archive_round
.
copy_id_
;
simple_piece_key
.
incarnation_
=
clean_element
.
incarnation_
;
simple_piece_key
.
round_id_
=
backup_piece_info
.
round_id_
;
int
hash_ret
=
sys_tenant_deleted_backup_piece
.
exist_refactored
(
simple_piece_key
);
if
(
OB_HASH_EXIST
==
hash_ret
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
DELETE_BACKUP_PIECE
;
}
else
if
(
OB_HASH_NOT_EXIST
==
hash_ret
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
NONE
;
}
else
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
DELETE_BACKUP_PIECE
;
ret
=
OB_SUCCESS
==
hash_ret
?
OB_ERR_UNEXPECTED
:
hash_ret
;
LOG_WARN
(
"failed to check backup piece exist"
,
K
(
ret
),
K
(
hash_ret
),
K
(
simple_piece_key
));
}
}
else
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
NONE
;
}
if
(
OB_SUCC
(
ret
))
{
LOG_INFO
(
"start handle backup piece"
,
K
(
delete_clog_mode
),
"backup dest option"
,
clean_element
.
backup_dest_option_
,
K
(
start_replay_log_ts
),
K
(
backup_piece_info
),
K
(
log_archive_round
));
if
((
ObBackupDeleteClogMode
::
DELETE_BACKUP_PIECE
==
delete_clog_mode
.
mode_
&&
clean_element
.
backup_dest_option_
.
auto_touch_reserved_backup_
)
||
(
ObBackupDeleteClogMode
::
NONE
==
delete_clog_mode
.
mode_
&&
...
...
@@ -1979,12 +2006,12 @@ int ObTenantBackupClogDataCleanTask::generate_backup_piece_pg_delete_task(
is_backup_backup
,
*
data_clean_
)))
{
LOG_WARN
(
"failed to init clog data clean mgr"
,
K
(
ret
),
K
(
cluster_backup_dest
),
K
(
log_archive_round
),
K
(
pg_key
));
}
else
if
(
clean_element
.
backup_dest_option_
.
auto_
delete_obsolete
_backup_
)
{
if
(
OB_FAIL
(
partition_clog_data_clean_mgr
.
clean
_clog_backup_data
()))
{
LOG_WARN
(
"failed to
clean
clog backup data"
,
K
(
ret
),
K
(
pg_key
),
K
(
cluster_backup_dest
));
}
else
if
(
clean_element
.
backup_dest_option_
.
auto_
touch_reserved
_backup_
)
{
if
(
OB_FAIL
(
partition_clog_data_clean_mgr
.
touch
_clog_backup_data
()))
{
LOG_WARN
(
"failed to
touch
clog backup data"
,
K
(
ret
),
K
(
pg_key
),
K
(
cluster_backup_dest
));
}
}
else
{
if
(
OB_FAIL
(
partition_clog_data_clean_mgr
.
touch
_clog_backup_data
()))
{
if
(
OB_FAIL
(
partition_clog_data_clean_mgr
.
clean
_clog_backup_data
()))
{
LOG_WARN
(
"failed to clean clog backup data"
,
K
(
ret
),
K
(
pg_key
),
K
(
cluster_backup_dest
));
}
}
...
...
src/rootserver/ob_backup_data_clean.h
浏览文件 @
bd925074
...
...
@@ -90,6 +90,14 @@ public:
{
return
backup_backup_dest_
;
}
const
hash
::
ObHashSet
<
ObSimplePieceKey
>
&
get_sys_tenant_deleted_backup_piece
()
{
return
sys_tenant_deleted_backup_piece_
;
}
const
hash
::
ObHashSet
<
ObSimpleArchiveRound
>
&
get_sys_tenant_deleted_backup_round
()
{
return
sys_tenant_deleted_backup_round_
;
}
private:
int
get_need_clean_tenants
(
common
::
ObIArray
<
ObBackupDataCleanTenant
>
&
clean_tenants
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录