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

Ensure date parsing BWC compatibility #37929

Merged

Conversation

spinscale
Copy link
Contributor

In order to retain BWC this changes the java date formatters to be able to
parse nanoseconds resolution, even if only milliseconds are supported.
This used to work on joda time as well so that a user could store a date
like 2018-10-03T14:42:44.613469+0000 and then just loose the precision
on anything lower than millisecond level.

/cc @pgomulka @jsoriano

In order to retain BWC this changes the java date formatters to be able to
parse nanoseconds resolution, even if only milliseconds are supported.
This used to work on joda time as well so that a user could store a date
like `2018-10-03T14:42:44.613469+0000` and then just loose the precision
on anything lower than millisecond level.
@spinscale spinscale added >non-issue :Core/Infra/Core Core issues without another label v7.0.0 labels Jan 28, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Copy link
Member

@danielmitterdorfer danielmitterdorfer left a comment

Choose a reason for hiding this comment

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

LGTM

@pgomulka
Copy link
Contributor

I might need to have a similar change for watcher test. Probably no need to add that case here
It will be STRICT_DATE_OPTIONAL_TIME_FORMATTER with nano length 3 increased to at least 6

The test lives here:

./gradlew :x-pack:plugin:integTestRunner -Dtests.seed=15E619B9B73E6049 -Dtests.class=org.elasticsearch.xpack.test.rest.XPackRestIT -Dtests.method="test {p0=watcher/ack_watch/40_reset_ack_after_unmet_action_condition/Ensure that ack status is reset after unmet action condition}" -Dtests.security.manager=true -Dtests.locale=is-IS -Dtests.timezone=America/Fortaleza -Dcompiler.java=11 -Druntime.java=8

Date:2019-01-25T15:37:17.346928Z with format [strict_date_optional_time||epoch_millis]

it also LGTM

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Test that was failing on filebeat works with these changes, thanks!

@spinscale spinscale merged commit 9ec4abc into elastic:master Jan 30, 2019
spinscale added a commit that referenced this pull request Jan 30, 2019
In order to retain BWC this changes the java date formatters to be able to
parse nanoseconds resolution, even if only milliseconds are supported.
This used to work on joda time as well so that a user could store a date
like `2018-10-03T14:42:44.613469+0000` and then just loose the precision
on anything lower than millisecond level.
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 30, 2019
* master: (29 commits)
  Fix limit on retaining sequence number (elastic#37992)
  Docs test fix, wait for shards active.
  Revert "Revert "Documented default values for index follow request parameters. (elastic#37917)""
  Revert "Documented default values for index follow request parameters. (elastic#37917)"
  Ensure date parsing BWC compatibility (elastic#37929)
  SQL: Skip the nested and object field types in case of an ODBC request (elastic#37948)
  Use mappings to format doc-value fields by default. (elastic#30831)
  Give precedence to index creation when mixing typed templates with typeless index creation and vice-versa. (elastic#37871)
  Add classifier to tar.gz in docker compose (elastic#38011)
  Documented default values for index follow request parameters. (elastic#37917)
  Fix fetch source option in expand search phase (elastic#37908)
  Restore a noop _all metadata field for 6x indices (elastic#37808)
  Added ccr to xpack usage infrastructure (elastic#37256)
  Fix exit code for Security CLI tools  (elastic#37956)
  Streamline S3 Repository- and Client-Settings (elastic#37393)
  Add version 6.6.1 (elastic#37975)
  Ensure task metadata not null in follow test (elastic#37993)
  Docs fix - missing callout
  Types removal - deprecate include_type_name with index templates (elastic#37484)
  Handle completion suggestion without contexts
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants