Copilot commented on code in PR #6991:
URL: https://github.com/apache/hive/pull/6991#discussion_r4773502994


##########
standalone-metastore/metastore-client/src/main/java/org/apache/hadoop/hive/metastore/client/HookEnabledMetaStoreClient.java:
##########
@@ -265,7 +265,11 @@ private void 
dropDatabaseCascadePerTable(DropDatabaseRequest req, List<String> t
         // The correct way to propagate txnId is passing EnvironmentContext to 
underlying clients.
         // However, to prevent adding one more method in IMetaStoreClient, we 
hack Table object here.
         table.setTxnId(req.getTxnId());
-        req.setDeleteManagedDir(false);
+        // deleteManagedDir=false is a soft-delete semantic (async ACID 
cleaner); don't apply
+        // it to plain cascade drops or the managed dir leaks (HIVE-30284).
+        if (req.isSoftDelete()) {
+          req.setDeleteManagedDir(false);

Review Comment:
   This condition needs to use the per-table `isSoftDelete` value computed 
above, not the request-wide flag. `req.isSoftDelete()` is enabled for 
lockless-read sessions even when a database contains ordinary managed tables; 
in that mixed case this branch still sets the shared request's 
`deleteManagedDir` to false, so the final `delegate.dropDatabase(req)` can leak 
the managed database directory. The server-side cascade path already applies 
this semantic only when `TxnUtils.isTableSoftDeleteEnabled(table, 
request.isSoftDelete())` is true.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to