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

LUCENE-10678: Fix potential overflow when computing the partition point on the BKD tree (#1065) #2668

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Aug 11, 2022

We currently compute the partition point for a set of points by multiplying the number of nodes that needs to be on
the left of the BKD tree by the maxPointsInLeafNode. This multiplication is done on the integer space so if the partition point
is bigger than Integer.MAX_VALUE it will overflow.
This commit moves the multiplication to the long space so it doesn't overflow.

…nt on the BKD tree (#1065)

We currently compute the partition point for a set of points by multiplying the number of nodes that needs to be on
the left of the BKD tree by the maxPointsInLeafNode. This multiplication is done on the integer space so if the partition point
is bigger than Integer.MAX_VALUE it will overflow.
This commit moves the multiplication to the long space so it doesn't overflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant