[SCHEMA] Optimize performance for refreshing full schema

This commit is contained in:
tino247
2023-07-20 04:12:12 +00:00
committed by ob-robot
parent e3839f900d
commit c48de8739b
7 changed files with 218 additions and 27 deletions

View File

@ -1785,6 +1785,7 @@ int ObMultiVersionSchemaService::broadcast_tenant_schema(
}
ObArray<ObSimpleTableSchemaV2> simple_table_schemas;
ObSchemaMgr *schema_mgr_for_cache = NULL;
const bool refresh_full_schema = true;
if (FAILEDx(convert_to_simple_schema(table_schemas, simple_table_schemas))) {
LOG_WARN("failed to convert", KR(ret), K(tenant_id));
} else if (OB_FAIL(schema_mgr_for_cache_map_.get_refactored(
@ -1793,7 +1794,7 @@ int ObMultiVersionSchemaService::broadcast_tenant_schema(
} else if (OB_ISNULL(schema_mgr_for_cache)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("schema_mgr is null", KR(ret), K(tenant_id));
} else if (OB_FAIL(schema_mgr_for_cache->add_tables(simple_table_schemas))) {
} else if (OB_FAIL(schema_mgr_for_cache->add_tables(simple_table_schemas, refresh_full_schema))) {
LOG_WARN("failed to add tables", KR(ret), K(tenant_id));
} else if (FALSE_IT(schema_mgr_for_cache->set_schema_version(
OB_CORE_SCHEMA_VERSION + 1))) {