diff --git a/src/rootserver/restore/ob_restore_scheduler.cpp b/src/rootserver/restore/ob_restore_scheduler.cpp index 75192252fa..476af658e7 100644 --- a/src/rootserver/restore/ob_restore_scheduler.cpp +++ b/src/rootserver/restore/ob_restore_scheduler.cpp @@ -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()))) { diff --git a/src/share/ob_debug_sync_point.h b/src/share/ob_debug_sync_point.h index 1b3c2f0a26..48bc4c252c 100755 --- a/src/share/ob_debug_sync_point.h +++ b/src/share/ob_debug_sync_point.h @@ -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,)\ diff --git a/src/share/restore/ob_ls_restore_status.h b/src/share/restore/ob_ls_restore_status.h index 4919de39a2..9c1466b21a 100644 --- a/src/share/restore/ob_ls_restore_status.h +++ b/src/share/restore/ob_ls_restore_status.h @@ -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); diff --git a/src/storage/high_availability/ob_ls_complete_migration.cpp b/src/storage/high_availability/ob_ls_complete_migration.cpp index 1ec5ee121a..262b4b5f14 100644 --- a/src/storage/high_availability/ob_ls_complete_migration.cpp +++ b/src/storage/high_availability/ob_ls_complete_migration.cpp @@ -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; diff --git a/src/storage/restore/ob_ls_restore_handler.cpp b/src/storage/restore/ob_ls_restore_handler.cpp index 7c59f269b7..d78cb0b4e1 100644 --- a/src/storage/restore/ob_ls_restore_handler.cpp +++ b/src/storage/restore/ob_ls_restore_handler.cpp @@ -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 */))) { diff --git a/src/storage/slog_ckpt/ob_tablet_replay_create_handler.cpp b/src/storage/slog_ckpt/ob_tablet_replay_create_handler.cpp index 111aecbed7..af54168247 100644 --- a/src/storage/slog_ckpt/ob_tablet_replay_create_handler.cpp +++ b/src/storage/slog_ckpt/ob_tablet_replay_create_handler.cpp @@ -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()) {