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

   ### Describe the subtask
   
   The meta services now decide parent/child and emptiness rules inside the 
transaction, but two manager-level lifecycle checks still run outside it. 
TreeLock hides both on one server.
   
   **Non-force drop.** `CatalogManager.dropCatalog(force = false)` checks "in 
use" and lists user-created schemas in the manager, then calls 
`store.delete(ident, CATALOG, cascade = true)`. `MetalakeManager.dropMetalake` 
has the same shape. A schema created between the manager's check and the delete 
is cascaded instead of rejected.
   
   **In-use fan-out.** `MetalakeManager.enableMetalake`/`disableMetalake` 
update the metalake row and then loop over its catalogs updating 
`metalake-in-use` on each row outside any transaction (the code comment still 
says "we can't make sure we can change all catalog properties in a 
transaction"). A concurrent enable/disable or a partial failure leaves catalogs 
that disagree with their metalake.
   
   Proposed change:
   - Pass `cascade = force` down so the non-force path uses the service's 
in-transaction emptiness check (built-in schemas excluded there, as the manager 
does today). For the force path, set a durable `DELETING` state on the parent 
row before enumerating children so no new child is admitted while the external 
cascade runs.
   - In-use: either one transaction (metalake row `FOR UPDATE`, then all 
catalog rows with version checks), or stop copying the flag and derive the 
effective state from the metalake row on read.
   - Tests: child create/enable between the API check and the delete on two 
servers; enable/disable race; partial failure injection.
   
   Design: implementation design Part 2 (M4, M5) and Part 4 (S4). Gate G2.
   
   ### Parent issue
   
   https://github.com/apache/gravitino/issues/10238


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