Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] ConcurrentBitmapSortedLongPairSet doesn't support pairs where the right value of the pair is larger than Integer.MAX_VALUE #23877

Open
2 of 3 tasks
lhotari opened this issue Jan 22, 2025 · 1 comment
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@lhotari
Copy link
Member

lhotari commented Jan 22, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

any released version

Minimal reproduce step

ConcurrentBitmapSortedLongPairSet uses internally RoaringBitmap which supports values up to 2^32.
Since ConcurrentBitmapSortedLongPairSet uses Iterator<Integer> in the implementation, it can only support values up to 2^31-1 (Integer.MAX_INTEGER).

What did you expect to see?

Since the class interface and name is about supporting a Long pair, it should support long values for both right and left values of the pair.

What did you see instead?

Long value is not supported for the right value of the pair.

Anything else?

A possible solution would be to replace org.roaringbitmap.RoaringBitmap with org.roaringbitmap.longlong.Roaring64Bitmap.
However, Roaring64Bitmap interface is slightly different and would result in other changes.

An alternative mitigation is to improve ConcurrentBitmapSortedLongPairSet to support values up to 2^32. That is implemented in PR #23878.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@lhotari lhotari added the type/bug The PR fixed a bug or issue reported a bug label Jan 22, 2025
@lhotari
Copy link
Member Author

lhotari commented Jan 23, 2025

#23878 has been merged and it supports values up to 2^32 (4294967296). This is 2 * (Integer.MAX_VALUE (2147483647) + 1) so there's an improvement that has been made..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

1 participant