FrankChen021 commented on code in PR #19374:
URL: https://github.com/apache/druid/pull/19374#discussion_r3147677299
##########
server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:
##########
@@ -918,11 +918,28 @@ 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 snapshot is
+ // not yet available, we cannot decide, let the realtime task retry.
+ final DataSourcesSnapshot snapshot =
segmentsMetadataManager.getRecentDataSourcesSnapshot();
+ if (snapshot == null) {
+ return Response.ok(false).build();
+ }
+ final ImmutableDruidDataSource immutableDruidDataSource =
snapshot.getDataSource(dataSourceName);
+ final DataSegment segment = immutableDruidDataSource == null
+ ? null
+ : immutableDruidDataSource.getSegment(
+ SegmentId.of(dataSourceName,
theInterval, version, partitionNumber)
+ );
+ // Segment isn't published in metadata; it will never be handed off.
+ if (segment == null) {
Review Comment:
[P1] Do not treat a missing metadata snapshot segment as handed off
`getRecentDataSourcesSnapshot()` may return a snapshot up to the segment
poll delay old, so a just-published realtime segment can be absent even though
it still needs handoff. Returning `true` here tells the task the segment will
never be handed off and can let it stop waiting before any historical has
loaded it. This should return `false` or force a fresh metadata poll before
concluding the segment is not published.
--
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]