clintropolis commented on code in PR #19565:
URL: https://github.com/apache/druid/pull/19565#discussion_r3382811162
##########
server/src/main/java/org/apache/druid/server/coordinator/rules/ClusterGroupPartialLoadMatcher.java:
##########
@@ -59,10 +78,13 @@ public MatchResult match(DataSegment segment, Map<String,
Object> baseLoadSpec)
return null;
}
final List<Integer> resolved = resolveClusterGroupIndices(segment);
- if (resolved.isEmpty()) {
+ final ShardSpec shardSpec = segment.getShardSpec();
+ if (resolved.isEmpty() && shardSpec.getPartitionNum() >=
shardSpec.getNumCorePartitions()) {
+ // No patterns match and this segment isn't part of a core partition
group, so no need for an empty load. Fall
+ // through to the cannot-match handling.
return null;
}
- final String fingerprint = computeFingerprint(resolved);
+ final String fingerprint = resolved.isEmpty() ? EMPTY_LOAD_FINGERPRINT :
computeFingerprint(resolved);
Review Comment:
ah, so this is intentional behavior to not fall-through, however this
comment made me realize that it was a bit too aggressive with the empty matches
since it was applying to _any_ clustered segments.
I only intended for empty matches to occur when the matcher is 'compatible'
with the segment clustering, e.g. there is some overlap between what clustering
columns the matcher is looking at and what columns the segment is actually
clustered on so that we don't incorrect do an empty load for segments that are
clustered completely differently from what the matcher is looking for.
I've updated the check to ensure that empty matches only occur when things
are compatible, which was the intended behavior
--
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]