FrankChen021 commented on code in PR #20247:
URL: https://github.com/apache/druid/pull/20247#discussion_r3957852839
##########
server/src/main/java/org/apache/druid/server/coordinator/duty/CloneHistoricals.java:
##########
@@ -110,15 +113,19 @@ public DruidCoordinatorRuntimeParams
run(DruidCoordinatorRuntimeParams params)
continue;
}
+ final CloningStats cloningStats = new
CloningStats(sourceServer.getServer().getNumSegments());
+ targetHistoricalStats.put(targetHistoricalName, cloningStats);
+
final Set<DataSegment> sourceProjectedSegments =
sourceServer.getProjectedSegments();
final Set<DataSegment> targetProjectedSegments =
targetServer.getProjectedSegments();
// Load any segment that the clone target is missing, or that it holds
under a different partial-load profile
// than the source. Segment identity alone can't tell those apart: two
replicas of the same segment id may hold
// different parts of it.
for (DataSegment segment : sourceProjectedSegments) {
final PartialLoadProfile sourceProfile =
sourceServer.getProjectedProfile(segment);
- if (shouldLoadSegmentOnTargetServer(segment, sourceProfile,
targetServer, targetProjectedSegments)) {
- loadSegmentOnTargetServer(segment, sourceProfile, targetServer,
params);
+ if (shouldLoadSegmentOnTargetServer(segment, sourceProfile,
targetServer, targetProjectedSegments)
+ && loadSegmentOnTargetServer(segment, sourceProfile, targetServer,
params)) {
Review Comment:
[P1] Count already queued source loads as pending
When the target already has a queued LOAD for a source-served segment and
its projected profile matches the source (the normal full-load case has null on
both sides), targetProjectedSegments contains the segment and
shouldLoadSegmentOnTargetServer returns false. This change removed the old
targetServer.isLoadingSegment branch, so segmentsPendingSync is never
incremented. The next status calculation can satisfy both thresholds and report
SYNCED while that source segment is still queued on the target, allowing
clone-status consumers to stop waiting too early. Count source-served segments
that are not yet serving on the target, including pre-existing queued loads,
before applying the load/reconcile branch.
--
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]