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

   ### What changes were proposed in this pull request?
   
   Added VIEW to the UNION queries in `softDeleteOwnerRelByCatalogId` and 
`softDeleteOwnerRelBySchemaId` in both the base and PostgreSQL SQL providers, 
so that view owner relations are cleaned up during cascade schema/catalog 
deletion.
   
   ### Why are the changes needed?
   
   When a schema or catalog is deleted in cascade mode, the bulk SQL queries 
that soft-delete child owner relations include TABLE, TOPIC, FILESET, and MODEL 
but miss VIEW. This leaves orphaned ("zombie") view owner relation rows in the 
database.
   
   Note: individual view deletion via `ViewMetaService.deleteView()` already 
cleans up owner relations correctly — the bug only affects the cascade path 
from schema/catalog deletion.
   
   Fix: #10458
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Updated `TestOwnerMetaService.testDeleteMetadataObject()` to include view 
entities in all test blocks (individual delete, cascade catalog delete, cascade 
schema delete, delete user). The cascade tests verify that 
`countActiveOwnerRel` drops to 0 after cascade catalog deletion and to 1 (only 
catalog survives) after cascade schema deletion — these assertions would fail 
without the SQL fix.
   
   `./gradlew :core:test --tests "*TestOwnerMetaService*" -PskipITs` passes.


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