-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Strange bucket for date_histogram with negative post_zone and zero min_doc_count #7673
Comments
thanks for the report @glelouarn - we'll take a look |
… with min_doc_count = 0 and negative post_zone.
Hi work on it and initialized the pull request #9029 |
I encountered similar problems while working on #9062. The problem is in the way Rounding.nextRoundingValue() is used when adding empty buckets in InternalHistogram.addEmptyBuckets(). The assumtion there is that when adding time durations (like 1M) to the key of an existing (non-empty) bucket to fill the histogram with empty buckets one always ends up with the key of the next non-empty bucket. e.g. in the example about one would expect nextRoundingValue("2013-06-30--22:00:00.000+0000") => "2013-07-31--22:00:00.000+0000" Internally we use DurationField.add() from Joda-Time, but that works in a slightly different way (at least for months), e.g. if you start with 2014-01-31T22:00:00.000Z and then add 1month durations consecutively one gets: 2014-01-31T22:00:00.000Z + month -> 2014-02-28T22:00:00.000Z but the following rounded non-empty buckets will have keys 2014-03-31T22:00:00.000Z, 2014-04-30T22:00:00.000Z etc... The time-zone offset is just one way to run into this. I think that any offset (could be positive as well) that makes bucket keys lie in the range of day_of_month in 28-31 will likely result in the same glitch, at least for DateTimeUnit.MONTH_OF_YEAR and above. |
This fix enhances the internal time zone conversion in the TimeZoneRounding classes that were the cause of issues with strange date bucket keys in elastic#9491 and elastic#7673. Closes elastic#9491 Closes elastic#7673
This is fixed on 1.4 and 1.x with #9790 I think. |
The fix for this will be in the next release (either 1.4.5 or 1.5). |
This fix enhances the internal time zone conversion in the TimeZoneRounding classes that were the cause of issues with strange date bucket keys in elastic#9491 and elastic#7673. Closes elastic#9491 Closes elastic#7673
I sent following request to my elasticsearch 1.3.2 server
http://localhost:9200/payment_prod/2002/_search?search_type=count
with negativepost_zone
andpre_zone
:It seems to me that I shouldn't get the bucket 2013-07-30--22:00:00.000+0000 in the response.
With a small update on the request, post and pre zone with positive values,
http://localhost:9200/payment_prod/2002/_search?search_type=count
:In such case, response seems valid for me without strange bucket:
In fact problem occurs with post_zone < 0 and min_doc_count = 0. Without one of those predicates, result seems more reliable.
Am I wrong or is there a problem with elasticsearch post_zone management?
The text was updated successfully, but these errors were encountered: