Skip to content

[8.19] Fix system index mapping update for reindexed indices after migration (#144782)#145031

Merged
elasticsearchmachine merged 2 commits into8.19from
backport/8.19/pr-144782
Mar 26, 2026
Merged

[8.19] Fix system index mapping update for reindexed indices after migration (#144782)#145031
elasticsearchmachine merged 2 commits into8.19from
backport/8.19/pr-144782

Conversation

@alexey-ivanov-es
Copy link
Copy Markdown
Contributor

SystemIndexMappingUpdateService used projectMetadata.hasIndexAbstraction(d.getPrimaryIndex()) to collect system indices descriptors to check mappings, but then used state.metadata().index(descriptor.getPrimaryIndex()) to get IndexMetadata. This works with indices that were not reindexed, since their name is always the same as the system index's primary name, but after reindexing during migration, the index gains -reindexed-for- suffix and has an alias with the primary name pointing to it. However, index method doesn't support aliases, therefore, IndexMetadata wasn't resolved and mappings were not checked.

This change fixes that by introducing use of indices lookup, if there is no metadata for the primary index.

(cherry picked from commit 29d7e2a)

…gration (#144782)

SystemIndexMappingUpdateService used projectMetadata.hasIndexAbstraction(d.getPrimaryIndex()) to collect system indices descriptors to check mappings, but then used state.metadata().index(descriptor.getPrimaryIndex()) to get IndexMetadata. This works with indices that were not reindexed, since their name is always the same as the system index's primary name, but after reindexing during migration, the index gains -reindexed-for-<version> suffix and has an alias with the primary name pointing to it. However, index method doesn't support aliases, therefore, IndexMetadata wasn't resolved and mappings were not checked.

This change fixes that by introducing use of indices lookup, if there is no metadata for the primary index.

(cherry picked from commit 29d7e2a)
@alexey-ivanov-es alexey-ivanov-es marked this pull request as ready for review March 26, 2026 21:22
@elasticsearchmachine elasticsearchmachine merged commit 3acc5de into 8.19 Mar 26, 2026
30 checks passed
@elasticsearchmachine elasticsearchmachine deleted the backport/8.19/pr-144782 branch March 26, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Core/Infra/System Indices v8.19.14

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants