cryptoe commented on code in PR #15116:
URL: https://github.com/apache/druid/pull/15116#discussion_r1368363272


##########
processing/src/main/java/org/apache/druid/timeline/partition/OvershadowableManager.java:
##########
@@ -1033,13 +1039,21 @@ public String toString()
   @VisibleForTesting
   static class RootPartitionRange implements Comparable<RootPartitionRange>
   {
-    private final short startPartitionId;
-    private final short endPartitionId;
+    private final int startPartitionId;
+    private final int endPartitionId;
+    private static final int MAX_PARTITIONS_PER_TIMETRUNK = 65536;
 
     @VisibleForTesting
     static RootPartitionRange of(int startPartitionId, int endPartitionId)
     {
-      return new RootPartitionRange((short) startPartitionId, (short) 
endPartitionId);
+      if (startPartitionId > MAX_PARTITIONS_PER_TIMETRUNK) {
+        log.error(
+            "PartitionId [%s] exceeding max number of Segments Druid can 
handle in single time-trunk [%s], please compact or reduce number of segments 
in time-trunk!",
+            startPartitionId,
+            MAX_PARTITIONS_PER_TIMETRUNK
+        );
+      }

Review Comment:
   ```suggestion
         if (startPartitionId > MAX_PARTITIONS_PER_TIMETRUNK) {
           log.error(
               "PartitionId [%d] exceeding max number of Segments Druid can 
handle in single time-chunk [%s], please compact or reduce number of segments 
in time-chunk!",
               startPartitionId,
               MAX_PARTITIONS_PER_TIMECHUNK
           );
         }
   ```
   
   Also we should throw a DruidException for persona user. . 
   



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