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

Fix transfer src ls do not start replay clog when it is already remove from member list.

上级 27418a80
......@@ -834,6 +834,16 @@ 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_(),
......
......@@ -98,6 +98,8 @@ 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,
......
......@@ -14,6 +14,7 @@
#include "ob_transfer_service.h"
#include "storage/tx_storage/ob_ls_handle.h"
#include "observer/ob_server_struct.h"
#include "storage/slog_ckpt/ob_server_checkpoint_slog_handler.h"
namespace oceanbase
{
......@@ -130,7 +131,7 @@ void ObTransferService::run1()
while (!has_set_stop()) {
ls_id_array_.reset();
if (observer::ObServiceStatus::SS_SERVING != GCTX.status_) {
if (!ObServerCheckpointSlogHandler::get_instance().is_started()) {
ret = OB_SERVER_IS_INIT;
LOG_WARN("server is not serving", K(ret), K(GCTX.status_));
} else if (OB_FAIL(get_ls_id_array_())) {
......
......@@ -458,7 +458,7 @@ bool ObLS::is_need_gc() const
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::check_allow_gc_abandoned_ls(migration_status)) {
} else if (ObMigrationStatusHelper::can_gc_ls_without_check_dependency(migration_status)) {
bool_ret = true;
}
if (bool_ret) {
......@@ -2510,7 +2510,6 @@ int ObLS::set_ls_migration_gc(
} else if (OB_FAIL(ls_meta_.set_migration_status(change_status, write_slog))) {
LOG_WARN("failed to set migration status", K(ret), K(change_status));
} else {
ls_tablet_svr_.disable_to_read();
allow_gc = true;
}
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册