[8.19] [Transform] Skip checkpoint query filter when runtime_mappings are present (#142452)#143170
Merged
elasticsearchmachine merged 2 commits intoelastic:8.19from Feb 27, 2026
Merged
Conversation
…esent (elastic#142452) ## Problem When a transform's source query references runtime fields, `DefaultCheckpointProvider.getIndexCheckpoints` passes the query to `GetCheckpointAction.Request`, which builds a `SearchShardsRequest` for shard-level `can_match` filtering. Neither `GetCheckpointAction.Request` nor `SearchShardsRequest` supports `runtime_mappings`, so the `search_shards` API fails every time. The graceful fallback in `TransportGetCheckpointAction` (lines 137-145) catches this failure, logs a **warning**, and falls back to unfiltered shard resolution. This means: - A warning-level log message fires on **every checkpoint** when runtime fields + query filter are used together - The shard-skipping optimization is lost anyway (all shards queried on failure) - No data correctness bug, but noisy logs in production ## Approach Apply the same pattern used for the [PIT `indexFilter` fix](elastic#142450): when `runtime_mappings` are present, pass `null` as the query to `GetCheckpointAction.Request` (skipping the shard-filtering optimization cleanly rather than failing and falling back). This is the simplest fix because: - Propagating `runtime_mappings` through `GetCheckpointAction.Request` -> `SearchShardsRequest` -> `TransportSearchShardsAction` would require changes to core server classes and wire serialization — a much larger, riskier change for a minor optimization - The end result is identical (all shards are queried), just without the error/warning noise
neilbhavsar
pushed a commit
that referenced
this pull request
Feb 27, 2026
… are present (#142452) (#143170) * [Transform] Skip checkpoint query filter when runtime_mappings are present (#142452) ## Problem When a transform's source query references runtime fields, `DefaultCheckpointProvider.getIndexCheckpoints` passes the query to `GetCheckpointAction.Request`, which builds a `SearchShardsRequest` for shard-level `can_match` filtering. Neither `GetCheckpointAction.Request` nor `SearchShardsRequest` supports `runtime_mappings`, so the `search_shards` API fails every time. The graceful fallback in `TransportGetCheckpointAction` (lines 137-145) catches this failure, logs a **warning**, and falls back to unfiltered shard resolution. This means: - A warning-level log message fires on **every checkpoint** when runtime fields + query filter are used together - The shard-skipping optimization is lost anyway (all shards queried on failure) - No data correctness bug, but noisy logs in production ## Approach Apply the same pattern used for the [PIT `indexFilter` fix](#142450): when `runtime_mappings` are present, pass `null` as the query to `GetCheckpointAction.Request` (skipping the shard-filtering optimization cleanly rather than failing and falling back). This is the simplest fix because: - Propagating `runtime_mappings` through `GetCheckpointAction.Request` -> `SearchShardsRequest` -> `TransportSearchShardsAction` would require changes to core server classes and wire serialization — a much larger, riskier change for a minor optimization - The end result is identical (all shards are queried), just without the error/warning noise * fix build error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following commits to 8.19: