Skip to content

Fixing handling of subobject mappings in simulate ingest API #132046

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

Closed

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Jul 28, 2025

This correctly replaces mappings for subobjects rather than attempting to merge them in the simulate ingest API.
This fixes the problem in the description of #131608, but does not address the problem described in a comment in that issue, which appears to be different.

@masseyke masseyke added >bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP v9.2.0 v9.1.1 v9.0.5 v8.18.5 labels Jul 28, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine
Copy link
Collaborator

Hi @masseyke, I've created a changelog YAML for you.

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Jul 28, 2025
@@ -351,7 +351,7 @@ private Collection<String> validateUpdatedMappings(
.putMapping(new MappingMetadata(updatedMappings))
.build();
Engine.Index result = indicesService.withTempIndexService(originalIndexMetadata, indexService -> {
indexService.mapperService().merge(updatedIndexMetadata, MapperService.MergeReason.MAPPING_UPDATE);
indexService.mapperService().merge(updatedIndexMetadata, MapperService.MergeReason.INDEX_TEMPLATE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm… I'm worried we kind of want both behaviors right? The MAPPING_UPDATE one is if we were to update the mapping via the API, while the INDEX_TEMPLATE one is for updating the template. Do we know for sure what the intent is on the user's side?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking was that if a user wanted to simulate this change, they'd be doing it through an index-template-like update rather than a mapping update, since this change just fails with a mapping update. This API is meant to simulate what would happen if the index had this mapping change, rather than what would happen if I attempted to make this mapping change.

@elasticsearchmachine
Copy link
Collaborator

Hi @masseyke, I've updated the changelog YAML for you.

@masseyke masseyke marked this pull request as draft July 28, 2025 22:24
@masseyke
Copy link
Member Author

I'm closing this one in favor of the approach given in #132210.

@masseyke masseyke closed this Jul 30, 2025
@masseyke masseyke deleted the fix/simulate-ingest-subobject-mapping branch July 30, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP Team:Data Management Meta label for data/management team v8.18.5 v9.0.5 v9.1.1 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants