fix ddl task when the tenant switch to standby

This commit is contained in:
simonjoylet
2023-03-03 09:13:52 +00:00
committed by ob-robot
parent 730345eeb7
commit c6e23516d2
23 changed files with 259 additions and 91 deletions

View File

@ -820,6 +820,7 @@ int ObDDLTask::switch_status(const ObDDLTaskStatus new_status, const bool enable
int ret = OB_SUCCESS;
int tmp_ret = OB_SUCCESS;
bool is_cancel = false;
bool is_standby_tenant = false;
int real_ret_code = ret_code;
bool is_tenant_dropped = false;
ObDDLTaskStatus real_new_status = new_status;
@ -847,6 +848,11 @@ int ObDDLTask::switch_status(const ObDDLTaskStatus new_status, const bool enable
} else if (is_tenant_dropped) {
need_retry_ = false;
LOG_INFO("tenant has been dropped, exit anyway", K(ret), K(tenant_id_));
} else if (OB_FAIL(ObAllTenantInfoProxy::is_standby_tenant(&root_service->get_sql_proxy(), tenant_id_, is_standby_tenant))) {
LOG_WARN("check is standby tenant failed", K(ret), K(tenant_id_));
} else if (is_standby_tenant) {
need_retry_ = false;
LOG_INFO("tenant is standby, exit anyway", K(ret), K(tenant_id_));
} else if (OB_FAIL(trans.start(&root_service->get_sql_proxy(), tenant_id_))) {
LOG_WARN("start transaction failed", K(ret));
} else {