Skip to content

Commit

Permalink
Disable index.mapper.dynamic index setting validation. (#109160)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
martijnvg authored May 29, 2024
1 parent 6f20cba commit e4ef0ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/changelog/109160.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 109160
summary: Disable `index.mapper.dynamic` index setting validation
area: Mapping
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit e4ef0ff

Please sign in to comment.