[CP] fix restart failed during tenant restore

This commit is contained in:
wxhwang 2023-11-23 16:45:01 +00:00 committed by ob-robot
parent 1d538b327f
commit 6d15258aba
6 changed files with 10 additions and 8 deletions

View File

@ -1336,6 +1336,7 @@ int ObRestoreScheduler::restore_wait_to_consistent_scn(const share::ObPhysicalRe
} else if (OB_FAIL(check_tenant_replay_to_consistent_scn(tenant_id, job_info.get_consistent_scn(), is_replay_finish))) {
LOG_WARN("fail to check tenant replay to consistent scn", K(ret));
} else if (!is_replay_finish) {
} else if (FALSE_IT(DEBUG_SYNC(AFTER_WAIT_RESTORE_TO_CONSISTENT_SCN))) {
} else if (OB_FAIL(trans.start(sql_proxy_, exec_tenant_id))) {
LOG_WARN("fail to start trans", K(ret));
} else if (OB_FAIL(set_restore_to_target_scn_(trans, job_info, job_info.get_restore_scn()))) {

View File

@ -505,6 +505,7 @@ class ObString;
ACT(AFTER_TRANSFER_DUMP_MDS_TABLE,)\
ACT(BEFORE_PROCESS_BALANCE_EXECUTE_WORK,)\
ACT(BEFORE_WAIT_RESTORE_TO_CONSISTENT_SCN,)\
ACT(AFTER_WAIT_RESTORE_TO_CONSISTENT_SCN,)\
ACT(BEFORE_BACKUP_1001_META,)\
ACT(BEFORE_BACKUP_1002_META,)\
ACT(BEFORE_BACKUP_CONSISTENT_SCN,)\

View File

@ -113,6 +113,10 @@ public:
{
return status_ >= RESTORE_START && status_ <= WAIT_RESTORE_TO_CONSISTENT_SCN;
}
bool is_before_restore_to_consistent_scn() const
{
return status_ >= RESTORE_START && status_ < WAIT_RESTORE_TO_CONSISTENT_SCN;
}
Status get_status() const { return status_; }
int set_status(int32_t status);

View File

@ -1573,7 +1573,7 @@ int ObStartCompleteMigrationTask::check_need_wait_transfer_table_replace_(
LOG_WARN("check need wait log sync get invalid argument", K(ret), KP(ls));
} else if (OB_FAIL(ls->get_restore_status(ls_restore_status))) {
LOG_WARN("failed to get restore status", K(ret), KPC(ctx_));
} else if (ls_restore_status.is_in_restore_and_before_quick_restore()) {
} else if (ls_restore_status.is_before_restore_to_consistent_scn()) {
need_wait = false;
}
return ret;

View File

@ -2166,10 +2166,6 @@ int ObLSRestoreConsistentScnState::set_empty_for_transfer_tablets_()
LOG_WARN("failed to get tablet status", K(ret), KPC(tablet));
} else if (!is_commited && ObTabletStatus::TRANSFER_IN == user_data.tablet_status_.get_status()) {
LOG_INFO("skip tablet which transfer in not commit", "tablet_id", tablet->get_tablet_meta().tablet_id_, K(user_data));
} else if (!tablet->get_tablet_meta().ha_status_.is_restore_status_full()) {
LOG_INFO("skip tablet which restore status is not full",
"tablet_id", tablet->get_tablet_meta().tablet_id_,
"ha_status", tablet->get_tablet_meta().ha_status_);
} else if (OB_FAIL(ls_->update_tablet_restore_status(tablet->get_tablet_meta().tablet_id_,
restore_status,
true/* need reset tranfser flag */))) {

View File

@ -534,9 +534,9 @@ int ObTabletReplayCreateHandler::record_ls_transfer_info_(
LOG_INFO("The log stream does not need to record transfer_info", "ls_id", ls->get_ls_id(), K(current_migration_status), K(new_migration_status));
} else if (OB_FAIL(ls->get_restore_status(ls_restore_status))) {
LOG_WARN("failed to get ls restore status", K(ret), KPC(ls));
} else if (ls_restore_status.is_in_restore_and_before_quick_restore()) {
LOG_INFO("the log stream in restore and before quick restore, no need to record transfer info", "ls_id", ls->get_ls_id(), K(ls_restore_status));
} else if (!tablet_transfer_info.has_transfer_table()) {
} else if (ls_restore_status.is_before_restore_to_consistent_scn()) {
LOG_INFO("the log stream in restore is before restore to consistent scn, no need to record transfer info", "ls_id", ls->get_ls_id(), K(ls_restore_status));
}else if (!tablet_transfer_info.has_transfer_table()) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("tablet should have transfer table", K(ret), "ls_id", ls->get_ls_id(), K(tablet_id), K(tablet_transfer_info));
} else if (ls->get_ls_startup_transfer_info().is_valid()) {