loquisgon commented on code in PR #12392:
URL: https://github.com/apache/druid/pull/12392#discussion_r847832575


##########
server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java:
##########
@@ -426,6 +426,17 @@ private CoordinatorStats doRun(
         if (config.getIoConfig() != null) {
           dropExisting = config.getIoConfig().isDropExisting();
         }
+        // force dropExisting to true if dropExisting is not set,
+        // dropExistingis false,
+        // or all segments to compact are tombstones.
+        // Otherwise, auto-compaction will cycle indefinitely since segments 
won't be compacted and their
+        // compaction state won't be set

Review Comment:
   Also, it looks like the code could be written without forcing dropExisting 
to true by entering the tombstone creation code in the sequential & parallel 
task by adding another condition that checks whether the task is a compaction 
task and there are no pushed segments (i.e. only tombstones) :  
`ingestionSchema.getIOConfig().isDropExisting() || (storeCompactionState && 
pushed.getSegments().isEmpty())`. But the code will need to be updated in two 
places and it is also somewhat messy. Looks less messy if we just force the 
flag...



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