[CP] Fix connection hang when schema is not refreshed
This commit is contained in:
parent
f163f7280c
commit
5c33a662ae
@ -1296,6 +1296,11 @@ int ObMPConnect::get_tenant_id(uint64_t &tenant_id)
|
||||
ret = OB_NOT_SUPPORTED;
|
||||
LOG_WARN("can't login meta tenant", KR(ret), K_(tenant_name), K(tenant_id));
|
||||
LOG_USER_ERROR(OB_NOT_SUPPORTED, "login meta tenant");
|
||||
} else if (!gctx_.schema_service_->is_tenant_refreshed(tenant_id)) {
|
||||
ret = OB_SERVER_IS_INIT;
|
||||
LOG_WARN("tenant schema not refreshed yet", KR(ret), K(tenant_id));
|
||||
} else {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3613,6 +3613,18 @@ bool ObMultiVersionSchemaService::is_tenant_not_refreshed(const uint64_t tenant_
|
||||
return schema_not_refreshed;
|
||||
}
|
||||
|
||||
// for obmp_connect
|
||||
bool ObMultiVersionSchemaService::is_tenant_refreshed(const uint64_t tenant_id) const
|
||||
{
|
||||
bool bret = false;
|
||||
bool schema_not_refreshed = false;
|
||||
int ret = refresh_full_schema_map_.get_refactored(tenant_id, schema_not_refreshed);
|
||||
if (OB_SUCC(ret)) {
|
||||
bret = !schema_not_refreshed;
|
||||
}
|
||||
return bret;
|
||||
}
|
||||
|
||||
// sql should retry when tenant is normal but never refresh schema successfully.
|
||||
bool ObMultiVersionSchemaService::is_schema_error_need_retry(
|
||||
ObSchemaGetterGuard *guard,
|
||||
|
@ -241,6 +241,7 @@ public:
|
||||
bool is_tenant_full_schema(const uint64_t tenant_id) const;
|
||||
|
||||
bool is_tenant_not_refreshed(const uint64_t tenant_id);
|
||||
bool is_tenant_refreshed(const uint64_t tenant_id) const;
|
||||
|
||||
// sql should retry when tenant is normal but never refresh schema successfully.
|
||||
bool is_schema_error_need_retry(
|
||||
|
Loading…
x
Reference in New Issue
Block a user