Skip to content

[EPM] Reduce number of indices on upgrade #56359

@ruflin

Description

@ruflin

The currently documented upgrade path for packages should work but has the side effect of potentially creating many indices. Assuming a package has 10 datasets which are used by the user and is used in 2 namespaces, this leads to 20 indices. Now every time the package is updated, 20 more indices are added as the rollover is triggered for the new mappings and ingest pipeline to apply.

Most package updates are backward compatible and only a subset of the datasets is updated. This allows to reduce the number of newly created indices with the following proposal. Kibana assets are skipped below.

  • Package is updated
  • New ingest pipeline is loaded into ES
  • New Elasticsearch Alias template is loaded
  • Update mappings of all dataset indices with POST {alias}/_mapping
  • Update the pipeline settings of all dataset indices with POST {alias}/_settings.
  • In case of an error during update of a dataset, trigger rollover for this dataset
  • Remove old ingest pipeline

The above will have the effect, that only indices are rolled over where a conflict with the previous mapping exist. These then directly get rolled over and the new index template is applied. In case a rollover is triggered by ILM in the middle of the above process, it is also not a problem as the updated Elasticsearch template will already exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature:EPMFleet team's Elastic Package Manager (aka Integrations) projectTeam:FleetTeam label for Observability Data Collection Fleet team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions