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

don't merge mappings from source index #134809

Closed
rudolf opened this issue Jun 21, 2022 · 2 comments · Fixed by #147296
Closed

don't merge mappings from source index #134809

rudolf opened this issue Jun 21, 2022 · 2 comments · Fixed by #147296
Labels
bug Fixes for quality problems that affect the customer experience Feature:Migrations Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@rudolf
Copy link
Contributor

rudolf commented Jun 21, 2022

In #70951 we added a function disableUnknownTypeMappingFields which would take a source index's mappings and the mappings calculated from all the registered saved object types and merge them in a special way: the mappings of any unknown type would be set to dynamic: false, properties: {}.

This ensured that we could still reindex any unknown saved object types even though the top-level mappings of the .kibana index has dynamic: strict.

For v7.x

In 7.x we only warn of unknown saved object types #105213 so we need to maintain this behaviour. However, it's only necessary to add mappings for unknown types, we don't need to merge in all the mappings from the source index as we do in https://github.com/elastic/kibana/blob/7.17/src/core/server/saved_objects/migrations/core/migration_context.ts#L172

This will help us avoid known issues where an upgrade fails because of problematic mappings in the source index.

For v8.x

In 8.x Kibana will refuse to start a migration when there are unknown saved object types #107678 We don't need any mappings from the source index, we should only be using the targetMappings calculated from the mappings of the registered saved object types so we can remove disableUnknownTypeMappingFields completely

@rudolf rudolf added bug Fixes for quality problems that affect the customer experience Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Migrations labels Jun 21, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@rudolf
Copy link
Contributor Author

rudolf commented Jun 21, 2022

thanks for raising this @romain-chanu 👍

@exalate-issue-sync exalate-issue-sync bot changed the title migrations: don't merge mappings from source index don't merge mappings from source index Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Migrations Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants