[ZDT Migration] support updating mapping for root fields #179258
Labels
Feature:Migrations
Feature:Saved Objects
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
atm the
zdt
migration algorithm fully ignores the root field mappings after the initial index creation, and never update them. The additive mapping changes are only based on the SO types that have new model versions:kibana/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/zdt/model/stages/init.ts
Lines 165 to 169 in 79b5754
kibana/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/zdt/utils/generate_additive_mapping_diff.ts
Lines 26 to 49 in 9cddb60
More important, the version check we're performing to check if we do need to update the mappings is also ignoring the root field mappings, and is only based on comparing the SO type model versions:
kibana/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/zdt/model/stages/init.ts
Lines 149 to 154 in 79b5754
We need to update this logic to support updating our mappings when new root fields are introduced.
This could be done by checking the diff in mappings between the index's and the app's expected mappings (as
v2
is doing), or this could be performed by introducing acoreVersion
in the model version's meta stored in the index.The text was updated successfully, but these errors were encountered: