From d5c0df166c8d70c020f28d584bf63f473eab76d5 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 29 May 2024 14:48:46 +0200 Subject: [PATCH 1/2] Disable index.mapper.dynamic index setting validation. This setting was removed via #25734, because the setting no longer used since 6.0.0 However, the validation only kicked when trying to set this setting on a closed index. Applying the setting on an open index would just work. With severe consequences later on. For example when upgrading the cluster, nodes would refuse to boot, because the validation would kick in. --- .../org/elasticsearch/index/mapper/MapperService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java index a05d49afb0d9c..d311bdf05d371 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -59,6 +59,8 @@ public class MapperService extends AbstractIndexComponent implements Closeable { + private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(MapperService.class); + /** * The reason why a mapping is being merged. */ @@ -205,7 +207,12 @@ public MapperService( if (INDEX_MAPPER_DYNAMIC_SETTING.exists(indexSettings.getSettings()) && indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0)) { - throw new IllegalArgumentException("Setting " + INDEX_MAPPER_DYNAMIC_SETTING.getKey() + " was removed after version 6.0.0"); + DEPRECATION_LOGGER.warn( + DeprecationCategory.MAPPINGS, + "index.mapper.dynamic", + "Setting {} was removed after version 6.0.0", + INDEX_MAPPER_DYNAMIC_SETTING.getKey() + ); } defaultMappingSource = "{\"_default_\":{}}"; if (logger.isTraceEnabled()) { From fb35d812e696a60a7233ed8e53e8632d8e2f19be Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 29 May 2024 14:50:21 +0200 Subject: [PATCH 2/2] Update docs/changelog/109160.yaml --- docs/changelog/109160.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/changelog/109160.yaml diff --git a/docs/changelog/109160.yaml b/docs/changelog/109160.yaml new file mode 100644 index 0000000000000..966e1da08b7b7 --- /dev/null +++ b/docs/changelog/109160.yaml @@ -0,0 +1,5 @@ +pr: 109160 +summary: Disable `index.mapper.dynamic` index setting validation +area: Mapping +type: bug +issues: []