jerryshao opened a new issue, #13311:
URL: https://github.com/apache/gravitino/issues/13311

   ### Describe the subtask
   
   On `branch-1.3`:
   
   - `TagMetaService.deleteTag` soft-deletes the tag row first, then calls 
`softDeleteTagMetadataObjectRelsByMetalakeAndTagName`. That SQL joins on 
`tm.deleted_at = 0`, so it matches nothing, and the tag's object relations stay 
live. The tag's owner and securable objects are not cleaned either.
   - `PolicyMetaService.deletePolicy` deletes only the policy and its versions. 
`softDeletePolicyMetadataObjectRelsByMetalakeAndPolicyName` is never called, 
and the owner and securable objects are left behind.
   
   `branch-1.3` has no orphan relation GC, so these rows stay forever. `main` 
already cleans them by tag or policy id (added with the OCC work in #12781 / 
#12782). That work can't be cherry-picked, so this change ports the cleanup by 
hand.
   
   Proposed fix: resolve the tag or policy id first, then soft-delete its 
object relations, owner and securable objects in the same transaction. Add 
tests.
   
   Target: `branch-1.3` only.
   
   ### Parent issue
   
   #13303
   


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