Skip to content

Commit e2ebfb7

Browse files
committed
Enhance deprecation message when index name contains ':' (#34867)
The message was a little unclear in that we will still support indices that have a ':' in the name in 7.0, we will only prevent index creation containing a ':' Relates to #23892 (comment)
1 parent b1112ff commit e2ebfb7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

server/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ public static void validateIndexOrAliasName(String index, BiFunction<String, Str
169169
}
170170
if (index.contains(":")) {
171171
deprecationLogger.deprecated("index or alias name [" + index +
172-
"] containing ':' is deprecated and will not be supported in Elasticsearch 7.0+");
172+
"] containing ':' is deprecated. Elasticsearch 7.x will read, " +
173+
"but not allow creation of new indices containing ':'");
173174
}
174175
if (index.charAt(0) == '_' || index.charAt(0) == '-' || index.charAt(0) == '+') {
175176
throw exceptionCtor.apply(index, "must not start with '_', '-', or '+'");

server/src/test/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexServiceTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ public void testValidateIndexName() throws Exception {
415415

416416
MetaDataCreateIndexService.validateIndexName("foo:bar", ClusterState.builder(ClusterName.CLUSTER_NAME_SETTING
417417
.getDefault(Settings.EMPTY)).build());
418-
assertWarnings("index or alias name [foo:bar] containing ':' is deprecated and will not be supported in Elasticsearch 7.0+");
418+
assertWarnings("index or alias name [foo:bar] containing ':' is deprecated. Elasticsearch 7.x will read, " +
419+
"but not allow creation of new indices containing ':'");
419420
}
420421

421422
private void validateIndexName(String indexName, String errorMessage) {

0 commit comments

Comments
 (0)