-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
In the past we have had problems with annotations index mappings, and have documented steps to work around these: https://www.elastic.co/guide/en/machine-learning/7.10/ml-troubleshooting.html#ml-troubleshooting-mappings
Recently it has become clear that a lot of users do not consider the problems that result from incorrect annotations index mappings serious enough to follow the instructions. So they continue to use the ML feature, but with a degraded experience around annotations.
It has also become apparent that we still have a major problem with annotations index mappings, because we don't update them quickly enough if a user restores a snapshot from an old version where the mappings were different.
We should be able to avoid these problems in the future by doing the following:
- Creating a new annotations index, say
.ml-annotations-000001, setting the annotations write alias to point at this index, and setting the annotations read alias to point at this index plus any indices it already points at. This will ensure that new annotations go into an index with the correct mappings. - Disabling dynamic mappings for the new index. This will ensure that if this new index is ever restored from a snapshot in a version of the product where we've added new fields to the mappings, those fields won't get dynamic mappings during the period between the snapshot restoration completing and our code having a chance to update the mappings. (If we ever do want to update the mappings then we should also probably use the transforms approach of creating a new index with the new mappings, because that's more robust to snapshot restoration. We should also avoid mindlessly adding every new field to the mappings - if it's unlikely the new field will ever be used in a search request then it can just live in
_sourceas an unsearchable field.)
Fixing elastic/kibana#113365 is a prerequisite to making these changes. Since an older Kibana can run against a newer Elasticsearch the ideal plan would be to fix elastic/kibana#113365 in 7.16 and this issue in 8.0.