You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/11/19 02:47:01 UTC

[GitHub] [incubator-druid] ArvinZheng commented on issue #8882: equals method in SegmentId looks buggy

ArvinZheng commented on issue #8882: equals method in SegmentId looks buggy
URL: https://github.com/apache/incubator-druid/issues/8882#issuecomment-555307422
 
 
   @michaelschiff thanks for looking into this. I did a simple math and also confirmed this should not be an issue.
   
   @leventov 
   I am able to reproduce the issue now, we got the Exception and could not start our Coordinator, the root cause is - When constructing `RootPartitionRange`, our partition numbers are cast from Integer to short, hence the collision occurred (our partition numbers are not that consecutive and may have large gap between each other). Checked `NumberedPartitionChunk`, `NumberedOverwritingPartitionChunk`, `LinearPartitionChunk` and `IntegerPartitionChunk`, the partition numbers are defined as int, should we consider to make the `startPartitionId` and `endPartitionId` to int and update corresponding codes.
   ```
       private final short startPartitionId;
       private final short endPartitionId;
   
       @VisibleForTesting
       static RootPartitionRange of(int startPartitionId, int endPartitionId)
       {
         return new RootPartitionRange((short) startPartitionId, (short) endPartitionId);
       }
   
       private static <T extends Overshadowable<T>> RootPartitionRange of(PartitionChunk<T> chunk)
       {
         return of(chunk.getObject().getStartRootPartitionId(), chunk.getObject().getEndRootPartitionId());
       }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org