提交 ed4e8ef8 编写于 作者: G godyangfight 提交者: ob-robot

Fix rebuild while reboot observer core bug

上级 25d104df
......@@ -1230,6 +1230,10 @@ int ObLS::finish_slog_replay()
// so skip the following steps, otherwise load_ls_inner_tablet maybe encounter error.
} else if (OB_FAIL(start())) {
LOG_WARN("ls can not start to work", K(ret));
} else if (ObMigrationStatus::OB_MIGRATION_STATUS_REBUILD == new_migration_status) {
if (OB_FAIL(offline_())) {
LOG_WARN("failed to offline", K(ret), KPC(this));
}
} else if (is_enable_for_restore()) {
if (OB_FAIL(offline_())) {
LOG_WARN("failed to offline", K(ret), KPC(this));
......
......@@ -689,6 +689,7 @@ int ObLSService::enable_replay()
common::ObSharedGuard<ObLSIterator> ls_iter;
ObLS *ls = nullptr;
share::ObLSRestoreStatus restore_status;
ObMigrationStatus migration_status = ObMigrationStatus::OB_MIGRATION_STATUS_MAX;
if (OB_FAIL(get_ls_iter(ls_iter, ObLSGetMod::TXSTORAGE_MOD))) {
LOG_WARN("failed to get ls iter", K(ret));
} else {
......@@ -702,6 +703,10 @@ int ObLSService::enable_replay()
LOG_ERROR("ls is null", K(ret));
} else if (ls->is_need_gc()) {
// this ls will be gc later, should not enable replay
} else if (OB_FAIL(ls->get_migration_status(migration_status))) {
LOG_WARN("failed to get ls migration status", K(ret));
} else if (ObMigrationStatus::OB_MIGRATION_STATUS_REBUILD == migration_status) {
// ls will online in rebuild process
} else if (OB_FAIL(ls->get_restore_status(restore_status))) {
LOG_WARN("fail to get ls restore status", K(ret));
} else if (!restore_status.can_replay_log()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册