BUGFIX: fix restore ls state after restart

This commit is contained in:
obdev
2023-12-18 19:43:05 +00:00
committed by ob-robot
parent e09eb1c0be
commit 14cdc89246
11 changed files with 112 additions and 107 deletions

View File

@ -88,6 +88,13 @@ bool ObLSRestoreStatus::is_valid_(int32_t status) const
}
#undef LS_RESTORE_STATUS_CASE_TO_TYPE
bool ObLSRestoreStatus::need_online() const
{
return ((status_ >= WAIT_RESTORE_SYS_TABLETS
&& status_ <= WAIT_RESTORE_MAJOR_DATA)
|| status_ == NONE
|| status_ == CLONE_CLOG_REPLAY);
}
int ObLSRestoreStatus::set_status(int32_t status)
{

View File

@ -110,7 +110,9 @@ public:
}
// offline ls and enable sync and online ls restore handler in [RESTORE_START, RESTORE_SYS_TABLETS] or RESTORE_FAILED
bool is_required_to_switch_ls_state_for_restore() const
bool need_online() const;
// enable sync and online ls restore handler in [RESTORE_START, RESTORE_SYS_TABLETS] or RESTORE_FAILED
bool is_restore_first_step() const
{
return ((status_ >= Status::RESTORE_START && status_ <= Status::RESTORE_SYS_TABLETS) ||
status_ == Status::RESTORE_FAILED);
@ -122,7 +124,7 @@ public:
{
return status_ >= Status::CLONE_START && status_ <= Status::CLONE_COPY_ALL_TABLET_META;
}
bool is_required_to_switch_ls_state_for_clone() const
bool is_clone_first_step() const
{
return ((status_ >= Status::CLONE_START && status_ <= Status::CLONE_COPY_LS_META) ||
Status::CLONE_FAILED == status_);