fix restore compat issue from low-version observer backup

This commit is contained in:
WenJinyu 2022-01-18 10:57:52 +08:00 committed by LINxiansheng
parent fbd2429eef
commit 0691551d01

View File

@ -691,11 +691,19 @@ int ObRestoreUtil::inner_fill_compat_backup_path(
LOG_WARN("failed to get backup path list", KR(ret), K(uri_list));
} else if (OB_FAIL(job.multi_restore_path_list_.set(backup_set_list, backup_piece_list))) {
LOG_WARN("failed to set mutli restore path list", KR(ret));
} else if (OB_FAIL(ObMultiBackupDestUtil::check_can_restore_by_set_or_piece(backup_set_list, backup_piece_list))) {
if (OB_BACKUP_FILE_NOT_EXIST == ret) {
LOG_WARN("the backup file is missing and cannot be restored", K(ret));
} else {
LOG_WARN("failed to check can be restored", KR(ret));
} else {
// history reason, before 2277, the inc backup set is nested in full backup set
// so if the backup set list is empty and backup piece list is not empty
// it is compat path which the backup is from 2276 or before
const bool is_compat_path = backup_set_list.empty() && !backup_piece_list.empty();
if (!is_compat_path) {
if (OB_FAIL(ObMultiBackupDestUtil::check_can_restore_by_set_or_piece(backup_set_list, backup_piece_list))) {
if (OB_BACKUP_FILE_NOT_EXIST == ret) {
LOG_WARN("the backup file is missing and cannot be restored", K(ret));
}
} else {
LOG_WARN("failed to check can be restored", KR(ret));
}
}
}
return ret;