keith-turner commented on code in PR #5588:
URL: https://github.com/apache/accumulo/pull/5588#discussion_r2116705387


##########
core/src/main/java/org/apache/accumulo/core/spi/compaction/DefaultCompactionPlanner.java:
##########
@@ -307,6 +309,19 @@ public CompactionPlan makePlan(PlanningParameters params) {
         group = findDataFilesToCompact(filesCopy, params.getRatio(), 
maxFilesToCompact,
             maxSizeToCompact);
 
+        while (!group.isEmpty() && !Collections.disjoint(group, 
expectedFiles)) {
+          // remove these files as compaction candidates because they include 
a file that a running
+          // compaction would produce
+          filesCopy.removeAll(group);
+          // Create a fake file+size entry that predicts what this projected 
compaction would
+          // produce
+          var futureFile = getExpectedFile(group, nextExpected);
+          Preconditions.checkState(expectedFiles.add(futureFile));
+          // look for any compaction work in the remaining set of files
+          group = findDataFilesToCompact(filesCopy, params.getRatio(), 
maxFilesToCompact,
+              maxSizeToCompact);
+        }
+

Review Comment:
   Yeah in most cases it probably will end up being empty.   When its empty it 
means no work was found that meets the compaction ratio.  When its not empty 
and exits the loop it means work was found that meets the compaction ratio and 
would not use the result of a running compaction.  This second case is more 
likely to occur when a tablet has built up a lot of files and has running 
compactions, so this will probably not be the norm.  



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to