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


##########
server/base/src/main/java/org/apache/accumulo/server/compaction/CompactionJobGenerator.java:
##########
@@ -205,9 +209,22 @@ private Collection<CompactionJob> 
planCompactions(CompactionServiceId serviceId,
         // remove any files that are in active compactions
         tablet.getExternalCompactions().values().stream().flatMap(ecm -> 
ecm.getJobFiles().stream())
             .forEach(tmpFiles::remove);
-        // remove any files that are selected
-        if (tablet.getSelectedFiles() != null) {
-          tmpFiles.keySet().removeAll(tablet.getSelectedFiles().getFiles());
+        // remove any files that are selected and the user compaction has 
completed
+        // at least 1 job, otherwise we can keep the files
+        var selectedFiles = tablet.getSelectedFiles();
+
+        if (selectedFiles != null) {
+          long selectedExpirationDuration =
+              
ConfigurationTypeHelper.getTimeInMillis(env.getConfiguration(tablet.getTableId())
+                  
.get(Property.TABLE_COMPACTION_SELECTION_EXPIRATION.getKey()));
+
+          // If jobs are completed, or selected time has not expired, the 
remove
+          // from the candidate list otherwise we can cancel the selection
+          if (selectedFiles.getCompletedJobs() > 0 || 
(selectedFiles.getSelectedTime() != null

Review Comment:
   Those sound like good validations to add to the SelectedFiles constructor
   



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