Fix transfer src ls do not start replay clog when it is already remove from member list.
This commit is contained in:
@ -834,6 +834,16 @@ int ObMigrationStatusHelper::check_migration_in_final_state(
|
|||||||
return ret;
|
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::ObMigrationOpArg()
|
ObMigrationOpArg::ObMigrationOpArg()
|
||||||
: ls_id_(),
|
: ls_id_(),
|
||||||
|
|||||||
@ -98,6 +98,8 @@ public:
|
|||||||
const ObMigrationStatus &status,
|
const ObMigrationStatus &status,
|
||||||
bool &in_final_state);
|
bool &in_final_state);
|
||||||
static bool check_is_running_migration(const ObMigrationStatus &cur_status);
|
static bool check_is_running_migration(const ObMigrationStatus &cur_status);
|
||||||
|
static bool can_gc_ls_without_check_dependency(
|
||||||
|
const ObMigrationStatus &cur_status);
|
||||||
private:
|
private:
|
||||||
static int check_ls_transfer_tablet_(
|
static int check_ls_transfer_tablet_(
|
||||||
const share::ObLSID &ls_id,
|
const share::ObLSID &ls_id,
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
#include "ob_transfer_service.h"
|
#include "ob_transfer_service.h"
|
||||||
#include "storage/tx_storage/ob_ls_handle.h"
|
#include "storage/tx_storage/ob_ls_handle.h"
|
||||||
#include "observer/ob_server_struct.h"
|
#include "observer/ob_server_struct.h"
|
||||||
|
#include "storage/slog_ckpt/ob_server_checkpoint_slog_handler.h"
|
||||||
|
|
||||||
namespace oceanbase
|
namespace oceanbase
|
||||||
{
|
{
|
||||||
@ -130,7 +131,7 @@ void ObTransferService::run1()
|
|||||||
|
|
||||||
while (!has_set_stop()) {
|
while (!has_set_stop()) {
|
||||||
ls_id_array_.reset();
|
ls_id_array_.reset();
|
||||||
if (observer::ObServiceStatus::SS_SERVING != GCTX.status_) {
|
if (!ObServerCheckpointSlogHandler::get_instance().is_started()) {
|
||||||
ret = OB_SERVER_IS_INIT;
|
ret = OB_SERVER_IS_INIT;
|
||||||
LOG_WARN("server is not serving", K(ret), K(GCTX.status_));
|
LOG_WARN("server is not serving", K(ret), K(GCTX.status_));
|
||||||
} else if (OB_FAIL(get_ls_id_array_())) {
|
} else if (OB_FAIL(get_ls_id_array_())) {
|
||||||
|
|||||||
@ -458,7 +458,7 @@ bool ObLS::is_need_gc() const
|
|||||||
bool_ret = true;
|
bool_ret = true;
|
||||||
} else if (OB_FAIL(ls_meta_.get_migration_status(migration_status))) {
|
} else if (OB_FAIL(ls_meta_.get_migration_status(migration_status))) {
|
||||||
LOG_WARN("get migration status failed", K(ret), K(ls_meta_.ls_id_));
|
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;
|
bool_ret = true;
|
||||||
}
|
}
|
||||||
if (bool_ret) {
|
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))) {
|
} 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));
|
LOG_WARN("failed to set migration status", K(ret), K(change_status));
|
||||||
} else {
|
} else {
|
||||||
ls_tablet_svr_.disable_to_read();
|
|
||||||
allow_gc = true;
|
allow_gc = true;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user