Skip to content

Commit bb78a28

Browse files
authored
Remove index.mapper.dynamic setting (#113000)
This setting had been removed in the past, it was reintroudced for bw comp with 7.x with #109341. It can now be removed from main as it no longer supports indices created with 7.x
1 parent 1f4262e commit bb78a28

File tree

4 files changed

+0
-134
lines changed

4 files changed

+0
-134
lines changed

qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/upgrades/UpgradeWithOldIndexSettingsIT.java

Lines changed: 0 additions & 84 deletions
This file was deleted.

qa/rolling-upgrade/src/javaRestTest/java/org/elasticsearch/upgrades/UpgradeWithOldIndexSettingsIT.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import java.util.Map;
2424

2525
import static org.elasticsearch.rest.action.search.RestSearchAction.TOTAL_HITS_AS_INT_PARAM;
26-
import static org.hamcrest.Matchers.containsString;
27-
import static org.hamcrest.Matchers.equalTo;
2826
import static org.hamcrest.Matchers.is;
2927

3028
public class UpgradeWithOldIndexSettingsIT extends AbstractRollingUpgradeTestCase {
@@ -105,39 +103,6 @@ public void testOldIndexSettings() throws Exception {
105103
}
106104
}
107105

108-
public void testMapperDynamicIndexSetting() throws IOException {
109-
assumeTrue(
110-
"Setting deprecated in 6.x, but was disallowed/removed incorrectly in some 7.x versions and can only be set safely in 7.17.22. "
111-
+ "Setting can't be used in 8.x ",
112-
getOldClusterTestVersion().before("8.0.0") && getOldClusterTestVersion().after("7.17.21")
113-
);
114-
String indexName = "my-index";
115-
if (isOldCluster()) {
116-
createIndex(indexName);
117-
Request request = new Request("PUT", "/" + indexName + "/_settings");
118-
request.setJsonEntity(org.elasticsearch.common.Strings.toString(Settings.builder().put("index.mapper.dynamic", true).build()));
119-
request.setOptions(
120-
expectWarnings(
121-
"[index.mapper.dynamic] setting was deprecated in Elasticsearch and will be removed in a future release! "
122-
+ "See the breaking changes documentation for the next major version."
123-
)
124-
);
125-
assertOK(client().performRequest(request));
126-
} else {
127-
if (isUpgradedCluster()) {
128-
var indexSettings = getIndexSettings(indexName);
129-
assertThat(XContentMapValues.extractValue(indexName + ".settings.index.mapper.dynamic", indexSettings), equalTo("true"));
130-
ensureGreen(indexName);
131-
// New indices can never define the index.mapper.dynamic setting.
132-
Exception e = expectThrows(
133-
ResponseException.class,
134-
() -> createIndex("my-index2", Settings.builder().put("index.mapper.dynamic", true).build())
135-
);
136-
assertThat(e.getMessage(), containsString("unknown setting [index.mapper.dynamic]"));
137-
}
138-
}
139-
}
140-
141106
private void assertCount(String index, int countAtLeast) throws IOException {
142107
Request searchTestIndexRequest = new Request("POST", "/" + index + "/_search");
143108
searchTestIndexRequest.addParameter(TOTAL_HITS_AS_INT_PARAM, "true");

server/src/main/java/org/elasticsearch/common/settings/IndexScopedSettings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ public final class IndexScopedSettings extends AbstractScopedSettings {
161161
MapperService.INDEX_MAPPING_DEPTH_LIMIT_SETTING,
162162
MapperService.INDEX_MAPPING_DIMENSION_FIELDS_LIMIT_SETTING,
163163
MapperService.INDEX_MAPPING_FIELD_NAME_LENGTH_LIMIT_SETTING,
164-
MapperService.INDEX_MAPPER_DYNAMIC_SETTING,
165164
BitsetFilterCache.INDEX_LOAD_RANDOM_ACCESS_FILTERS_EAGERLY_SETTING,
166165
IndexModule.INDEX_STORE_TYPE_SETTING,
167166
IndexModule.INDEX_STORE_PRE_LOAD_SETTING,

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
2323
import org.elasticsearch.common.xcontent.XContentHelper;
2424
import org.elasticsearch.core.Nullable;
25-
import org.elasticsearch.core.UpdateForV9;
2625
import org.elasticsearch.index.AbstractIndexComponent;
2726
import org.elasticsearch.index.IndexSettings;
2827
import org.elasticsearch.index.IndexVersion;
@@ -149,19 +148,6 @@ public boolean isAutoUpdate() {
149148
Property.Dynamic,
150149
Property.IndexScope
151150
);
152-
/**
153-
* Legacy index setting, kept for 7.x BWC compatibility. This setting has no effect in 8.x. Do not use.
154-
* TODO: Remove in 9.0
155-
*/
156-
@Deprecated
157-
@UpdateForV9
158-
public static final Setting<Boolean> INDEX_MAPPER_DYNAMIC_SETTING = Setting.boolSetting(
159-
"index.mapper.dynamic",
160-
true,
161-
Property.Dynamic,
162-
Property.IndexScope,
163-
Property.IndexSettingDeprecatedInV7AndRemovedInV8
164-
);
165151

166152
private final IndexAnalyzers indexAnalyzers;
167153
private final MappingParser mappingParser;

0 commit comments

Comments
 (0)