jerryshao commented on code in PR #14787:
URL: https://github.com/apache/gravitino/pull/14787#discussion_r4512094630


##########
core/src/main/java/org/apache/gravitino/authorization/OwnerManager.java:
##########
@@ -111,6 +111,12 @@ public void setOwner(
               authorizationPlugin.onOwnerSet(metadataObject, 
originOwner.orElse(null), newOwner));
       notifyOwnerChange(originOwner.orElse(null), metalake, metadataObject);
     } catch (NoSuchEntityException nse) {
+      // The object existed when getOwner ran, so it can have been dropped 
since then. Only a
+      // live owner proves that; otherwise keep reporting that either side may 
be missing.
+      if (ownerExists(metalake, ownerName, ownerType)) {

Review Comment:
   The owner-exists check is a heuristic: if the owner is also removed between 
the failure and this check, the caller gets the generic NotFoundException and 
create fails again. This is a very narrow race and acceptable, but a short 
comment saying so would help.



-- 
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]

Reply via email to