Skip to content

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

Closed
@pgomulka

Description

@pgomulka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Core/Infra/CoreCore issues without another label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions