zuston commented on code in PR #2084:
URL: 
https://github.com/apache/incubator-uniffle/pull/2084#discussion_r1740367583


##########
server/src/main/java/org/apache/uniffle/server/storage/HadoopStorageManager.java:
##########
@@ -99,6 +138,11 @@ public Storage selectStorage(ShuffleDataReadEvent event) {
 
   @Override
   public void removeResources(PurgeEvent event) {
+    removeResources(event, false);
+  }
+
+  @Override
+  public void removeResources(PurgeEvent event, boolean isQuick) {

Review Comment:
   Could we make the `softDeletion/isQuick` as the internal variable in the 
PurgeEvent? 



##########
server/src/main/java/org/apache/uniffle/server/storage/HadoopStorageManager.java:
##########
@@ -65,12 +68,48 @@ public class HadoopStorageManager extends 
SingleStorageManager {
   private Map<String, HadoopStorage> appIdToStorages = 
JavaUtils.newConcurrentMap();
   private Map<String, HadoopStorage> pathToStorages = 
JavaUtils.newConcurrentMap();
   private final boolean isStorageAuditLogEnabled;
+  private final BlockingQueue<AsynchronousDeleteEvent> quickNeedDeletePaths =
+      Queues.newLinkedBlockingQueue();
+  private Thread clearNeedDeleteLocalPathThread;
 
   HadoopStorageManager(ShuffleServerConf conf) {
     super(conf);
     hadoopConf = conf.getHadoopConf();
     shuffleServerId = conf.getString(ShuffleServerConf.SHUFFLE_SERVER_ID, 
"shuffleServerId");
     isStorageAuditLogEnabled = 
conf.getBoolean(ShuffleServerConf.SERVER_STORAGE_AUDIT_LOG_ENABLED);
+    Runnable clearNeedDeletePathTask =

Review Comment:
   Why not intergrating this part async deletion into the underlying class like 
SingleStorageManager for localfile and hadoop storage type to share



##########
server/src/main/java/org/apache/uniffle/server/storage/HadoopStorageManager.java:
##########
@@ -149,7 +193,19 @@ public void removeResources(PurgeEvent event) {
                   storage.getStoragePath()));
         }
       }
-      deleteHandler.delete(deletePaths.toArray(new String[0]), appId, 
event.getUser());
+      if (isQuick) {
+        AsynchronousDeleteEvent asynchronousDeleteEvent =
+            new AsynchronousDeleteEvent(
+                appId, event.getUser(), storage.getConf(), 
event.getShuffleIds(), deletePaths);
+        deleteHandler.quickDelete(asynchronousDeleteEvent);
+        boolean isSucess = quickNeedDeletePaths.offer(asynchronousDeleteEvent);
+        if (!isSucess) {
+          LOG.warn(

Review Comment:
   This is abnormal that will make the data leaked. For this case, the metrics 
should be added for better observability



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