clintropolis commented on code in PR #19374:
URL: https://github.com/apache/druid/pull/19374#discussion_r3157683940
##########
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:
not sure how often this would happen in practice, we don't currently have
easy access direct to metadata store to try to get just a single segment
without some plumbing changes i think.
I guess we could return like a 404 or something and have the client retry
some number of times in the case of a missing segment if we are worried about
this, though that seems like it would have its own complexity since we would
need to track retries on that on the client side, so i'd be in favor of not
doing that maybe.
--
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]