swaminathanmanish commented on code in PR #14742:
URL: https://github.com/apache/pinot/pull/14742#discussion_r1904289854
##########
pinot-plugins/pinot-minion-tasks/pinot-minion-builtin-tasks/src/main/java/org/apache/pinot/plugin/minion/tasks/upsertcompactmerge/UpsertCompactMergeTaskGenerator.java:
##########
@@ -296,18 +317,22 @@ public static SegmentSelectionResult
processValidDocIdsMetadata(Map<String, Stri
// variables to maintain current group sum
long currentValidDocsSum = 0;
long currentTotalDocsSum = 0;
+ double currentOutputSegmentSizeInBytes = 0.0;
for (SegmentMergerMetadata segment : segments) {
long validDocs = segment.getValidDocIds();
long invalidDocs = segment.getInvalidDocIds();
+ double expectedSegmentSizeInBytes = segment.getSegmentSizeInBytes();
// Check if adding this segment would keep the validDocs sum within
the threshold
if (currentValidDocsSum + validDocs <= validDocsThreshold &&
currentGroup.size() < maxNumSegments
- && currentTotalDocsSum + validDocs + invalidDocs <
maxRecordsPerTask) {
+ && currentTotalDocsSum + validDocs + invalidDocs <
maxRecordsPerTask
+ && currentOutputSegmentSizeInBytes + expectedSegmentSizeInBytes <
outputSegmentMaxSizeInBytes) {
// Add the segment to the current group
currentGroup.add(segment);
currentValidDocsSum += validDocs;
currentTotalDocsSum += validDocs + invalidDocs;
+ currentOutputSegmentSizeInBytes += expectedSegmentSizeInBytes;
Review Comment:
Does this ensure that we are packing enough segments (based on
outputSegmentMaxSizeInBytes) per task. If so, this still does not ensure that a
segment is of expectedSegmentSize?
--
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]