LuciferYang opened a new pull request, #13398:
URL: https://github.com/apache/gravitino/pull/13398

   ### What changes were proposed in this pull request?
   
   `OwnerManager.setOwners` now calls 
`notifyOwnerChange(originOwner.orElse(null), metalake, mo)` unconditionally, 
instead of only when a previous owner exists. This aligns the batch path with 
the single-object `setOwner` path.
   
   ### Why are the changes needed?
   
   The batch path skipped the authorizer notification when setting the first 
owner on an ownerless object, for example the automatic owner assignment when a 
schema is created, so a custom `GravitinoAuthorizer` never received 
`handleMetadataOwnerChange` for that case. The SPI contract documents 
`oldOwnerId` as `null` on the first owner, and the single-object path already 
behaves that way.
   
   Fix: #13397
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Added `TestOwnerManager.testInitialOwnerSetByBatchNotifiesAuthorizer`, which 
pins that a first-owner assignment through `setOwners` notifies the authorizer 
with a `null` old owner. It fails against the pre-fix code.
   


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