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 #48698

Closed
pgomulka opened this issue Oct 30, 2019 · 3 comments
Closed

[Java.time] Retain prefixed date pattern in formatter #48698

pgomulka opened this issue Oct 30, 2019 · 3 comments
Labels
:Core/Infra/Core Core issues without another label

Comments

@pgomulka
Copy link
Contributor

in a mixed cluster environment, when a 6.8 node is a master it will send out a cluster state update where a mapping has a pattern with an 8 prefix (i.e. 8E, d MMM yyyy HH:mm:ss Z) it will then be applied on 7.x node.
It will work for the first cluster state update, but on the second update it will notice a difference as it will strip the 8 and will compare the 8E, d MMM yyyy HH:mm:ss Z received vs E, d MMM yyyy HH:mm:ss Z As in reality the mapping has not changed, it will have same version.
This is causing the assertion in MappingService to fail

  if (currentIndexMetaData.getMappingVersion() == newIndexMetaData.getMappingVersion()) {
                // if the mapping version is unchanged, then there should not be any updates and all mappings should be the same
                assert updatedEntries.isEmpty() : updatedEntries;

This should be fixed and the original date format should be retained, but the stripped format should be used on the enclosed java.time DateTimeFormatter

This is failing at the moment on #47983

@pgomulka pgomulka added the :Core/Infra/Core Core issues without another label label Oct 30, 2019
@elasticmachine
Copy link
Collaborator

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

@pgomulka pgomulka self-assigned this Oct 30, 2019
@pgomulka pgomulka changed the title [Java.time] Retain prefixed date patterin in formatter [Java.time] Retain prefixed date pattern in formatter Oct 30, 2019
@pgomulka
Copy link
Contributor Author

Worth noting, that because of this a non-master node thinks there is a mapping change, is triggering a cluster-state-update on master.
THis however is harmless as master then checks if index is dirty which is false. (logic in MetaDataMappingService)

pgomulka added a commit that referenced this issue 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
pgomulka added a commit to pgomulka/elasticsearch that referenced this issue 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 elastic#48698
@pgomulka pgomulka reopened this Dec 11, 2019
@pgomulka
Copy link
Contributor Author

closing as this is fixed by #48703 in 7.x and 6.8 does not need this fix #49640 (comment)

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

No branches or pull requests

2 participants