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

   ### What changes were proposed in this pull request?
   
   The metalake cascade cleanup statements for `securable_object` and 
`tag_relation_meta` no longer filter the parent join on the parent's 
`deleted_at = 0`, in both the base (MySQL/H2) and PostgreSQL providers. The 
join key already scopes membership to the metalake.
   
   ### Why are the changes needed?
   
   The cascade tombstones the role rows and tag rows before these cleanups run, 
in the same transaction. Because a transaction sees its own writes, the parent 
`deleted_at = 0` filter matched no live parent, the update affected zero rows, 
and the `securable_object` and `tag_relation_meta` rows stayed live forever 
with no remaining cleanup path. This left orphaned rows and a storage leak 
after a cascade drop of a metalake that owned roles-with-securable-objects or 
tag assignments. The sibling PolicyTagRel cascade already uses this order-safe 
shape.
   
   Fix: #13522
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Extended `TestMetalakeMetaService` to assert the securable-object and 
tag-relation rows are cleaned up by the cascade, and `TestRoleMetaService` to 
reflect that a securable object is now tombstoned and thus reclaimable by the 
legacy hard delete.


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