Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
caoersss
oceanbase
提交
3c012972
O
oceanbase
项目概览
caoersss
/
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,发现更多精彩内容 >>
提交
3c012972
编写于
1月 11, 2022
作者:
G
godyangfight
提交者:
LINGuanRen
1月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix delete backuppiece can not delete files bug
上级
d5a5ed42
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
45 addition
and
13 deletion
+45
-13
src/rootserver/backup/ob_tenant_backup_data_clean_mgr.cpp
src/rootserver/backup/ob_tenant_backup_data_clean_mgr.cpp
+2
-0
src/rootserver/ob_backup_data_clean.cpp
src/rootserver/ob_backup_data_clean.cpp
+41
-13
src/rootserver/ob_backup_data_clean.h
src/rootserver/ob_backup_data_clean.h
+2
-0
未找到文件。
src/rootserver/backup/ob_tenant_backup_data_clean_mgr.cpp
浏览文件 @
3c012972
...
...
@@ -1909,8 +1909,10 @@ int ObTenantBackupClogDataCleanTask::generate_backup_piece_pg_tasks(
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
;
LOG_INFO
(
"backup piece will be deleted"
,
K
(
simple_piece_key
));
}
else
if
(
OB_HASH_NOT_EXIST
==
hash_ret
)
{
delete_clog_mode
.
mode_
=
ObBackupDeleteClogMode
::
NONE
;
LOG_INFO
(
"backup piece will not be deleted"
,
K
(
simple_piece_key
));
}
else
{
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
));
...
...
src/rootserver/ob_backup_data_clean.cpp
浏览文件 @
3c012972
...
...
@@ -3017,19 +3017,8 @@ int ObBackupDataClean::get_need_delete_clog_round_and_piece(const share::ObBacku
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"backup data clean do not init"
,
K
(
ret
));
}
else
if
(
clean_info
.
is_delete_backup_piece
())
{
ObBackupPieceInfoKey
piece_key
;
if
(
clean_element
.
log_archive_round_array_
.
empty
()
||
clean_element
.
log_archive_round_array_
.
count
()
>
1
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"delete backup piece get unexpected round infos"
,
K
(
ret
),
K
(
clean_element
));
}
else
{
piece_key
.
backup_piece_id_
=
clean_info
.
backup_piece_id_
;
piece_key
.
copy_id_
=
clean_element
.
log_archive_round_array_
.
at
(
0
).
copy_id_
;
piece_key
.
incarnation_
=
clean_element
.
incarnation_
;
piece_key
.
round_id_
=
clean_element
.
log_archive_round_array_
.
at
(
0
).
log_archive_round_
;
piece_key
.
tenant_id_
=
clean_info
.
tenant_id_
;
if
(
OB_FAIL
(
backup_piece_keys
.
push_back
(
piece_key
)))
{
LOG_WARN
(
"failed to push backup piece key into array"
,
K
(
ret
),
K
(
piece_key
));
}
if
(
OB_FAIL
(
get_tenant_delete_piece
(
clean_info
,
clean_element
,
backup_piece_keys
)))
{
LOG_WARN
(
"failed to get tenant delete piece"
,
K
(
ret
),
K
(
clean_info
),
K
(
clean_element
));
}
}
else
if
(
OB_SYS_TENANT_ID
==
clean_info
.
tenant_id_
)
{
if
(
OB_FAIL
(
get_sys_tenant_delete_clog_round_and_piece
(
...
...
@@ -6862,6 +6851,45 @@ int ObBackupDataClean::remove_delete_expired_data_snapshot_(const ObSimpleBackup
return
ret
;
}
int
ObBackupDataClean
::
get_tenant_delete_piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObBackupDataCleanElement
&
clean_element
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
)
{
int
ret
=
OB_SUCCESS
;
ObBackupPieceInfoKey
piece_key
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"backup data clean do not init"
,
K
(
ret
));
}
else
if
(
clean_element
.
log_archive_round_array_
.
empty
()
||
clean_element
.
log_archive_round_array_
.
count
()
>
1
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"delete backup piece get unexpected round infos"
,
K
(
ret
),
K
(
clean_element
));
}
else
{
piece_key
.
backup_piece_id_
=
clean_info
.
backup_piece_id_
;
piece_key
.
copy_id_
=
clean_element
.
log_archive_round_array_
.
at
(
0
).
copy_id_
;
piece_key
.
incarnation_
=
clean_element
.
incarnation_
;
piece_key
.
round_id_
=
clean_element
.
log_archive_round_array_
.
at
(
0
).
log_archive_round_
;
piece_key
.
tenant_id_
=
clean_info
.
tenant_id_
;
if
(
OB_FAIL
(
backup_piece_keys
.
push_back
(
piece_key
)))
{
LOG_WARN
(
"failed to push backup piece key into array"
,
K
(
ret
),
K
(
piece_key
));
}
if
(
OB_SUCC
(
ret
))
{
if
(
OB_SYS_TENANT_ID
==
clean_info
.
tenant_id_
)
{
const
bool
overwrite_key
=
true
;
ObSimplePieceKey
simple_piece_key
;
simple_piece_key
.
backup_piece_id_
=
piece_key
.
backup_piece_id_
;
simple_piece_key
.
copy_id_
=
piece_key
.
copy_id_
;
simple_piece_key
.
incarnation_
=
piece_key
.
incarnation_
;
simple_piece_key
.
round_id_
=
piece_key
.
round_id_
;
if
(
OB_FAIL
(
sys_tenant_deleted_backup_piece_
.
set_refactored_1
(
simple_piece_key
,
overwrite_key
)))
{
LOG_WARN
(
"failed to set simple piece key"
,
K
(
ret
),
K
(
simple_piece_key
),
K
(
piece_key
));
}
}
}
}
return
ret
;
}
int
ObBackupDataClean
::
set_comment
(
ObBackupCleanInfo
::
Comment
&
comment
)
{
int
ret
=
OB_SUCCESS
;
...
...
src/rootserver/ob_backup_data_clean.h
浏览文件 @
3c012972
...
...
@@ -220,6 +220,8 @@ private:
const
ObBackupDataCleanElement
&
clean_element
,
common
::
ObIArray
<
ObLogArchiveRound
>
&
log_archive_rounds
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
);
int
get_tenant_delete_piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObBackupDataCleanElement
&
clean_element
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
);
int
delete_tenant_backup_meta_data
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObBackupDataCleanTenant
&
clean_tenant
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录