[CP] fix 3 restore related bugs

This commit is contained in:
wxhwang
2024-03-27 03:21:50 +00:00
committed by ob-robot
parent 613c8c8872
commit 99861a01cc
3 changed files with 10 additions and 2 deletions

View File

@ -868,6 +868,7 @@ int ObImportTableTaskScheduler::wait_import_ddl_task_finish_(bool &is_finish)
LOG_WARN("failed to set result", K(ret), K(error_message));
} else {
import_task_->set_result(result);
import_task_->set_completion_ts(ObTimeUtility::current_time());
is_finish = true;
LOG_INFO("[IMPORT_TABLE]import table failed", KPC_(import_task), K(error_message));
}

View File

@ -430,7 +430,14 @@ int ObDestRoundCheckpointer::generate_one_piece_(const ObTenantArchiveRoundAttr
} else if (piece_id == max_active_piece_id) {
piece.piece_info_.checkpoint_scn_ = MIN(new_round_info.checkpoint_scn_, piece.piece_info_.checkpoint_scn_);
piece.piece_info_.status_.set_active();
if (piece.piece_info_.checkpoint_scn_ > piece.piece_info_.start_scn_) {
if (piece.piece_info_.checkpoint_scn_ > new_round_info.start_scn_
&& piece.piece_info_.checkpoint_scn_ >= piece.piece_info_.start_scn_) {
// As the scn of one log group is the max log scn among the log entries. If checkpoint_scn_
// is equal to start_scn_, the piece is not empty, and may be used for restore. For example,
// Piece#1 : <2022-06-01 06:00:00, 2022-06-02 05:00:00, 2022-06-02 06:00:00>
// Piece#2 : <2022-06-02 06:00:00, 2022-06-02 06:00:00, 2022-06-03 06:00:00>
// And the first log group in Piece#2 with scn range [2022-06-02 05:30:00, 2022-06-02 06:00:00], this piece
// is required while restore to 2022-06-02 05:40:00.
piece.piece_info_.file_status_ = ObBackupFileStatus::STATUS::BACKUP_FILE_AVAILABLE;
} else {
piece.piece_info_.file_status_ = ObBackupFileStatus::STATUS::BACKUP_FILE_INCOMPLETE;

View File

@ -143,7 +143,7 @@ public:
bool can_migrate() const
{
return !(status_ >= RESTORE_START && status_ <= RESTORE_SYS_TABLETS) &&
return !(status_ >= RESTORE_START && status_ < WAIT_RESTORE_TABLETS_META) &&
!(status_ >= Status::CLONE_START && status_ <= Status::CLONE_CLOG_REPLAY);
}
bool is_in_restore_and_before_quick_restore() const