ES|QL: fix transport crash for conflicted sub-fields - #156326
ES|QL: fix transport crash for conflicted sub-fields#156326alighahramani-alig wants to merge 2 commits into
Conversation
|
Hi @alighahramani-alig, I've created a changelog YAML for you. |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
9687688 to
3865e19
Compare
A cross-index type conflict on a multi-field sub-field is stored as
coordinator-only metadata inside its parent field's properties map.
When the healthy parent is serialized to a data node, the child's
writeContent throws ("InvalidMappedField must never leave the
coordinator" / "CompactInvalidMappedField shouldn't be transported").
UnionTypesCleanup only sanitized top-level conflicted attributes. Make
it recurse into properties, replacing nested TypeConflictedField and
InvalidMappedTsField children with a transportable UnsupportedEsField.
Add a subtype-preserving EsField#withProperties so the rebuilt parent
keeps its concrete type.
Relates to elastic#152322.
3865e19 to
d9ccd38
Compare
|
Hi @alighahramani-alig, I've created a changelog YAML for you. |
ES|QL can crash when a query plan is shipped to a data node: a cross-index type
conflict on a multi-field sub-field is coordinator-only metadata, but it survives
nested inside its healthy parent field's
propertiesmap and throws onserialization (
InvalidMappedField must never leave the coordinator/CompactInvalidMappedField shouldn't be transported). This makesUnionTypesCleanuprecurse into a field'spropertiesand replace such nestedconflict fields with a transportable
UnsupportedEsField, so the parentFieldAttributeserializes cleanly. Surfaced by SDH #10177 (a customer on 9.4.3hit this via a
TSquery); relates to #152322.Why only
TS, why it's safe, why no version guardWhy only
TS? The conflict is on a sub-field, so it only bites once itsparent is shipped to a data node.
FROMships only the fields you name;TSadditionally force-resolves every time-series dimension, so it pulls in the parent
— and its conflicted sub-field — even when the query never names it. (A top-level
conflict never gets here: it is turned into an unsupported field before planning.)
Why is it safe? The conflict child was already unusable, so swapping it for an
UnsupportedEsFieldkeeps the same meaning; explicitx.sub::typecasts areresolved earlier and untouched; and any query that shipped the parent used to
crash, so there is no working behavior to lose.
EsField#withPropertieskeeps theparent's concrete type (keyword/text/date) so exact-match and sort still work.
Why no version guard? Cleanup runs on the coordinator and emits
UnsupportedEsField, a wire type every node already understands — nothing newcrosses the wire. A new coordinator → old data node is fine; an old coordinator
still throws on its own write (the pre-existing bug, unchanged).
Tested by a 2-node
internalClusterTestreproducer plus analyzer tests. Relates to#152350 — this also handles
InvalidMappedTsFieldsub-fields and preserves theparent subtype.