Skip to content

[8.x] Sometimes delegate to SourceLoader in ValueSourceReaderOperator for required stored fields #115390

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

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

martijnvg
Copy link
Member

Backporting #115114 to 8.x branch.

If source is required by a block loader then the StoredFieldsSpec that gets populated should be enhanced by SourceLoader#requiredStoredFields(...) in ValuesSourceReaderOperator. Otherwise in case of synthetic source many stored fields aren't loaded, which causes only a subset of _source to be synthesized. For example when unmapped fields exist or field values that exceed configured ignore above will not appear is _source.

This happens when field types fallback to a block loader implementation that uses _source. The required field values are then extracted from the source once loaded.

This change also reverts the production code changes introduced via #114903. That change only ensured that _ignored_source field was added to the required list of stored fields. In reality more fields could be required. This change is better fix, since it handles also other cases and the SourceLoader implementation indicates which stored fields are needed.

Closes #115076, #115074, #115073 and #115066

…equired stored fields (elastic#115114)

If source is required by a block loader then the StoredFieldsSpec that gets populated should be enhanced by SourceLoader#requiredStoredFields(...) in ValuesSourceReaderOperator. Otherwise in case of synthetic source many stored fields aren't loaded, which causes only a subset of _source to be synthesized. For example when unmapped fields exist or field values that exceed configured ignore above will not appear is _source.

This happens when field types fallback to a block loader implementation that uses _source. The required field values are then extracted from the source once loaded.

This change also reverts the production code changes introduced via elastic#114903. That change only ensured that _ignored_source field was added to the required list of stored fields. In reality more fields could be required. This change is better fix, since it handles also other cases and the SourceLoader implementation indicates which stored fields are needed.

Closes elastic#115076
@martijnvg martijnvg added backport :Analytics/Compute Engine Analytics in ES|QL :StorageEngine/Mapping The storage related side of mappings v8.17.0 auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Oct 23, 2024
@elasticsearchmachine elasticsearchmachine merged commit 3814cf4 into elastic:8.x Oct 23, 2024
15 checks passed
@martijnvg martijnvg deleted the backport_115114 branch October 23, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Compute Engine Analytics in ES|QL auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :StorageEngine/Mapping The storage related side of mappings v8.17.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants