wecharyu commented on code in PR #5851:
URL: https://github.com/apache/hive/pull/5851#discussion_r2663925780


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -1865,18 +1592,65 @@ public void drop_database_req(final DropDatabaseRequest 
req)
       throw new MetaException("Can not drop " + DEFAULT_DATABASE_NAME + " 
database in catalog " 
         + DEFAULT_CATALOG_NAME);
     }
-    boolean success = false;
+
     Exception ex = null;
     try {
-      drop_database_core(getMS(), req);
-      success = true;
+      AbstractOperationHandler<DropDatabaseRequest, 
DropDatabaseHandler.DropDatabaseResult> dropDatabaseOp =
+          AbstractOperationHandler.offer(this, req);
+      AbstractOperationHandler.OperationStatus status = 
dropDatabaseOp.getOperationStatus();
+      if (status.isFinished() && dropDatabaseOp.getResult() != null && 
dropDatabaseOp.getResult().isSuccess()) {
+        DropDatabaseHandler.DropDatabaseResult result = 
dropDatabaseOp.getResult();
+        for (Path funcCmPath : result.getFunctionCmPaths()) {
+          wh.addToChangeManagement(funcCmPath);
+        }
+        if (req.isDeleteData()) {
+          // Moving the data deletion out of the async handler.

Review Comment:
   `FileSystem.closeAllForUGI(clientUgi);` in `TUGIAssumingProcessor` seems a 
bug, assume that there are two requests with same ugi to handle the same path 
uri concurrently, it may also hit the "Filesystem closed" issue.
   
   This is indeed a tricky problem, not sure if we can only remove cache for 
inactive ugi to solve it. And for this thread, it still has an issue if the 
client crush between two pings before the operation handler finished, the 
cleanup code will not take effect either.



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