Skip to content

Deprecation logger rejects new entries after upgrade to 9.0 unless deprecation log data stream is rolled over #125445

@masseyke

Description

@masseyke

Elasticsearch Version

9.0

Problem Description

In #117933, we changed the name of the dataset for the deprecation log data stream from deprecation.elasticsearch to elasticsearch.deprecation. If you had data in that data stream in 8.x or earlier, then when you upgrade to 9.0, if the deprecation logger is called the deprecations will be rejected. You will see entries like this in your (non-deprecation) logs:

Caused by: java.lang.IllegalArgumentException: [constant_keyword] field [data_stream.dataset] only accepts values that are equal to the value defined in the mappings [deprecation.elasticsearch], but got [elasticsearch.deprecation] 
[instance-0000000005] Bulk write of deprecation logs encountered some failures: [[4VK3j5UBamJ0EqvgUJmJ org.elasticsearch.index.mapper.DocumentParsingException: [1:87] failed to parse field [data_stream.dataset] of type [constant_keyword] in document with id '4VK3j5UBamJ0EqvgUJmJ'. Preview of field's value: 'elasticsearch.deprecation']]

The problem continues until you roll over the deprecation log data stream (.logs-deprecation.default). We discussed a couple of options to fix this:

  1. A one-off service that gets started with a node from the deprecation xpack module. It would wait in a new feature in the cluster, and once that feature is available (so once all nodes are 9.0+), force a rollover of the .logs-deprecation.default datastream. Then the service would shut itself down.
  2. Change the mapping of the dataset field to be a keyword rather than a constant_keyword, since that field is no longer a constant in this data stream (it is a constant in any backing index, but across the data stream it can now have two different values).

Steps to Reproduce

Start a cluster in 8.x. Do something that causes a deprecation message to be logged. Upgrade to 9.0. Do something that causes a deprecation message to be logged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions