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


##########
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:
   I think we should move this into the operation handler, because if a thrift 
client only calls this api once in async mode, then such cleanup code would 
never be run.



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