提交 6f5c5cc1 编写于 作者: Y yishenglanlingzui 提交者: wangzelin.wzl

[CP] fix the recovery failure, because log archive piece is incorrect deleted when obsolete clean

上级 4c2e8cc1
......@@ -1296,6 +1296,7 @@ int ObBackupDataClean::add_sys_tenant_obsolete_backup_sets(const share::ObBackup
} else if (OB_FAIL(get_cluster_max_succeed_backup_set(copy_id, cluster_max_backup_set_id))) {
LOG_WARN("failed to get cluster max succeed backup set", K(ret), K(clean_info));
} else {
// Traverse in reverse order by backup_set_id
for (int64_t i = task_infos.count() - 1; OB_SUCC(ret) && i >= 0; --i) {
is_continue = false;
const ObTenantBackupTaskInfo &task_info = task_infos.at(i);
......@@ -1326,6 +1327,7 @@ int ObBackupDataClean::add_sys_tenant_obsolete_backup_sets(const share::ObBackup
if (OB_FAIL(ret)) {
} else if (need_add_backup_set) {
// successful and not obsolete backup sets need to added, because of the touch feature
if (OB_FAIL(reverse_task_infos.push_back(task_info))) {
LOG_WARN("failed to push task info into array", K(ret), K(task_info));
} else if (OB_FAIL(reverse_backup_set_ids.push_back(backup_set_id))) {
......@@ -1497,34 +1499,23 @@ int ObBackupDataClean::add_obsolete_backup_set_with_order(const share::ObBackupC
K(reverse_backup_set_ids));
} else {
bool is_deleted_set_contine = true;
bool is_set_clog_clean_point = false;
ObBackupSetId new_backup_set_id;
ObBackupDestOpt backup_dest_option;
// Traverse in order of backup_set_id, reset clog_data_clean_point to ensure sequential deletion
for (int64_t i = reverse_task_infos.count() - 1; OB_SUCC(ret) && i >= 0; --i) {
backup_dest_option.reset();
const ObTenantBackupTaskInfo &task_info = reverse_task_infos.at(i);
const ObBackupSetId &backup_set_id = reverse_backup_set_ids.at(i);
new_backup_set_id = backup_set_id;
if (!is_deleted_set_contine) {
if (clean_info.is_delete_obsolete_backup_backup()) {
if (task_info.is_result_succeed()) {
new_backup_set_id.clean_mode_ = ObBackupDataCleanMode::TOUCH;
if (task_info.is_result_succeed() && !is_set_clog_clean_point) {
clog_data_clean_point = task_info;
is_set_clog_clean_point = true;
}
} else if (task_info.is_result_succeed()) {
new_backup_set_id.clean_mode_ = ObBackupDataCleanMode::TOUCH;
if (!is_set_clog_clean_point) {
clog_data_clean_point = task_info;
is_set_clog_clean_point = true;
}
} else {
// do nothing
}
} else if (ObBackupDataCleanMode::CLEAN == backup_set_id.clean_mode_) {
// do nothing
} else {
is_deleted_set_contine = false;
clog_data_clean_point = task_info;
}
if (OB_FAIL(get_backup_dest_option(task_info.backup_dest_, backup_dest_option))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册