Skip to content

Mappings assertions in mixed clusters #59427

@romseygeek

Description

@romseygeek

We currently have a couple of internal checks on mappings updates which make it
difficult or impossible to change the default representation of mappings. IndexMetaData
objects have a mapping version on them, which is used for some sanity checking in
the translog, recoveries, CCR, etc. We also have an internal assertion that checks, when
doing a mapping update, that versions of the mapping with identical versions also have
identical serializations.

This constraint (that identical versions == identical representations) means that we cannot
change the default representation of a mapping, even if the parsed result of that representation
does not change. This has already prevented us from removing the (unused except for
serialization) type variable from a number of internal APIs (see #51214),
and is currently preventing a backport of some refactoring to the CompletionFieldMapper
because it no longer writes out some parameters if they hold default values.

One way around this would be to drop this assertion for mixed clusters only, but I worry that
this may let other subtle mapping bugs appear in mixed clusters, which by their nature are
full of edge cases that are difficult to test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Foundations/MappingIndex mappings, including merging and defining field typesTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions