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

Fix incorrect calculation of how many buckets will result from a merge #44461

Merged
merged 3 commits into from
Jul 17, 2019

Conversation

pcsanwald
Copy link
Contributor

Fixed #43577

Reproducing the problem in the issue showed that this calculation is incorrect:

int resultingBuckets = buckets.size() / interval;
                if (resultingBuckets <= targetBuckets)

because we can end up with extra buckets if the remainder here is not zero.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo


@Override
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/39497")
// TODO: When resolving the above AwaitsFix, just delete this override. Method is only overriden to apply the annotation.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've unmuted this test because the bug could have caused some of the failures we've seen previously, which seem to be off by one errors, such as in #39497. Some of those failures look quite similar:

   > Throwable #1: java.lang.AssertionError: expected:<{1548979200000=989}> but was:<{1548979200000=928, 1551398400000=61}>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ Agreed

Copy link
Contributor

@polyfractal polyfractal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto_date_histogram generates too many buckets for smaller time range
5 participants