yuqi1129 commented on code in PR #2873:
URL: https://github.com/apache/gravitino/pull/2873#discussion_r1974892204
##########
core/src/main/java/org/apache/gravitino/catalog/SchemaOperationDispatcher.java:
##########
@@ -201,68 +213,73 @@ public Schema loadSchema(NameIdentifier ident) throws
NoSuchSchemaException {
@Override
public Schema alterSchema(NameIdentifier ident, SchemaChange... changes)
throws NoSuchSchemaException {
- validateAlterProperties(ident,
HasPropertyMetadata::schemaPropertiesMetadata, changes);
NameIdentifier catalogIdent = getCatalogIdentifier(ident);
- Schema alteredSchema =
- doWithCatalog(
- catalogIdent,
- c -> c.doWithSchemaOps(s -> s.alterSchema(ident, changes)),
- NoSuchSchemaException.class);
-
- // If the Schema is maintained by the Gravitino's store, we don't have to
alter again.
- boolean isManagedSchema = isManagedEntity(catalogIdent,
Capability.Scope.SCHEMA);
- if (isManagedSchema) {
- return EntityCombinedSchema.of(alteredSchema)
- .withHiddenProperties(
- getHiddenPropertyNames(
+ return TreeLockUtils.doWithTreeLock(
+ NameIdentifier.of(ident.namespace().levels()),
Review Comment:
Let me verify this and check if this can be applied to catalogs, tables, and
other objects.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]