Resolve partitionId overflow issue when number of segments exceeds Java Short.MAX_VALUE in single time period#15116
Resolve partitionId overflow issue when number of segments exceeds Java Short.MAX_VALUE in single time period#15116dulu98Kurz wants to merge 6 commits intoapache:masterfrom
Conversation
|
the CI test failures seems related with MSQ instead of this PR. |
cryptoe
left a comment
There was a problem hiding this comment.
@dulu98Kurz I have left an initial review.
Would request @kfaraz to take a look into this since he has worked on this AREA of druid.
|
@dulu98Kurz Thanks for incorporating some feedback. @kfaraz had some doubts around the increased memory pressure on overshadowable manager due to change to int from short. I kind of agree with his assessment. I think we should keep the error message handling and revert the change from int to short. |
|
Hello @dulu98Kurz #7491 - Segment locking requires the partition ids to be within 0 - Short.MAX_VALUE. In particular:
However, there are plans to deprecate segment locking in future releases in favour of concurrent append with replace. We might be able to revisit this then. |
|
Hi @cryptoe @kfaraz @AmatyaAvadhanula thanks a lot for the input, seems there are more than one concerns on refactoring to However I believe I found a way to make everyone happy without refactoring to Now since we heavily relies on Short.toUnsignedInt when comparing and determining overlapping, we can make sure we never encounter |
|
Hi @cryptoe @kfaraz @AmatyaAvadhanula does the change above make sense to you? I guess the only change I'm making here is this line https://github.com/apache/druid/pull/15116/files#diff-9eda353464cdf927f17c657f317fc7986902ab9eb20d99a951d23b6435fc16beR427 , I`m happy to post more clarifications if any further questions |
|
Hello @dulu98Kurz The changes to improve the error message look good to me though. |
|
@dulu98Kurz , thanks for attempting to fix this! As @AmatyaAvadhanula points out, there are other concerns in just changing this Issue #15356 has been created to discuss a more long-term solution for this. For now, I think the best approach for your PR would be to ensure fail fast in such cases and give a better error message. |
|
Sorry for the late response @kfaraz , since the issue is addressed in another PR I`ll close this one, thanks for your attention and looking forward to collaborate again in future! |

Fixes #15091.
Description
This PR address the issue described in #15091
You can also find discussion in #15090 for detailed discussion for this PR.
This PR should resolve the issue more extensively, we should merge this one if no other concerns.
Fixed the bug ...
#15091
Renamed the class ...
Added a forbidden-apis entry ...
Release note
Resolve partitionId overflow issue when number of segments exceeds Java Short.MAX_VALUE in single time period.
Key changed/added classes in this PR
MyFooOurBarTheirBazThis PR has: