Skip to content

Commit e4ef0ff

Browse files
authored
Disable index.mapper.dynamic index setting validation. (#109160)
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. Relates to #96075
1 parent 6f20cba commit e4ef0ff

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

docs/changelog/109160.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 109160
2+
summary: Disable `index.mapper.dynamic` index setting validation
3+
area: Mapping
4+
type: bug
5+
issues: []

server/src/main/java/org/elasticsearch/index/mapper/MapperService.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959

6060
public class MapperService extends AbstractIndexComponent implements Closeable {
6161

62+
private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(MapperService.class);
63+
6264
/**
6365
* The reason why a mapping is being merged.
6466
*/
@@ -205,7 +207,12 @@ public MapperService(
205207

206208
if (INDEX_MAPPER_DYNAMIC_SETTING.exists(indexSettings.getSettings())
207209
&& indexSettings.getIndexVersionCreated().onOrAfter(Version.V_7_0_0)) {
208-
throw new IllegalArgumentException("Setting " + INDEX_MAPPER_DYNAMIC_SETTING.getKey() + " was removed after version 6.0.0");
210+
DEPRECATION_LOGGER.warn(
211+
DeprecationCategory.MAPPINGS,
212+
"index.mapper.dynamic",
213+
"Setting {} was removed after version 6.0.0",
214+
INDEX_MAPPER_DYNAMIC_SETTING.getKey()
215+
);
209216
}
210217
defaultMappingSource = "{\"_default_\":{}}";
211218
if (logger.isTraceEnabled()) {

0 commit comments

Comments
 (0)