Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
1bb97602
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,体验更适合开发者的 AI 搜索 >>
提交
1bb97602
编写于
3月 09, 2023
作者:
W
WenJinyu
提交者:
ob-robot
3月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] fix when delete specified backup_set, the round task is deleted
上级
4036f512
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
154 addition
and
110 deletion
+154
-110
src/rootserver/ob_backup_data_clean.cpp
src/rootserver/ob_backup_data_clean.cpp
+142
-110
src/rootserver/ob_backup_data_clean.h
src/rootserver/ob_backup_data_clean.h
+12
-0
未找到文件。
src/rootserver/ob_backup_data_clean.cpp
浏览文件 @
1bb97602
...
...
@@ -2416,41 +2416,24 @@ int ObBackupDataClean::get_sys_tenant_delete_clog_round_and_piece(const share::O
return
ret
;
}
int
ObBackupDataClean
::
get_sys_tenant_prepare_clog_
round_and_
piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
Ob
BackupDataCleanElement
&
clean_element
,
common
::
ObIArray
<
ObLogArchiveRound
>
&
log_archive_rounds
,
int
ObBackupDataClean
::
get_sys_tenant_prepare_clog_piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
Ob
LogArchiveRound
&
log_archive_round
,
const
ObBackupDataCleanElement
&
clean_element
,
bool
&
is_delete_inorder
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
)
{
int
ret
=
OB_SUCCESS
;
log_archive_rounds
.
reset
();
backup_piece_keys
.
reset
();
const
int64_t
clog_gc_snapshot
=
clean_info
.
clog_gc_snapshot_
;
ObLogArchiveBackupInfoMgr
log_info_mgr
;
const
uint64_t
tenant_id
=
clean_info
.
tenant_id_
;
const
int64_t
incarnation
=
clean_element
.
incarnation_
;
const
int64_t
backup_copies
=
clean_element
.
backup_dest_option_
.
backup_copies_
;
ObSimpleArchiveRound
simple_archive_round
;
ObSimplePieceKey
simple_piece_key
;
const
bool
overwrite_key
=
true
;
bool
is_delete_inorder
=
true
;
ObSimplePieceKey
simple_piece_key
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"backup data clean do not init"
,
K
(
ret
));
}
else
if
(
!
clean_info
.
is_valid
()
||
OB_SYS_TENANT_ID
!=
clean_info
.
tenant_id_
||
ObBackupCleanInfoStatus
::
PREPARE
!=
clean_info
.
status_
)
{
}
else
if
(
!
clean_info
.
is_valid
()
||
!
log_archive_round
.
is_valid
()
||
!
clean_element
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"get sys tenant delete clog round and piece get invalid argument"
,
K
(
ret
),
K
(
clean_info
));
}
else
{
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
clean_element
.
log_archive_round_array_
.
count
();
++
i
)
{
const
ObLogArchiveRound
&
log_archive_round
=
clean_element
.
log_archive_round_array_
.
at
(
i
);
if
(
!
is_delete_inorder
)
{
break
;
}
else
if
(
clean_info
.
is_delete_backup_set
()
&&
0
!=
log_archive_round
.
start_piece_id_
)
{
// do nothing
LOG_WARN
(
"argument is invalid"
,
K
(
ret
),
K
(
clean_info
),
K
(
log_archive_round
),
K
(
clean_element
));
}
else
{
for
(
int64_t
j
=
0
;
OB_SUCC
(
ret
)
&&
is_delete_inorder
&&
j
<
log_archive_round
.
piece_infos_
.
count
();
++
j
)
{
const
ObSimplePieceInfo
&
simple_piece_info
=
log_archive_round
.
piece_infos_
.
at
(
j
);
if
(
simple_piece_info
.
max_ts_
>
clog_gc_snapshot
||
if
(
simple_piece_info
.
max_ts_
>
clean_info
.
clog_gc_snapshot_
||
ObBackupPieceStatus
::
BACKUP_PIECE_FROZEN
!=
simple_piece_info
.
status_
||
ObBackupFileStatus
::
BACKUP_FILE_COPYING
==
simple_piece_info
.
file_status_
||
simple_piece_info
.
copies_num_
<
backup_copies
)
{
...
...
@@ -2461,9 +2444,9 @@ int ObBackupDataClean::get_sys_tenant_prepare_clog_round_and_piece(const share::
ObBackupPieceInfoKey
piece_info_key
;
piece_info_key
.
backup_piece_id_
=
simple_piece_info
.
backup_piece_id_
;
piece_info_key
.
copy_id_
=
log_archive_round
.
copy_id_
;
piece_info_key
.
incarnation_
=
incarnation
;
piece_info_key
.
incarnation_
=
clean_element
.
incarnation_
;
piece_info_key
.
round_id_
=
log_archive_round
.
log_archive_round_
;
piece_info_key
.
tenant_id_
=
tenant_id
;
piece_info_key
.
tenant_id_
=
clean_info
.
tenant_id_
;
simple_piece_key
.
reset
();
simple_piece_key
.
incarnation_
=
piece_info_key
.
incarnation_
;
...
...
@@ -2499,12 +2482,28 @@ int ObBackupDataClean::get_sys_tenant_prepare_clog_round_and_piece(const share::
}
}
}
return
ret
;
}
int
ObBackupDataClean
::
get_sys_tenant_prepare_clog_round
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObLogArchiveRound
&
log_archive_round
,
const
ObBackupDataCleanElement
&
clean_element
,
bool
&
is_delete_inorder
,
common
::
ObIArray
<
ObLogArchiveRound
>
&
log_archive_rounds
)
{
int
ret
=
OB_SUCCESS
;
const
int64_t
backup_copies
=
clean_element
.
backup_dest_option_
.
backup_copies_
;
const
bool
overwrite_key
=
true
;
ObSimpleArchiveRound
simple_archive_round
;
int
piece_num
=
log_archive_round
.
piece_infos_
.
count
();
if
(
OB_FAIL
(
ret
))
{
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"backup data clean do not init"
,
K
(
ret
));
}
else
if
(
!
clean_info
.
is_valid
()
||
!
log_archive_round
.
is_valid
()
||
!
clean_element
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"argument is invalid"
,
K
(
ret
),
K
(
clean_info
),
K
(
log_archive_round
),
K
(
clean_element
));
}
else
if
(
ObLogArchiveStatus
::
STOP
!=
log_archive_round
.
log_archive_status_
)
{
// do nothing
}
else
if
(
log_archive_round
.
checkpoint_ts_
>
clog_gc_snapshot
||
log_archive_round
.
copies_num_
<
backup_copies
)
{
}
else
if
(
log_archive_round
.
checkpoint_ts_
>
clean_info
.
clog_gc_snapshot_
||
log_archive_round
.
copies_num_
<
backup_copies
)
{
is_delete_inorder
=
false
;
}
else
if
(
piece_num
<
0
)
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
@@ -2514,7 +2513,7 @@ int ObBackupDataClean::get_sys_tenant_prepare_clog_round_and_piece(const share::
is_delete_inorder
=
true
;
}
else
{
const
ObSimplePieceInfo
&
simple_piece_info
=
log_archive_round
.
piece_infos_
.
at
(
piece_num
-
1
);
if
(
simple_piece_info
.
max_ts_
>
clog_gc_snapshot
)
{
if
(
simple_piece_info
.
max_ts_
>
clean_info
.
clog_gc_snapshot_
)
{
is_delete_inorder
=
false
;
}
}
...
...
@@ -2530,8 +2529,8 @@ int ObBackupDataClean::get_sys_tenant_prepare_clog_round_and_piece(const share::
simple_archive_round
.
copy_id_
=
log_archive_round
.
copy_id_
;
if
(
OB_FAIL
(
sys_tenant_deleted_backup_round_
.
set_refactored_1
(
simple_archive_round
,
overwrite_key
)))
{
LOG_WARN
(
"failed to set sys tenant deleted backup round"
,
K
(
ret
),
K
(
simple_archive_round
));
}
else
if
(
FALSE_IT
(
trace_length
=
ObCurTraceId
::
get_trace_id
()
->
to_string
(
trace_id
,
common
::
OB_MAX_TRACE_ID_BUFFER_SIZE
)))
{
}
else
if
(
FALSE_IT
(
trace_length
=
ObCurTraceId
::
get_trace_id
()
->
to_string
(
trace_id
,
common
::
OB_MAX_TRACE_ID_BUFFER_SIZE
)))
{
}
else
if
(
trace_length
>
OB_MAX_TRACE_ID_BUFFER_SIZE
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"failed to get trace id"
,
K
(
ret
),
K
(
*
ObCurTraceId
::
get_trace_id
()));
...
...
@@ -2550,6 +2549,39 @@ int ObBackupDataClean::get_sys_tenant_prepare_clog_round_and_piece(const share::
}
}
}
return
ret
;
}
int
ObBackupDataClean
::
get_sys_tenant_prepare_clog_round_and_piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObBackupDataCleanElement
&
clean_element
,
common
::
ObIArray
<
ObLogArchiveRound
>
&
log_archive_rounds
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
)
{
int
ret
=
OB_SUCCESS
;
log_archive_rounds
.
reset
();
backup_piece_keys
.
reset
();
ObLogArchiveBackupInfoMgr
log_info_mgr
;
bool
is_delete_inorder
=
true
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"backup data clean do not init"
,
K
(
ret
));
}
else
if
(
!
clean_info
.
is_valid
()
||
OB_SYS_TENANT_ID
!=
clean_info
.
tenant_id_
||
ObBackupCleanInfoStatus
::
PREPARE
!=
clean_info
.
status_
)
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"get sys tenant delete clog round and piece get invalid argument"
,
K
(
ret
),
K
(
clean_info
));
}
else
{
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
clean_element
.
log_archive_round_array_
.
count
();
++
i
)
{
const
ObLogArchiveRound
&
log_archive_round
=
clean_element
.
log_archive_round_array_
.
at
(
i
);
if
(
!
is_delete_inorder
)
{
break
;
}
else
if
(
clean_info
.
is_delete_backup_set
()
&&
0
!=
log_archive_round
.
start_piece_id_
)
{
// do nothing
}
else
if
(
OB_FAIL
(
get_sys_tenant_prepare_clog_piece
(
clean_info
,
log_archive_round
,
clean_element
,
is_delete_inorder
,
backup_piece_keys
)))
{
LOG_WARN
(
"get sys tenant delete clog piece"
,
K
(
ret
),
K
(
clean_info
),
K
(
log_archive_round
));
}
else
if
(
OB_FAIL
(
get_sys_tenant_prepare_clog_round
(
clean_info
,
log_archive_round
,
clean_element
,
is_delete_inorder
,
log_archive_rounds
)))
{
LOG_WARN
(
"get sys tenant delete clog round"
,
K
(
ret
),
K
(
clean_info
),
K
(
log_archive_round
),
K
(
backup_piece_keys
));
}
}
}
return
ret
;
...
...
src/rootserver/ob_backup_data_clean.h
浏览文件 @
1bb97602
...
...
@@ -172,6 +172,18 @@ private:
const
ObBackupDataCleanElement
&
clean_element
,
common
::
ObIArray
<
ObLogArchiveRound
>
&
log_archive_rounds
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
);
int
get_sys_tenant_prepare_clog_round
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObLogArchiveRound
&
log_archive_round
,
const
ObBackupDataCleanElement
&
clean_element
,
bool
&
is_delete_inorder
,
common
::
ObIArray
<
ObLogArchiveRound
>
&
log_archive_rounds
);
int
get_sys_tenant_prepare_clog_piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObLogArchiveRound
&
log_archive_round
,
const
ObBackupDataCleanElement
&
clean_element
,
bool
&
is_delete_inorder
,
common
::
ObIArray
<
ObBackupPieceInfoKey
>
&
backup_piece_keys
);
int
get_sys_tenant_doing_clog_round_and_piece
(
const
share
::
ObBackupCleanInfo
&
clean_info
,
const
ObBackupDataCleanElement
&
clean_element
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录