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

[Java.time] Retain prefixed date pattern in formatter (#48703) backport#48703 #49640

Closed
wants to merge 10 commits into from

Conversation

pgomulka
Copy link
Contributor

@pgomulka pgomulka commented Nov 27, 2019

JavaDateFormatter should keep the pattern with the prefixed 8 as it will be used for serialisation.
The stripped pattern should be used for the enclosed formatters.

closes #48698
backports #48703
also backports #46654 (optional composites in date math parsing)

JavaDateFormatter should keep the pattern with the prefixed 8 as it will be used for serialisation.
The stripped pattern should be used for the enclosed formatters.

closes elastic#48698
@pgomulka pgomulka added :Core/Infra/Core Core issues without another label backport labels Nov 27, 2019
@pgomulka pgomulka self-assigned this Nov 27, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

matriv and others added 9 commits November 28, 2019 17:27
Add a couple of pointers for the user to check the
overall cluster health and the version of ES running
on every node.

Fixes: elastic#49670

(cherry picked from commit 8ca11f5)
The AuthenticationService has a feature to "smart order" the realm
chain so that whicherver realm was the last one to successfully
authenticate a given user will be tried first when that user tries to
authenticate again.

There was a bug where the building of this realm order would
incorrectly drop the first realm from the default chain unless that
realm was the "last successful" realm.

In most cases this didn't cause problems because the first realm is
the reserved realm and so it is unusual for a user that authenticated
against a different realm to later need to authenticate against the
resevered realm.

This commit fixes that bug and adds relevant asserts and tests.

Backport of: elastic#49473
…654) (elastic#47217)

Currently DateMathParser with roundUp = true is relying on the DateFormatter build with
combined optional sub parsers with defaulted fields (depending on the formatter).
That means that for yyyy-MM-dd'T'HH:mm:ss||yyyy-MM-dd'T'HH:mm:ss.SSS
Java.time implementation expects optional parsers in order from most specific to
least specific (reverse in the example above).
It is causing a problem because the first parsing succeeds but does not consume the full input.
The second parser should be used.
We can work around this with keeping a list of RoundUpParsers and iterate over them choosing
the one that parsed full input. The same approach we used for regular (non date math) in
relates elastic#40100
The jdk is not considering this to be a bug https://bugs.openjdk.java.net/browse/JDK-8188771

Those below will expect this change first
relates elastic#46242
relates elastic#45284
backport elastic#46654
@pgomulka
Copy link
Contributor Author

It turns out that in 6.8 it is working because we always make sure that JavaDateFormatter has an 8 prefix
snippet from JavaDateFormatter

        this.format = format.startsWith("8") ? format : "8" + format;

Because of that, backporting is not needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport :Core/Infra/Core Core issues without another label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants