Skip to content

Save heap when dynamically mapping arrays #127439

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

original-brownbear
Copy link
Member

We can do the merging more eagerly to save on heap at the cost of some cycles (though the overhead should be reasonably limited because we save a little down the line if all the mappers are the same instance). Obviously a bit of a dirty trick but this logic is quite brittle now with things like the vector mapper special case and this seems to me like the shortest path to avoiding runaway heap use.

This yet again shows the need to implement actual mapper equality checks and stronger deduplication for them to avoid having mapping merging be our only mechanism for deduplication.

This comes with a slight behavior change too by making unparseable objects with conflicting field types fail to parse a little more eagerly at the parsing stage (as they should IMO). This helps with some of the extreme slowdowns that a steady stream of these eventually unparseable documents has been introducing here and there in heavily loaded deployments.

closes #117593

We can do the merging more eagerly to save on heap at the cost of some cycles (though the overhead should be reasonably limited
because we save a little down the line if all the mappers are the same instance).
Obviously a bit of a dirty trick but this logic is quite brittle now with things like the
vector mapper special case and this seems to me like the shortest path to avoiding runaway heap use.

This yet again shows the need to implement actual mapper equality checks and stronger deduplication
for them to avoid having mapping merging be our only mechanism for deduplication.

closes elastic#117593
@original-brownbear original-brownbear added >bug :Search Foundations/Mapping Index mappings, including merging and defining field types labels Apr 27, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @original-brownbear, I've created a changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Many duplicate dynamic mappers are created when indexing arrays of unknown fields.
2 participants