[IMPROVE] no need to wait dropped tenant to refresh schema when restart server
This commit is contained in:
parent
678cef5852
commit
8cf8db5b97
@ -3181,7 +3181,6 @@ int ObServer::reload_bandwidth_throttle_limit(int64_t network_speed)
|
||||
|
||||
void ObServer::check_user_tenant_schema_refreshed(const ObIArray<uint64_t> &tenant_ids, const int64_t expire_time)
|
||||
{
|
||||
bool is_dropped = false;
|
||||
int ret = OB_SUCCESS;
|
||||
uint64_t tenant_id = OB_INVALID_TENANT_ID;
|
||||
LOG_DBA_INFO_V2(OB_SERVER_CHECK_USER_TENANT_SCHEMA_REFRESHED_BEGIN,
|
||||
@ -3194,19 +3193,21 @@ void ObServer::check_user_tenant_schema_refreshed(const ObIArray<uint64_t> &tena
|
||||
if (OB_ISNULL(gctx_.schema_service_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("schema service is NULL", KR(ret));
|
||||
} else if (OB_FAIL(gctx_.schema_service_->check_if_tenant_has_been_dropped(tenant_id, is_dropped))) {
|
||||
LOG_WARN("fail to check tenant has been dropped at observer startup", KR(ret), K(tenant_id));
|
||||
} else if (is_dropped) {
|
||||
// ignore
|
||||
} else {
|
||||
bool is_dropped = false;
|
||||
bool tenant_schema_refreshed = false;
|
||||
while (!tenant_schema_refreshed
|
||||
&& !stop_
|
||||
&& !is_dropped
|
||||
&& ObTimeUtility::current_time() < expire_time) {
|
||||
|
||||
tenant_schema_refreshed = is_user_tenant(tenant_id) ?
|
||||
gctx_.schema_service_->is_tenant_refreshed(tenant_id) : true;
|
||||
if (!tenant_schema_refreshed) {
|
||||
if (OB_FAIL(gctx_.schema_service_->check_if_tenant_has_been_dropped(tenant_id, is_dropped))) {
|
||||
LOG_WARN("fail to check tenant has been dropped at observer startup", KR(ret), K(tenant_id));
|
||||
} else if (is_dropped) {
|
||||
// ignore
|
||||
} else if (!tenant_schema_refreshed) {
|
||||
// check wait and retry
|
||||
usleep(1000 * 1000);
|
||||
if (REACH_TIME_INTERVAL(10 * 1000 * 1000)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user