capistrant commented on code in PR #18028:
URL: https://github.com/apache/druid/pull/18028#discussion_r2121685494


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentNukeAction.java:
##########
@@ -73,26 +73,26 @@ public Void perform(Task task, TaskActionToolbox toolbox)
 
     try {
       final Set<Interval> intervals = 
segments.stream().map(DataSegment::getInterval).collect(Collectors.toSet());
-      toolbox.getTaskLockbox().doInCriticalSection(
+      int numDeletedSegments = toolbox.getTaskLockbox().doInCriticalSection(
           task,
           intervals,
-          CriticalAction.builder().onValidLocks(
-              () -> {
-                int numDeletedSegments =
-                    
toolbox.getIndexerMetadataStorageCoordinator().deleteSegments(segments);
-                log.info(
-                    "Deleted [%d] segments out of requested[%d] from"
-                    + " metadata store for task[%s], datasource[%s], 
intervals[%s].",
-                    numDeletedSegments, segments.size(), task.getId(), 
task.getDataSource(), intervals
-                );
-                return numDeletedSegments;
-              }
+          CriticalAction.<Integer>builder().onValidLocks(
+              () -> 
toolbox.getIndexerMetadataStorageCoordinator().deleteSegments(segments)
           ).onInvalidLocks(
               () -> {
                 throw new ISE("Some locks for task[%s] are already revoked", 
task.getId());
               }
           ).build()
       );
+
+      final Set<Interval> sampleIntervals = 
intervals.stream().limit(5).collect(Collectors.toSet());

Review Comment:
   Will this change to using a sample of 5 have to potentially change back to 
the verbose interval set based on what we decide about Gian's note about all 
deletes being auditable in logs?



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