gianm commented on code in PR #13304:
URL: https://github.com/apache/druid/pull/13304#discussion_r1013269973


##########
server/src/main/java/org/apache/druid/server/coordinator/duty/NewestSegmentFirstIterator.java:
##########
@@ -129,6 +131,12 @@ public class NewestSegmentFirstIterator implements 
CompactionSegmentIterator
             // For example, if the original is interval of 
2020-01-28/2020-02-03 with WEEK granularity
             // and the configuredSegmentGranularity is MONTH, the segment will 
be split to two segments
             // of 2020-01/2020-02 and 2020-02/2020-03.
+            if (Intervals.ETERNITY.equals(segment.getInterval())
+                && !Granularities.ALL.equals(configuredSegmentGranularity)) {
+              log.warn("Cannot compact segments from ALL to finer granularity 
for datasource[%s]", dataSource);
+              allToFinerGranularityCompaction = true;
+              continue;

Review Comment:
   Early return directly from here?



##########
server/src/main/java/org/apache/druid/server/coordinator/duty/NewestSegmentFirstIterator.java:
##########
@@ -129,6 +131,12 @@ public class NewestSegmentFirstIterator implements 
CompactionSegmentIterator
             // For example, if the original is interval of 
2020-01-28/2020-02-03 with WEEK granularity
             // and the configuredSegmentGranularity is MONTH, the segment will 
be split to two segments
             // of 2020-01/2020-02 and 2020-02/2020-03.
+            if (Intervals.ETERNITY.equals(segment.getInterval())
+                && !Granularities.ALL.equals(configuredSegmentGranularity)) {
+              log.warn("Cannot compact segments from ALL to finer granularity 
for datasource[%s]", dataSource);

Review Comment:
   Please include a link to this PR, so future devs can understand why we can't 
do this. One day, hopefully someone will fix it.



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