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


##########
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:
   Fixed. The branch now gates `req.setDeleteManagedDir(false)` on the 
per-table `isSoftDelete` we computed above, matching the server-side 
`TxnUtils.isTableSoftDeleteEnabled(table, request.isSoftDelete())` semantics. 
End-to-end guard added in 
`testDropDatabaseCascadeKeepsManagedDirForSoftDeleteTables`.



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