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

Rollup searches based on "obsolete" timezones fail #36229

Closed
cjcenizal opened this issue Dec 4, 2018 · 2 comments · Fixed by #36237
Closed

Rollup searches based on "obsolete" timezones fail #36229

cjcenizal opened this issue Dec 4, 2018 · 2 comments · Fixed by #36237
Labels
>bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data

Comments

@cjcenizal
Copy link
Contributor

This originated from https://discuss.elastic.co/t/visualizing-rollup-index-with-timezone-result-in-error/159064/2. CC @polyfractal

To reproduce, follow these steps to create data, a rollup job, and a search on the rolled-up data:

PUT test_index

PUT test_index/_doc/1
{
  "utc_time" : "2018-12-02T16:02:19.851Z"
}

PUT _xpack/rollup/job/test_job
{
    "index_pattern": "test_index",
    "rollup_index": "test_index_rollup",
    "cron": "0 * * * * ?",
    "groups": {
      "date_histogram": {
        "interval": "24h",
        "field": "utc_time",
        "time_zone": "Canada/Mountain"
      }
    },
    "metrics": [],
    "page_size": 1000
}

POST _xpack/rollup/job/test_job/_start

GET test_index_rollup/_rollup_search
{  
   "size":0,
   "aggregations":{  
      "2":{  
         "date_histogram":{  
            "field":"order_date",
            "interval":"24h",
            "time_zone":"Canada/Mountain",
            "min_doc_count":1
         }
      }
   }
}

The search will fail with this error:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "There is not a rollup job that has a [date_histogram] agg on field [order_date] which also satisfies all requirements of query."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "There is not a rollup job that has a [date_histogram] agg on field [order_date] which also satisfies all requirements of query."
  },
  "status": 400
}
@cjcenizal cjcenizal added >bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data labels Dec 4, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@polyfractal
Copy link
Contributor

Right, I see the issue. The timezone in use here (Canada/Mountain) and in the discuss issue (Japan) are "obsolete" timezones and have been replaced by America/Edmonton / Asia/Tokyo respectively.

What's happening is that internally the date_histogram is converting the TZ on the fly to the "new" timezone, but rollup is comparing it against the original. So it's seeing America/Edmonton != Canada/Mountain and failing to run the query because the timezones don't match.

I think this is fixable in a bwc manner, will work on a PR.

@polyfractal polyfractal changed the title Rollup searches based on non-UTC timezones fail Rollup searches based on "obsolete" timezones fail Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :StorageEngine/Rollup Turn fine-grained time-based data into coarser-grained data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants