adarshsanjeev commented on code in PR #14446:
URL: https://github.com/apache/druid/pull/14446#discussion_r1243167633


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -88,13 +88,22 @@ public void run() throws Exception
                                            .map(TaskRunnerWorkItem::getTaskId)
                                            
.map(DurableStorageUtils::getControllerDirectory)
                                            .collect(Collectors.toSet());
+    Set<String> knownTaskIds = taskRunner.getKnownTasks()
+                                         .stream()
+                                         .map(TaskRunnerWorkItem::getTaskId)
+                                         
.map(DurableStorageUtils::getControllerDirectory)
+                                         .collect(Collectors.toSet());
 
     Set<String> filesToRemove = new HashSet<>();
     while (allFiles.hasNext()) {
       String currentFile = allFiles.next();
-      String taskIdFromPathOrEmpty = 
DurableStorageUtils.getControllerTaskIdWithPrefixFromPath(currentFile);
-      if (taskIdFromPathOrEmpty != null && !taskIdFromPathOrEmpty.isEmpty()) {
-        if (runningTaskIds.contains(taskIdFromPathOrEmpty)) {
+      String nextDirName = 
DurableStorageUtils.getNextDirNameWithPrefixFromPath(currentFile);
+      if (nextDirName != null && !nextDirName.isEmpty()) {
+        if (runningTaskIds.contains(nextDirName)) {
+          // do nothing
+        } else if (DurableStorageUtils.QUERY_RESULTS_DIR.equals(nextDirName)

Review Comment:
   I did not understand what you meant here, current file would be something 
inside "unknown id", so it would add that file to the list to delete. (We only 
delete individual files in the cleaner, the storage connector does not allow us 
to delete directories with the function called)  



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