roryqi commented on code in PR #12964:
URL: https://github.com/apache/gravitino/pull/12964#discussion_r4035537963
##########
server/src/main/java/org/apache/gravitino/server/web/rest/MetadataObjectPolicyOperations.java:
##########
@@ -237,6 +214,7 @@ public Response listPoliciesForMetadataObject(
}
}
+ @Deprecated
Review Comment:
Follow-up: while the deprecated direct-association API remains in this
compatibility window, the latest revision preserves a compatible read path.
Object-policy lookup now merges legacy direct relations (including parent
inheritance) with tag-derived policies, while resolving tag-derived policies
only once for the requested object. An acknowledged POST is therefore
immediately visible to list/get. The direct APIs will still be removed in the
next PR.
##########
core/src/main/java/org/apache/gravitino/policy/PolicyManager.java:
##########
@@ -295,12 +297,9 @@ public RelationalEntity<?>[]
listTagAssociationsForPolicy(String metalake, Strin
@Override
public PolicyEntity[] listPolicyInfosForMetadataObject(
String metalake, MetadataObject metadataObject) {
- NameIdentifier entityIdent = MetadataObjectUtil.toEntityIdent(metalake,
metadataObject);
- Entity.EntityType entityType =
MetadataObjectUtil.toEntityType(metadataObject);
MetadataObjectUtil.checkMetadataObject(metalake, metadataObject);
checkMetalake(NameIdentifier.of(metalake), entityStore);
-
- return listDirectPoliciesForMetadataObject(entityIdent, entityType,
metadataObject);
+ return objectPolicyResolver.resolve(metalake, metadataObject);
Review Comment:
Thanks for the detailed reproduction. We are not introducing special
handling for concurrent same-name delete/recreate in this PR. The existing
metadata/relation layer generally uses name-based lookup and does not provide
snapshot semantics for this class of race, so fixing only this resolver would
create a one-off consistency guarantee. If this case is supported later, it
should be addressed as a system-wide identity/transaction design rather than
locally here.
--
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]