From cbf856f284578fb91b969122e2a9119d6a58cf11 Mon Sep 17 00:00:00 2001 From: David Roberts Date: Wed, 27 Sep 2023 16:43:17 +0100 Subject: [PATCH] Add a comment --- .../xpack/core/ml/utils/MlIndexAndAlias.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java index ef2adbc46d67b..78a3493e8ae6b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/utils/MlIndexAndAlias.java @@ -50,6 +50,16 @@ */ public final class MlIndexAndAlias { + /** + * ML managed index mappings used to be updated based on the product version. + * They are now updated based on per-index mappings versions. However, older + * nodes will still look for a product version in the mappings metadata, so + * we have to put something in that field that will allow the older + * node to realise that the mappings are ahead of what it knows about. The + * easiest solution is to hardcode 8.11.0 in this field, because any node + * from 8.10.0 onwards should be using per-index mappings versions to determine + * whether mappings are up-to-date. + */ public static final String BWC_MAPPINGS_VERSION = "8.11.0"; private static final Logger logger = LogManager.getLogger(MlIndexAndAlias.class);