gianm commented on code in PR #19374:
URL: https://github.com/apache/druid/pull/19374#discussion_r3163887036


##########
server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:
##########
@@ -918,11 +918,24 @@ public Response isHandOffComplete(
       final Interval theInterval = Intervals.of(interval);
       final SegmentDescriptor descriptor = new SegmentDescriptor(theInterval, 
version, partitionNumber);
       final DateTime now = DateTimes.nowUtc();
+      // Look up the segment in the metadata snapshot so the rule cascade can 
be evaluated against the real segment
+      // (necessary for partial load rules whose matcher inspects the 
segment's projection list). If the cached
+      // snapshot is missing the segment, force a refresh and re-check before 
declaring it never-handed-off, since
+      // the cache may simply not have caught up to a recent publish.
+      final SegmentId segmentId = SegmentId.of(dataSourceName, theInterval, 
version, partitionNumber);
+      DataSegment segment = 
lookupSegment(segmentsMetadataManager.getRecentDataSourcesSnapshot(), 
segmentId);
+      if (segment == null) {
+        segment = 
lookupSegment(segmentsMetadataManager.forceUpdateDataSourcesSnapshot(), 
segmentId);

Review Comment:
   It's better to not have to worry about this if partial rules aren't being 
used. How about:
   
   - add `LoadRule#isIntervalBased` that returns true if the two `appliesTo` 
methods are equivalent
   - check that here; go down the metadata path if false; use the interval only 
if true.



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