kfaraz commented on code in PR #19772:
URL: https://github.com/apache/druid/pull/19772#discussion_r3663048731


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/duty/UnusedSegmentsKiller.java:
##########
@@ -245,22 +256,53 @@ private void rebuildKillQueue()
         return;
       }
 
-      final Set<String> dataSources = 
storageCoordinator.retrieveAllDatasourceNames();
-
       final Map<String, Integer> dataSourceToIntervalCounts = new HashMap<>();
-      for (String dataSource : dataSources) {
-        storageCoordinator.retrieveSomeUnusedSegmentIntervals(dataSource, 
MAX_INTERVALS_TO_KILL_IN_DATASOURCE).forEach(
-            interval -> {
-              dataSourceToIntervalCounts.merge(dataSource, 1, Integer::sum);
-              killQueue.offer(new KillCandidate(dataSource, interval));
-            }
+
+      // Identify intervals with unused segments which are eligible for kill
+      final Map<DatasourceInterval, Integer> killCandidates =
+          storageCoordinator.retrieveSomeUnusedSegmentIntervals(
+              DateTimes.nowUtc().minus(killConfig.getBufferPeriod()),

Review Comment:
   Yes, the inner limit (currently 200k) takes care of that.
   
   Fetching all the datasources in one go is actually better since in the 
current flow, we would fire separate queries for each datasource. When the 
number of datasources is large, this can be pretty redundant, especially since 
a lot of the datasources might not even have killable unused segments.



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