-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
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.