Skip to content

Drop deprecation warnings when updating a mapping in the cluster state applier (#143884)#144040

Merged
gmarouli merged 9 commits intoelastic:mainfrom
gmarouli:bug-fix-handle-warnings-when-updating-mapping
Mar 12, 2026
Merged

Drop deprecation warnings when updating a mapping in the cluster state applier (#143884)#144040
gmarouli merged 9 commits intoelastic:mainfrom
gmarouli:bug-fix-handle-warnings-when-updating-mapping

Conversation

@gmarouli
Copy link
Copy Markdown
Contributor

Recently (#141877), we deprecated the default_metric of the aggregate_metric_double field type. As a result, elasticsearch adds a deprecation warning to any request that is using this configuration.

We have adjusted tests to allow this warning. However, we noticed that these warnings some times leaked to other requests. For example, in the following logs we see an index create request that is not using an aggregate_metric_double at all is also returning the warning header in certain scenarios:

[2026-03-03T12:11:44,927][WARN ][o.e.c.RestClient         ][testTsIndexConflictingTypes] request [PUT http://[::1]:36637/metrics-long] returned 1 warnings: [299 Elasticsearch-9.4.0-bca3093cd0619c6871cfa5d1cad2e839fcfbdc9b "Parameter [default_metric] is deprecated and will be removed in a future version"]
[2026-03-03T12:11:44,933][ERROR][o.e.x.e.q.r.FieldExtractorTestCase][testTsIndexConflictingTypes] Received warning when creating index [metrics-long] with mapping [{metrics-long={mappings={_data_stream_timestamp={enabled=true}, properties={@timestamp={type=date}, metric={properties={name={time_series_dimension=true, type=keyword}, value={time_series_metric=gauge, type=long}}}}}}}]

We narrowed it down to the cluster state applier, when it was applying mapping changes, it was calling the mapper service which re-parsed the mapping, potentially adding deprecation warning response headers. At this point there is no way to send these warnings back to the client so we just drop them.

The user will have already be notified about these warnings about the request the created or updated this mapping in the first place.

Closes: #143884
Closes: #142964
Closes: #142544
Closes: #142477
Closes: #142410

@gmarouli gmarouli added >bug :StorageEngine/Mapping The storage related side of mappings labels Mar 11, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Member

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

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

LGTM

@gmarouli gmarouli merged commit eb8058b into elastic:main Mar 12, 2026
16 of 19 checks passed
@gmarouli gmarouli deleted the bug-fix-handle-warnings-when-updating-mapping branch March 12, 2026 15:46
szybia added a commit to szybia/elasticsearch that referenced this pull request Mar 12, 2026
…elocations

* upstream/main: (49 commits)
  CCS logging fixes (elastic#144070)
  Improve CPS cluster exclusion handling (elastic#143488)
  Remove snapshot condition now that node_reduce phase is in non-snapshot builds (elastic#144090)
  Drop deprecation warnings when updating a mapping in the cluster state applier (elastic#143884) (elastic#144040)
  Add ensureGreenAndNoInitializingShards helper (elastic#144044)
  Removed unnecessary applies_to blocks from deprecated query (elastic#144096)
  [CPS] Use single CrossProjectModeDecider instance (elastic#144030)
  Fix ESQL TS requests with LIMIT 0 (elastic#144031)
  ESQL: Remove `create` methods in aggs (elastic#144098)
  ES|QL: Refactor ChangeLimitOperator (elastic#144017)
  Add Paginated Hit Source Tests (elastic#142592)
  Fix test failure not preferred (elastic#144019)
  Remove serialization logic from EIS authorization response (elastic#144021)
  ESQL: CSV schema inference and parsing enhancements (elastic#144050)
  ESQL: Fix incorrectly optimized fork with nullify unmapped_fields (elastic#143030)
  Fix MMR release test using subqueries (elastic#144087)
  Refactoring `UserAgentPlugin` (elastic#140712)
  Drop non-finite samples in Prometheus remote write (elastic#144055)
  [TEST] Wait for internal inference indices to be created in authorization IT (elastic#143885)
  Disable ndjson datasource QA tests in release-tests (elastic#143992)
  ...
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
…e applier (elastic#143884) (elastic#144040)

When the cluster state applier was applying mapping changes, it was calling the mapper service which re-parsed the mapping, potentially adding deprecation warning response headers. At this point there is no way to send these warnings back to the client so we just drop them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment