Description
Since #33727 went into 7.2 interval
is deprecated in date histograms. New date histograms should use fixed_interval
or calendar_interval
instead. In 8.x it is likely that date histograms containing interval
will be considered invalid.
ML datafeed configs are persisted and are likely to contain interval
rather than fixed_interval
or calendar_interval
; they definitely will if they were first created in a version earlier than 7.2. Such datafeed configs will be invalid in 8.0, so prior to 8.0 we must do something about this, but there is no reason we cannot start sooner.
The best course of action would seem to be to silently rewrite datafeed configs that contain a date_histogram
aggregation with an interval
setting to have whichever of fixed_interval
or calendar_interval
preserves the current behaviour.
We can do this unconditionally providing the oldest node in the cluster is on version 7.2 or above.
Rollups already does this silent behaviour-preserving rewriting, although rollup configs are stored in cluster state which makes this considerably easier than for the ML configs that are stored in an index.
The code that does the translation for rollups is in:
and:
That should be considered as the spec for how to do a silent behaviour-preserving rewrite.
The extra complexity in ML is deciding where to do the migration for datafeed configs that wouldn't otherwise be rewritten. If we do it in the datafeed config parser then that ensures that newly submitted configs and datafeed configs that are updated will get translated. Then we would just need to find an appropriate place to do it for existing datafeed configs - maybe on master node election providing the oldest node in the cluster is version 7.2 or above?
There are also some currently muted tests that should be reenabled when the work is done: