abhishekrb19 commented on code in PR #15306:
URL: https://github.com/apache/druid/pull/15306#discussion_r1379655492
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:
##########
@@ -196,21 +195,40 @@ public TaskStatus runTask(TaskToolbox toolbox) throws
Exception
limit,
numTotalBatches != null ? StringUtils.format(" in [%d] batches.",
numTotalBatches) : "."
);
+
+ RetrieveUsedSegmentsAction retrieveUsedSegmentsAction = new
RetrieveUsedSegmentsAction(
Review Comment:
nit: could be `final`
```suggestion
final RetrieveUsedSegmentsAction retrieveUsedSegmentsAction = new
RetrieveUsedSegmentsAction(
```
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/task/KillUnusedSegmentsTask.java:
##########
@@ -196,21 +195,40 @@ public TaskStatus runTask(TaskToolbox toolbox) throws
Exception
limit,
numTotalBatches != null ? StringUtils.format(" in [%d] batches.",
numTotalBatches) : "."
);
+
+ RetrieveUsedSegmentsAction retrieveUsedSegmentsAction = new
RetrieveUsedSegmentsAction(
+ getDataSource(),
+ null,
+ ImmutableList.of(getInterval()),
+ Segments.INCLUDING_OVERSHADOWED
+ );
+ // Fetch the load specs of all segments overlapping with the unused
segment intervals
Review Comment:
Correct me if I'm wrong:
1. The interval check is only done below from L246-249, so maybe this
comment here is a bit confusing?
2. Segments may/may not be marked as unused here depending on the deprecated
`markAsUnused` flag, so there's no guarantee that the segments will be marked
as unused in the kill tasks' interval if `markAsUnused=false`
```suggestion
// Fetch the load specs of all used segments in the kill task's interval
```
--
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]