yashmayya commented on code in PR #16725:
URL: https://github.com/apache/pinot/pull/16725#discussion_r2312918112
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2364,13 +2364,20 @@ private Set<String> filterSegmentsToCommit(Set<String>
allConsumingSegments,
}
if (segmentsToCommitStr != null) {
- Set<String> segmentsToCommit =
+ Set<String> requestedSegmentsToCommit =
Arrays.stream(segmentsToCommitStr.split(",")).map(String::trim).collect(Collectors.toSet());
-
Preconditions.checkState(allConsumingSegments.containsAll(segmentsToCommit),
- "Cannot commit segments that are not in CONSUMING state. "
- + "All consuming segments: %s, provided segments to commit: %s",
allConsumingSegments,
- segmentsToCommitStr);
- return segmentsToCommit;
+ // Intersect with consuming segments; warn if any requested segments are
not currently consuming
+ Set<String> validSegmentsToCommit = requestedSegmentsToCommit.stream()
+ .filter(allConsumingSegments::contains)
+ .collect(Collectors.toSet());
+ Set<String> invalidSegments = new HashSet<>(requestedSegmentsToCommit);
+ invalidSegments.removeAll(allConsumingSegments);
+ if (!invalidSegments.isEmpty()) {
+ LOGGER.warn("Cannot commit segments that are not in CONSUMING state.
All consuming segments: {}, "
+ + "provided segments to commit: {}. Ignoring first 10
non-consuming segments: {}", allConsumingSegments,
Review Comment:
`Ignoring first 10 non-consuming segments` makes it sound like only the
first 10 segments are being ignored and something else is being done with the
rest. Maybe we could rephrase it to something like `Ignoring all non-consuming
segments, sampling 10: {}` instead?
--
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]