snleee commented on a change in pull request #7761:
URL: https://github.com/apache/pinot/pull/7761#discussion_r748770287



##########
File path: 
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/mergerollup/MergeRollupTaskGenerator.java
##########
@@ -254,7 +254,11 @@ public String getTaskType() {
         // but the metrics are not available until the controller schedules a 
valid task
         long maxEndTimeMs = Long.MIN_VALUE;
         for (SegmentZKMetadata preSelectedSegment : preSelectedSegments) {
-          maxEndTimeMs = Math.max(maxEndTimeMs, 
preSelectedSegment.getEndTimeMs());
+          long currentEndTimeMs = preSelectedSegment.getEndTimeMs();
+          // Compute maxEndTimeMs among segments that are valid for merge 
(e.g. endTimeStamp < currentTime - bufferTime)
+          if (isValidBucketEndTime(currentEndTimeMs, bufferMs, 
lowerMergeLevel, mergeRollupTaskMetadata)) {
+            maxEndTimeMs = Math.max(maxEndTimeMs, 
preSelectedSegment.getEndTimeMs());

Review comment:
       good catch. fixed




-- 
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]

Reply via email to