kfaraz commented on code in PR #18028: URL: https://github.com/apache/druid/pull/18028#discussion_r2121701448
########## 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: The segment IDs would already be logged by the tasks, but I guess we can fix this up too. Especially since the number of intervals is typically always low. Coordinator and Overlord always launch kill tasks for a single interval. Tasks submitted manually are likely to have few intervals too. -- 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: commits-unsubscr...@druid.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org