Fix master allow replay clog different condition with 42x

This commit is contained in:
godyangfight
2024-03-05 12:48:16 +00:00
committed by ob-robot
parent f962c10847
commit 5a32671bdb
6 changed files with 5 additions and 39 deletions

View File

@ -612,7 +612,8 @@ bool ObMigrationStatusHelper::check_migration_status_is_fail_(const ObMigrationS
bool ObMigrationStatusHelper::need_online(const ObMigrationStatus &cur_status)
{
return (OB_MIGRATION_STATUS_NONE == cur_status);
return (OB_MIGRATION_STATUS_NONE == cur_status
|| OB_MIGRATION_STATUS_GC == cur_status);
}
bool ObMigrationStatusHelper::check_allow_gc_abandoned_ls(const ObMigrationStatus &cur_status)
@ -835,16 +836,6 @@ int ObMigrationStatusHelper::check_migration_in_final_state(
return ret;
}
bool ObMigrationStatusHelper::can_gc_ls_without_check_dependency(
const ObMigrationStatus &cur_status)
{
bool allow_gc = false;
if (check_migration_status_is_fail_(cur_status)) {
allow_gc = true;
}
return allow_gc;
}
/******************ObMigrationOpArg*********************/
ObMigrationOpArg::ObMigrationOpArg()
: ls_id_(),

View File

@ -99,8 +99,6 @@ public:
const ObMigrationStatus &status,
bool &in_final_state);
static bool check_is_running_migration(const ObMigrationStatus &cur_status);
static bool can_gc_ls_without_check_dependency(
const ObMigrationStatus &cur_status);
private:
static int check_ls_transfer_tablet_(
const share::ObLSID &ls_id,

View File

@ -448,25 +448,6 @@ bool ObLS::is_create_committed() const
return (persistent_state.is_normal_state() || persistent_state.is_ha_state());
}
bool ObLS::is_need_gc() const
{
int ret = OB_SUCCESS;
bool bool_ret = false;
ObMigrationStatus migration_status;
ObLSPersistentState create_status = ls_meta_.get_persistent_state();
if (create_status.is_need_gc()) {
bool_ret = true;
} else if (OB_FAIL(ls_meta_.get_migration_status(migration_status))) {
LOG_WARN("get migration status failed", K(ret), K(ls_meta_.ls_id_));
} else if (ObMigrationStatusHelper::can_gc_ls_without_check_dependency(migration_status)) {
bool_ret = true;
}
if (bool_ret) {
FLOG_INFO("ls need gc", K(bool_ret), K(create_status), K(migration_status));
}
return bool_ret;
}
bool ObLS::is_clone_first_step() const
{
int ret = OB_SUCCESS;
@ -1703,13 +1684,8 @@ int ObLS::finish_slog_replay()
LOG_WARN("failed to set migration status", K(ret), K(new_migration_status));
} else if (OB_FAIL(running_state_.create_finish(ls_meta_.ls_id_))) {
LOG_WARN("create finish failed", KR(ret), K(ls_meta_));
} else if (is_need_gc()) {
LOG_INFO("this ls should be gc later", KPC(this));
// ls will be gc later and tablets in the ls are not complete,
// so skip the following steps, otherwise load_ls_inner_tablet maybe encounter error.
} else {
// after slog replayed, the ls must be offlined state.
ls_tablet_svr_.enable_to_read();
update_state_seq_();
}
return ret;

View File

@ -308,7 +308,6 @@ public:
int finish_create_ls();
bool is_create_committed() const;
bool is_need_gc() const;
bool is_in_gc();
bool is_restore_first_step() const;
bool is_clone_first_step() const;

View File

@ -813,7 +813,7 @@ int ObLSMeta::get_create_type(int64_t &create_type) const
if (!is_valid()) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("log stream meta is not valid, cannot get restore status", K(ret), K(*this));
} else if (ObMigrationStatus::OB_MIGRATION_STATUS_NONE != migration_status_) {
} else if (!ObMigrationStatusHelper::need_online(migration_status_)) {
create_type = ObLSCreateType::MIGRATE;
} else if (restore_status_.is_in_clone()) {
create_type = ObLSCreateType::CLONE;

View File

@ -471,6 +471,8 @@ int ObLSService::post_create_ls_(const int64_t create_type,
case ObLSCreateType::NORMAL: {
if (OB_FAIL(ls->set_start_work_state())) {
LOG_ERROR("ls set start work state failed", KR(ret), KPC(ls));
} else {
ls->enable_to_read();
}
break;
}