mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Updating deprecation message wording based on docs team feedback (#79387)
This commit updates deprecation info API wording based on feedback from the docs team.
This commit is contained in:
parent
69cf4a3154
commit
f662dc1cf3
9 changed files with 556 additions and 520 deletions
|
@ -41,7 +41,7 @@ public class MigrationIT extends ESRestHighLevelClientTestCase {
|
||||||
List<DeprecationInfoResponse.DeprecationIssue> nodeSettingsIssues = response.getNodeSettingsIssues();
|
List<DeprecationInfoResponse.DeprecationIssue> nodeSettingsIssues = response.getNodeSettingsIssues();
|
||||||
if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) {
|
if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) {
|
||||||
nodeSettingsIssues = nodeSettingsIssues.stream()
|
nodeSettingsIssues = nodeSettingsIssues.stream()
|
||||||
.filter(each -> each.getMessage().equals("Java 11 is required") == false)
|
.filter(each -> each.getMessage().equals("Java 11 is required in 8.0") == false)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class MlDeprecationIT extends ESRestTestCase {
|
||||||
assertThat(response.getMlSettingsIssues(), hasSize(1));
|
assertThat(response.getMlSettingsIssues(), hasSize(1));
|
||||||
assertThat(
|
assertThat(
|
||||||
response.getMlSettingsIssues().get(0).getMessage(),
|
response.getMlSettingsIssues().get(0).getMessage(),
|
||||||
containsString("model snapshot [1] for job [deprecation_check_job] needs to be deleted or upgraded")
|
containsString("Snapshot [1] for job [deprecation_check_job] has an obsolete minimum version")
|
||||||
);
|
);
|
||||||
assertThat(response.getMlSettingsIssues().get(0).getMeta(), equalTo(Map.of("job_id", jobId, "snapshot_id", "1")));
|
assertThat(response.getMlSettingsIssues().get(0).getMeta(), equalTo(Map.of("job_id", jobId, "snapshot_id", "1")));
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,10 +73,10 @@ public class ClusterDeprecationChecks {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (pipelinesWithDeprecatedEcsConfig.isEmpty() == false) {
|
if (pipelinesWithDeprecatedEcsConfig.isEmpty() == false) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"User-Agent ingest plugin will always use ECS-formatted output",
|
"The User-Agent ingest processor's ecs parameter is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-ingest-pipeline-ecs-option",
|
"https://ela.st/es-deprecation-7-ingest-pipeline-ecs-option",
|
||||||
"Ingest pipelines " + pipelinesWithDeprecatedEcsConfig +
|
"Remove the ecs parameter from your ingest pipelines. The User-Agent ingest processor always returns Elastic Common " +
|
||||||
" uses the [ecs] option which needs to be removed to work in 8.0", false, null);
|
"Schema (ECS) fields in 8.0.", false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -136,11 +136,12 @@ public class ClusterDeprecationChecks {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (templatesContainingFieldNames.isEmpty() == false) {
|
if (templatesContainingFieldNames.isEmpty() == false) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING, "Index templates contain _field_names settings.",
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING, "Disabling the \"_field_names\" field in a template's index " +
|
||||||
"https://ela.st/es-deprecation-7-field_names-settings",
|
"mappings is deprecated",
|
||||||
"Index templates " + templatesContainingFieldNames + " use the deprecated `enable` setting for the `"
|
"https://ela.st/es-deprecation-7-field_names-settings",
|
||||||
+ FieldNamesFieldMapper.NAME + "` field. Using this setting in new index mappings will throw an error "
|
String.format(Locale.ROOT, "Remove the \"%s\" mapping that configures the enabled setting from the " +
|
||||||
+ "in the next major version and needs to be removed from existing mappings and templates.",
|
"following templates: \"%s\". There's no longer a need to disable this field to reduce index overhead if you have a " +
|
||||||
|
"lot of fields.", FieldNamesFieldMapper.NAME, templatesContainingFieldNames.stream().collect(Collectors.joining(","))),
|
||||||
false, null);
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -177,8 +178,9 @@ public class ClusterDeprecationChecks {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"Index Lifecycle Management poll interval is set too low",
|
"Index Lifecycle Management poll interval is set too low",
|
||||||
"https://ela.st/es-deprecation-7-indices-lifecycle-poll-interval-setting",
|
"https://ela.st/es-deprecation-7-indices-lifecycle-poll-interval-setting",
|
||||||
"The Index Lifecycle Management poll interval setting [" + LIFECYCLE_POLL_INTERVAL_SETTING.getKey() + "] is " +
|
String.format(Locale.ROOT,"The ILM [%s] setting is set to [%s]. Set the interval to at least 1s.",
|
||||||
"currently set to [" + pollIntervalString + "], but must be 1s or greater", false, null);
|
LIFECYCLE_POLL_INTERVAL_SETTING.getKey(), pollIntervalString),
|
||||||
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -196,10 +198,10 @@ public class ClusterDeprecationChecks {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"Some index templates contain multiple mapping types",
|
"Multiple mapping types in index templates and indices is not supported",
|
||||||
"https://ela.st/es-deprecation-7-multiple-types",
|
"https://ela.st/es-deprecation-7-multiple-types",
|
||||||
"Index templates " + templatesWithMultipleTypes
|
"Update or remove the following index templates before upgrading to 8.0: " + templatesWithMultipleTypes +
|
||||||
+ " define multiple types and so will cause errors when used in index creation",
|
". See https://ela.st/es-deprecation-7-removal-of-types for alternatives to mapping types.",
|
||||||
false,
|
false,
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
|
@ -208,13 +210,15 @@ public class ClusterDeprecationChecks {
|
||||||
return checkRemovedSetting(clusterState.metadata().settings(),
|
return checkRemovedSetting(clusterState.metadata().settings(),
|
||||||
CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING,
|
CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
||||||
|
"Relocating shards are always taken into account in 8.0.",
|
||||||
DeprecationIssue.Level.WARNING
|
DeprecationIssue.Level.WARNING
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private static String getDetailsMessageForGeoShapeComponentTemplates(Map<String, ComponentTemplate> componentTemplates) {
|
private static Map<String, List<String>> getComponentTemplatesWithDeprecatedGeoShapeProperties(
|
||||||
String detailsForComponentTemplates =
|
Map<String, ComponentTemplate> componentTemplates) {
|
||||||
|
Map<String, List<String>> detailsForComponentTemplates =
|
||||||
componentTemplates.entrySet().stream().map((templateCursor) -> {
|
componentTemplates.entrySet().stream().map((templateCursor) -> {
|
||||||
String templateName = templateCursor.getKey();
|
String templateName = templateCursor.getKey();
|
||||||
ComponentTemplate componentTemplate = templateCursor.getValue();
|
ComponentTemplate componentTemplate = templateCursor.getValue();
|
||||||
|
@ -227,26 +231,23 @@ public class ClusterDeprecationChecks {
|
||||||
IndexDeprecationChecks.findInPropertiesRecursively(GeoShapeFieldMapper.CONTENT_TYPE,
|
IndexDeprecationChecks.findInPropertiesRecursively(GeoShapeFieldMapper.CONTENT_TYPE,
|
||||||
mappingAsMap,
|
mappingAsMap,
|
||||||
IndexDeprecationChecks::isGeoShapeFieldWithDeprecatedParam,
|
IndexDeprecationChecks::isGeoShapeFieldWithDeprecatedParam,
|
||||||
IndexDeprecationChecks::formatDeprecatedGeoShapeParamMessage);
|
IndexDeprecationChecks::formatDeprecatedGeoShapeParamMessage, "[", "]");
|
||||||
if (messages.isEmpty() == false) {
|
return Tuple.tuple(templateName, messages);
|
||||||
String messageForMapping =
|
|
||||||
"mappings in component template " + templateName + " contains deprecated geo_shape properties. " +
|
|
||||||
messages.stream().collect(Collectors.joining("; "));
|
|
||||||
return messageForMapping;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}).filter(messageForTemplate -> Strings.isEmpty(messageForTemplate) == false).collect(Collectors.joining("; "));
|
}).filter(templateToMessagesTuple -> templateToMessagesTuple != null && templateToMessagesTuple.v2().isEmpty() == false)
|
||||||
|
.collect(Collectors.toMap(Tuple<String, List<String>>::v1, Tuple<String, List<String>>::v2));
|
||||||
return detailsForComponentTemplates;
|
return detailsForComponentTemplates;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private static String getDetailsMessageForGeoShapeIndexTemplates(ImmutableOpenMap<String, IndexTemplateMetadata> indexTemplates) {
|
private static Map<String, List<String>> getIndexTemplatesWithDeprecatedGeoShapeProperties(
|
||||||
String detailsForIndexTemplates =
|
ImmutableOpenMap<String, IndexTemplateMetadata> indexTemplates) {
|
||||||
|
Map<String, List<String>> detailsForIndexTemplates =
|
||||||
StreamSupport.stream(indexTemplates.spliterator(), false).map((templateCursor) -> {
|
StreamSupport.stream(indexTemplates.spliterator(), false).map((templateCursor) -> {
|
||||||
String templateName = templateCursor.key;
|
String templateName = templateCursor.key;
|
||||||
IndexTemplateMetadata indexTemplateMetadata = templateCursor.value;
|
IndexTemplateMetadata indexTemplateMetadata = templateCursor.value;
|
||||||
String messageForTemplate =
|
List<String> messagesForTemplate =
|
||||||
StreamSupport.stream(indexTemplateMetadata.getMappings().spliterator(), false).map((mappingCursor) -> {
|
StreamSupport.stream(indexTemplateMetadata.getMappings().spliterator(), false).map((mappingCursor) -> {
|
||||||
CompressedXContent mapping = mappingCursor.value;
|
CompressedXContent mapping = mappingCursor.value;
|
||||||
Tuple<XContentType, Map<String, Object>> tuple = XContentHelper.convertToMap(mapping.uncompressed(), true,
|
Tuple<XContentType, Map<String, Object>> tuple = XContentHelper.convertToMap(mapping.uncompressed(), true,
|
||||||
|
@ -256,39 +257,74 @@ public class ClusterDeprecationChecks {
|
||||||
IndexDeprecationChecks.findInPropertiesRecursively(GeoShapeFieldMapper.CONTENT_TYPE,
|
IndexDeprecationChecks.findInPropertiesRecursively(GeoShapeFieldMapper.CONTENT_TYPE,
|
||||||
mappingAsMap,
|
mappingAsMap,
|
||||||
IndexDeprecationChecks::isGeoShapeFieldWithDeprecatedParam,
|
IndexDeprecationChecks::isGeoShapeFieldWithDeprecatedParam,
|
||||||
IndexDeprecationChecks::formatDeprecatedGeoShapeParamMessage);
|
IndexDeprecationChecks::formatDeprecatedGeoShapeParamMessage, "[", "]");
|
||||||
return messages;
|
return messages;
|
||||||
}).filter(messages -> messages.isEmpty() == false).map(messages -> {
|
}).filter(messages -> messages.isEmpty() == false).flatMap(x -> x.stream()).collect(Collectors.toList());
|
||||||
String messageForMapping =
|
return Tuple.tuple(templateName, messagesForTemplate);
|
||||||
"mappings in index template " + templateName + " contains deprecated geo_shape properties. " +
|
}).filter(templateToMessagesTuple -> templateToMessagesTuple != null && templateToMessagesTuple.v2().isEmpty() == false)
|
||||||
messages.stream().collect(Collectors.joining("; "));
|
.collect(Collectors.toMap(Tuple<String, List<String>>::v1, Tuple<String, List<String>>::v2));
|
||||||
return messageForMapping;
|
|
||||||
}).collect(Collectors.joining("; "));
|
|
||||||
return messageForTemplate;
|
|
||||||
}).filter(messageForTemplate -> Strings.isEmpty(messageForTemplate) == false).collect(Collectors.joining("; "));
|
|
||||||
return detailsForIndexTemplates;
|
return detailsForIndexTemplates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getDetailsMessageForTemplatesWithDeprecations(Map<String, List<String>> templateToMessages,
|
||||||
|
boolean forceIncludeTemplateName) {
|
||||||
|
final boolean includeTemplateName = forceIncludeTemplateName || templateToMessages.keySet().size() > 1;
|
||||||
|
return templateToMessages.entrySet().stream().filter(entry -> entry.getValue().isEmpty() == false)
|
||||||
|
.map(entry -> {
|
||||||
|
StringBuilder message = new StringBuilder();
|
||||||
|
if (includeTemplateName) {
|
||||||
|
message.append("[");
|
||||||
|
message.append(entry.getKey());
|
||||||
|
message.append(": ");
|
||||||
|
}
|
||||||
|
message.append(entry.getValue().stream().collect(Collectors.joining("; ")));
|
||||||
|
if (includeTemplateName) {
|
||||||
|
message.append("]");
|
||||||
|
}
|
||||||
|
return message;
|
||||||
|
})
|
||||||
|
.collect(Collectors.joining("; "));
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
static DeprecationIssue checkGeoShapeTemplates(final ClusterState clusterState) {
|
static DeprecationIssue checkGeoShapeTemplates(final ClusterState clusterState) {
|
||||||
String detailsForComponentTemplates =
|
Map<String, List<String>> componentTemplatesToMessagesMap =
|
||||||
getDetailsMessageForGeoShapeComponentTemplates(clusterState.getMetadata().componentTemplates());
|
getComponentTemplatesWithDeprecatedGeoShapeProperties(clusterState.getMetadata().componentTemplates());
|
||||||
String detailsForIndexTemplates = getDetailsMessageForGeoShapeIndexTemplates(clusterState.getMetadata().getTemplates());
|
Map<String, List<String>> indexTemplatesToMessagesMap =
|
||||||
boolean deprecationInComponentTemplates = Strings.isEmpty(detailsForComponentTemplates) == false;
|
getIndexTemplatesWithDeprecatedGeoShapeProperties(clusterState.getMetadata().getTemplates());
|
||||||
boolean deprecationInIndexTemplates = Strings.isEmpty(detailsForIndexTemplates) == false;
|
boolean deprecationInComponentTemplates = componentTemplatesToMessagesMap.isEmpty() == false;
|
||||||
|
boolean deprecationInIndexTemplates = indexTemplatesToMessagesMap.isEmpty() == false;
|
||||||
String url = "https://ela.st/es-deprecation-7-geo-shape-mappings";
|
String url = "https://ela.st/es-deprecation-7-geo-shape-mappings";
|
||||||
if (deprecationInComponentTemplates && deprecationInIndexTemplates) {
|
if (deprecationInComponentTemplates && deprecationInIndexTemplates) {
|
||||||
String message = "component templates and index templates contain deprecated geo_shape properties that must be removed";
|
String message = String.format(Locale.ROOT,"[%s] component template%s and [%s] index template%s use deprecated geo_shape " +
|
||||||
String details = detailsForComponentTemplates + "; " + detailsForIndexTemplates;
|
"properties",
|
||||||
|
componentTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
componentTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "",
|
||||||
|
indexTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
indexTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "");
|
||||||
|
String details = String.format(Locale.ROOT,
|
||||||
|
"Remove the following deprecated geo_shape properties from the mappings: %s; %s.",
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(componentTemplatesToMessagesMap, true),
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(indexTemplatesToMessagesMap, true));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false,
|
||||||
null);
|
null);
|
||||||
} if (deprecationInComponentTemplates == false && deprecationInIndexTemplates) {
|
} if (deprecationInComponentTemplates == false && deprecationInIndexTemplates) {
|
||||||
String message = "index templates contain deprecated geo_shape properties that must be removed";
|
String message = String.format(Locale.ROOT,"[%s] index template%s use%s deprecated geo_shape properties",
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsForIndexTemplates, false,
|
indexTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
indexTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "",
|
||||||
|
indexTemplatesToMessagesMap.keySet().size() > 1 ? "" : "s");
|
||||||
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url,
|
||||||
|
String.format(Locale.ROOT,"Remove the following deprecated geo_shape properties from the mappings: %s.",
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(indexTemplatesToMessagesMap, false)), false,
|
||||||
null);
|
null);
|
||||||
} else if (deprecationInIndexTemplates == false && deprecationInComponentTemplates) {
|
} else if (deprecationInIndexTemplates == false && deprecationInComponentTemplates) {
|
||||||
String message = "component templates contain deprecated geo_shape properties that must be removed";
|
String message = String.format(Locale.ROOT,"[%s] component template%s use%s deprecated geo_shape properties",
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsForComponentTemplates, false,
|
componentTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
componentTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "",
|
||||||
|
componentTemplatesToMessagesMap.keySet().size() > 1 ? "" : "s");
|
||||||
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url,
|
||||||
|
String.format(Locale.ROOT,"Remove the following deprecated geo_shape properties from the mappings: %s.",
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(componentTemplatesToMessagesMap, false)), false,
|
||||||
null);
|
null);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -304,8 +340,9 @@ public class ClusterDeprecationChecks {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private static String getDetailsMessageForSparseVectorComponentTemplates(Map<String, ComponentTemplate> componentTemplates) {
|
private static Map<String, List<String>> getComponentTemplatesWithDeprecatedSparseVectorProperties(
|
||||||
String detailsForComponentTemplates =
|
Map<String, ComponentTemplate> componentTemplates) {
|
||||||
|
Map<String, List<String>> detailsForComponentTemplates =
|
||||||
componentTemplates.entrySet().stream().map((templateCursor) -> {
|
componentTemplates.entrySet().stream().map((templateCursor) -> {
|
||||||
String templateName = templateCursor.getKey();
|
String templateName = templateCursor.getKey();
|
||||||
ComponentTemplate componentTemplate = templateCursor.getValue();
|
ComponentTemplate componentTemplate = templateCursor.getValue();
|
||||||
|
@ -318,26 +355,25 @@ public class ClusterDeprecationChecks {
|
||||||
IndexDeprecationChecks.findInPropertiesRecursively(SPARSE_VECTOR,
|
IndexDeprecationChecks.findInPropertiesRecursively(SPARSE_VECTOR,
|
||||||
mappingAsMap,
|
mappingAsMap,
|
||||||
ClusterDeprecationChecks::isSparseVector,
|
ClusterDeprecationChecks::isSparseVector,
|
||||||
ClusterDeprecationChecks::formatDeprecatedSparseVectorMessage);
|
ClusterDeprecationChecks::formatDeprecatedSparseVectorMessage, "[", "]");
|
||||||
if (messages.isEmpty() == false) {
|
if (messages.isEmpty() == false) {
|
||||||
String messageForMapping =
|
return Tuple.tuple(templateName, messages);
|
||||||
"mappings in component template [" + templateName + "] contains deprecated sparse_vector fields: " +
|
|
||||||
messages.stream().collect(Collectors.joining(", "));
|
|
||||||
return messageForMapping;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}).filter(messageForTemplate -> Strings.isEmpty(messageForTemplate) == false).collect(Collectors.joining("; "));
|
}).filter(templateToMessagesTuple -> templateToMessagesTuple != null && templateToMessagesTuple.v2().isEmpty() == false)
|
||||||
|
.collect(Collectors.toMap(Tuple<String, List<String>>::v1, Tuple<String, List<String>>::v2));
|
||||||
return detailsForComponentTemplates;
|
return detailsForComponentTemplates;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private static String getDetailsMessageForSparseVectorIndexTemplates(ImmutableOpenMap<String, IndexTemplateMetadata> indexTemplates) {
|
private static Map<String, List<String>> getIndexTemplatesWithDeprecatedSparseVectorProperties(
|
||||||
String detailsForIndexTemplates =
|
ImmutableOpenMap<String, IndexTemplateMetadata> indexTemplates) {
|
||||||
|
Map<String, List<String>> detailsForIndexTemplates =
|
||||||
StreamSupport.stream(indexTemplates.spliterator(), false).map((templateCursor) -> {
|
StreamSupport.stream(indexTemplates.spliterator(), false).map((templateCursor) -> {
|
||||||
String templateName = templateCursor.key;
|
String templateName = templateCursor.key;
|
||||||
IndexTemplateMetadata indexTemplateMetadata = templateCursor.value;
|
IndexTemplateMetadata indexTemplateMetadata = templateCursor.value;
|
||||||
String messageForTemplate =
|
List<String> messagesForTemplate =
|
||||||
StreamSupport.stream(indexTemplateMetadata.getMappings().spliterator(), false).map((mappingCursor) -> {
|
StreamSupport.stream(indexTemplateMetadata.getMappings().spliterator(), false).map((mappingCursor) -> {
|
||||||
CompressedXContent mapping = mappingCursor.value;
|
CompressedXContent mapping = mappingCursor.value;
|
||||||
Tuple<XContentType, Map<String, Object>> tuple = XContentHelper.convertToMap(mapping.uncompressed(), true,
|
Tuple<XContentType, Map<String, Object>> tuple = XContentHelper.convertToMap(mapping.uncompressed(), true,
|
||||||
|
@ -347,39 +383,54 @@ public class ClusterDeprecationChecks {
|
||||||
IndexDeprecationChecks.findInPropertiesRecursively(SPARSE_VECTOR,
|
IndexDeprecationChecks.findInPropertiesRecursively(SPARSE_VECTOR,
|
||||||
mappingAsMap,
|
mappingAsMap,
|
||||||
ClusterDeprecationChecks::isSparseVector,
|
ClusterDeprecationChecks::isSparseVector,
|
||||||
ClusterDeprecationChecks::formatDeprecatedSparseVectorMessage);
|
ClusterDeprecationChecks::formatDeprecatedSparseVectorMessage, "[", "]");
|
||||||
return messages;
|
return messages;
|
||||||
}).filter(messages -> messages.isEmpty() == false).map(messages -> {
|
}).filter(messages -> messages.isEmpty() == false).flatMap(x -> x.stream()).collect(Collectors.toList());
|
||||||
String messageForMapping =
|
return Tuple.tuple(templateName, messagesForTemplate);
|
||||||
"mappings in index template " + templateName + " contains deprecated sparse_vector fields: " +
|
}).filter(templateToMessagesTuple -> templateToMessagesTuple != null && templateToMessagesTuple.v2().isEmpty() == false)
|
||||||
messages.stream().collect(Collectors.joining(", "));
|
.collect(Collectors.toMap(Tuple<String, List<String>>::v1, Tuple<String, List<String>>::v2));
|
||||||
return messageForMapping;
|
|
||||||
}).collect(Collectors.joining("; "));
|
|
||||||
return messageForTemplate;
|
|
||||||
}).filter(messageForTemplate -> Strings.isEmpty(messageForTemplate) == false).collect(Collectors.joining("; "));
|
|
||||||
return detailsForIndexTemplates;
|
return detailsForIndexTemplates;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
static DeprecationIssue checkSparseVectorTemplates(final ClusterState clusterState) {
|
static DeprecationIssue checkSparseVectorTemplates(final ClusterState clusterState) {
|
||||||
String detailsForComponentTemplates =
|
Map<String, List<String>> componentTemplatesToMessagesMap =
|
||||||
getDetailsMessageForSparseVectorComponentTemplates(clusterState.getMetadata().componentTemplates());
|
getComponentTemplatesWithDeprecatedSparseVectorProperties(clusterState.getMetadata().componentTemplates());
|
||||||
String detailsForIndexTemplates = getDetailsMessageForSparseVectorIndexTemplates(clusterState.getMetadata().getTemplates());
|
Map<String, List<String>> indexTemplatesToMessagesMap =
|
||||||
boolean deprecationInComponentTemplates = Strings.isEmpty(detailsForComponentTemplates) == false;
|
getIndexTemplatesWithDeprecatedSparseVectorProperties(clusterState.getMetadata().getTemplates());
|
||||||
boolean deprecationInIndexTemplates = Strings.isEmpty(detailsForIndexTemplates) == false;
|
boolean deprecationInComponentTemplates = componentTemplatesToMessagesMap.isEmpty() == false;
|
||||||
|
boolean deprecationInIndexTemplates = indexTemplatesToMessagesMap.isEmpty() == false;
|
||||||
String url = "https://ela.st/es-deprecation-7-sparse-vector";
|
String url = "https://ela.st/es-deprecation-7-sparse-vector";
|
||||||
if (deprecationInComponentTemplates && deprecationInIndexTemplates) {
|
if (deprecationInComponentTemplates && deprecationInIndexTemplates) {
|
||||||
String message = "component templates and index templates contain deprecated sparse_vector fields that must be removed";
|
String message = String.format(Locale.ROOT,"[%s] component template%s and [%s] index template%s use deprecated sparse_vector " +
|
||||||
String details = detailsForComponentTemplates + "; " + detailsForIndexTemplates;
|
"properties",
|
||||||
|
componentTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
componentTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "",
|
||||||
|
indexTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
indexTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "");
|
||||||
|
String details = String.format(Locale.ROOT,
|
||||||
|
"Remove the following deprecated sparse_vector properties from the mappings: %s; %s.",
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(componentTemplatesToMessagesMap, true),
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(indexTemplatesToMessagesMap, true));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false,
|
||||||
null);
|
null);
|
||||||
} if (deprecationInComponentTemplates == false && deprecationInIndexTemplates) {
|
} if (deprecationInComponentTemplates == false && deprecationInIndexTemplates) {
|
||||||
String message = "index templates contain deprecated sparse_vector fields that must be removed";
|
String message = String.format(Locale.ROOT,"[%s] index template%s use%s deprecated sparse_vector properties",
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsForIndexTemplates, false,
|
indexTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
indexTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "",
|
||||||
|
indexTemplatesToMessagesMap.keySet().size() > 1 ? "" : "s");
|
||||||
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url,
|
||||||
|
String.format(Locale.ROOT,"Remove the following deprecated sparse_vector properties from the mappings: %s.",
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(indexTemplatesToMessagesMap, false)), false,
|
||||||
null);
|
null);
|
||||||
} else if (deprecationInIndexTemplates == false && deprecationInComponentTemplates) {
|
} else if (deprecationInIndexTemplates == false && deprecationInComponentTemplates) {
|
||||||
String message = "component templates contain deprecated sparse_vector fields that must be removed";
|
String message = String.format(Locale.ROOT,"[%s] component template%s use%s deprecated sparse_vector properties",
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsForComponentTemplates, false,
|
componentTemplatesToMessagesMap.keySet().stream().collect(Collectors.joining(",")),
|
||||||
|
componentTemplatesToMessagesMap.keySet().size() > 1 ? "s" : "",
|
||||||
|
componentTemplatesToMessagesMap.keySet().size() > 1 ? "" : "s");
|
||||||
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url,
|
||||||
|
String.format(Locale.ROOT,"Remove the following deprecated sparse_vector properties from the mappings: %s.",
|
||||||
|
getDetailsMessageForTemplatesWithDeprecations(componentTemplatesToMessagesMap, false)), false,
|
||||||
null);
|
null);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -400,11 +451,11 @@ public class ClusterDeprecationChecks {
|
||||||
if (policiesWithFreezeActions.isEmpty() == false) {
|
if (policiesWithFreezeActions.isEmpty() == false) {
|
||||||
String details = String.format(
|
String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"remove freeze action from the following ilm policies: [%s]",
|
"Remove the freeze action from ILM policies: [%s]",
|
||||||
policiesWithFreezeActions.stream().sorted().collect(Collectors.joining(","))
|
policiesWithFreezeActions.stream().sorted().collect(Collectors.joining(","))
|
||||||
);
|
);
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"some ilm policies contain a freeze action, which is deprecated and will be removed in a future release",
|
"ILM policies use the deprecated freeze action",
|
||||||
"https://ela.st/es-deprecation-7-frozen-indices",
|
"https://ela.st/es-deprecation-7-frozen-indices",
|
||||||
details,
|
details,
|
||||||
false,
|
false,
|
||||||
|
|
|
@ -48,6 +48,10 @@ import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocat
|
||||||
*/
|
*/
|
||||||
public class IndexDeprecationChecks {
|
public class IndexDeprecationChecks {
|
||||||
|
|
||||||
|
static final String JODA_TIME_DEPRECATION_DETAILS_SUFFIX = " See https://www.elastic.co/guide/en/elasticsearch/reference/master" +
|
||||||
|
"/migrate-to-java-time.html for details. Failure to update custom data formats to java.time could cause inconsistentencies in " +
|
||||||
|
"your data. Failure to properly convert x (week-year) to Y could result in data loss.";
|
||||||
|
|
||||||
private static void fieldLevelMappingIssue(IndexMetadata indexMetadata, BiConsumer<MappingMetadata, Map<String, Object>> checker) {
|
private static void fieldLevelMappingIssue(IndexMetadata indexMetadata, BiConsumer<MappingMetadata, Map<String, Object>> checker) {
|
||||||
for (MappingMetadata mappingMetadata : indexMetadata.getMappings().values()) {
|
for (MappingMetadata mappingMetadata : indexMetadata.getMappings().values()) {
|
||||||
Map<String, Object> sourceAsMap = mappingMetadata.sourceAsMap();
|
Map<String, Object> sourceAsMap = mappingMetadata.sourceAsMap();
|
||||||
|
@ -68,7 +72,8 @@ public class IndexDeprecationChecks {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
static List<String> findInPropertiesRecursively(String type, Map<String, Object> parentMap,
|
static List<String> findInPropertiesRecursively(String type, Map<String, Object> parentMap,
|
||||||
Function<Map<?,?>, Boolean> predicate,
|
Function<Map<?,?>, Boolean> predicate,
|
||||||
BiFunction<String, Map.Entry<?, ?>, String> fieldFormatter) {
|
BiFunction<String, Map.Entry<?, ?>, String> fieldFormatter,
|
||||||
|
String fieldBeginMarker, String fieldEndMarker) {
|
||||||
List<String> issues = new ArrayList<>();
|
List<String> issues = new ArrayList<>();
|
||||||
Map<?, ?> properties = (Map<?, ?>) parentMap.get("properties");
|
Map<?, ?> properties = (Map<?, ?>) parentMap.get("properties");
|
||||||
if (properties == null) {
|
if (properties == null) {
|
||||||
|
@ -77,7 +82,7 @@ public class IndexDeprecationChecks {
|
||||||
for (Map.Entry<?, ?> entry : properties.entrySet()) {
|
for (Map.Entry<?, ?> entry : properties.entrySet()) {
|
||||||
Map<String, Object> valueMap = (Map<String, Object>) entry.getValue();
|
Map<String, Object> valueMap = (Map<String, Object>) entry.getValue();
|
||||||
if (predicate.apply(valueMap)) {
|
if (predicate.apply(valueMap)) {
|
||||||
issues.add("[" + fieldFormatter.apply(type, entry) + "]");
|
issues.add(fieldBeginMarker + fieldFormatter.apply(type, entry) + fieldEndMarker);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<?, ?> values = (Map<?, ?>) valueMap.get("fields");
|
Map<?, ?> values = (Map<?, ?>) valueMap.get("fields");
|
||||||
|
@ -85,15 +90,17 @@ public class IndexDeprecationChecks {
|
||||||
for (Map.Entry<?, ?> multifieldEntry : values.entrySet()) {
|
for (Map.Entry<?, ?> multifieldEntry : values.entrySet()) {
|
||||||
Map<String, Object> multifieldValueMap = (Map<String, Object>) multifieldEntry.getValue();
|
Map<String, Object> multifieldValueMap = (Map<String, Object>) multifieldEntry.getValue();
|
||||||
if (predicate.apply(multifieldValueMap)) {
|
if (predicate.apply(multifieldValueMap)) {
|
||||||
issues.add("[" + fieldFormatter.apply(type, entry) + ", multifield: " + multifieldEntry.getKey() + "]");
|
issues.add(fieldBeginMarker + fieldFormatter.apply(type, entry) + ", multifield: " + multifieldEntry.getKey() +
|
||||||
|
fieldEndMarker);
|
||||||
}
|
}
|
||||||
if (multifieldValueMap.containsKey("properties")) {
|
if (multifieldValueMap.containsKey("properties")) {
|
||||||
issues.addAll(findInPropertiesRecursively(type, multifieldValueMap, predicate, fieldFormatter));
|
issues.addAll(findInPropertiesRecursively(type, multifieldValueMap, predicate, fieldFormatter, fieldBeginMarker,
|
||||||
|
fieldEndMarker));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (valueMap.containsKey("properties")) {
|
if (valueMap.containsKey("properties")) {
|
||||||
issues.addAll(findInPropertiesRecursively(type, valueMap, predicate, fieldFormatter));
|
issues.addAll(findInPropertiesRecursively(type, valueMap, predicate, fieldFormatter, fieldBeginMarker, fieldEndMarker));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,12 +109,13 @@ public class IndexDeprecationChecks {
|
||||||
|
|
||||||
private static String formatDateField(String type, Map.Entry<?, ?> entry) {
|
private static String formatDateField(String type, Map.Entry<?, ?> entry) {
|
||||||
Map<?,?> value = (Map<?, ?>) entry.getValue();
|
Map<?,?> value = (Map<?, ?>) entry.getValue();
|
||||||
return "type: " + type + ", field: " + entry.getKey() +", format: "+ value.get("format") +", suggestion: "
|
return String.format(Locale.ROOT, "Convert [%s] format %s to java.time.",
|
||||||
+ JodaDeprecationPatterns.formatSuggestion((String)value.get("format"));
|
entry.getKey(),
|
||||||
|
value.get("format"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String formatField(String type, Map.Entry<?, ?> entry) {
|
private static String formatField(String type, Map.Entry<?, ?> entry) {
|
||||||
return "type: " + type + ", field: " + entry.getKey();
|
return entry.getKey().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static DeprecationIssue oldIndicesCheck(IndexMetadata indexMetadata) {
|
static DeprecationIssue oldIndicesCheck(IndexMetadata indexMetadata) {
|
||||||
|
@ -116,7 +124,8 @@ public class IndexDeprecationChecks {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"Index created before 7.0",
|
"Index created before 7.0",
|
||||||
"https://ela.st/es-deprecation-7-reindex",
|
"https://ela.st/es-deprecation-7-reindex",
|
||||||
"This index was created using version: " + createdWith,
|
"This index was created with version " + createdWith + " and is not compatible with 8.0. Reindex or remove the index " +
|
||||||
|
"before upgrading.",
|
||||||
false, null);
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -137,10 +146,10 @@ public class IndexDeprecationChecks {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Number of fields exceeds automatic field expansion limit",
|
"Number of fields exceeds automatic field expansion limit",
|
||||||
"https://ela.st/es-deprecation-7-number-of-auto-expanded-fields",
|
"https://ela.st/es-deprecation-7-number-of-auto-expanded-fields",
|
||||||
"This index has [" + fieldCount.get() + "] fields, which exceeds the automatic field expansion limit of 1024 " +
|
"This index has " + fieldCount.get() + " fields, which exceeds the automatic field expansion limit (1024). Set " +
|
||||||
"and does not have [" + IndexSettings.DEFAULT_FIELD_SETTING.getKey() + "] set, which may cause queries which use " +
|
IndexSettings.DEFAULT_FIELD_SETTING.getKey() + " to prevent queries that support automatic field expansion from " +
|
||||||
"automatic field expansion, such as query_string, simple_query_string, and multi_match to fail if fields are not " +
|
"failing if no fields are specified. Otherwise, you must explicitly specify fields in all query_string, " +
|
||||||
"explicitly specified in the query.", false, null);
|
"simple_query_string, and multi_match queries.", false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -154,14 +163,14 @@ public class IndexDeprecationChecks {
|
||||||
fieldLevelMappingIssue(indexMetadata, ((mappingMetadata, sourceAsMap) -> fields.addAll(
|
fieldLevelMappingIssue(indexMetadata, ((mappingMetadata, sourceAsMap) -> fields.addAll(
|
||||||
findInPropertiesRecursively(mappingMetadata.type(), sourceAsMap,
|
findInPropertiesRecursively(mappingMetadata.type(), sourceAsMap,
|
||||||
IndexDeprecationChecks::isDateFieldWithDeprecatedPattern,
|
IndexDeprecationChecks::isDateFieldWithDeprecatedPattern,
|
||||||
IndexDeprecationChecks::formatDateField))));
|
IndexDeprecationChecks::formatDateField, "", ""))));
|
||||||
|
|
||||||
if (fields.size() > 0) {
|
if (fields.size() > 0) {
|
||||||
|
String detailsMessageBeginning = fields.stream().collect(Collectors.joining(" "));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Date field format uses patterns which has changed meaning in 7.0",
|
"Date fields use deprecated Joda time formats",
|
||||||
"https://ela.st/es-deprecation-7-java-time",
|
"https://ela.st/es-deprecation-7-java-time",
|
||||||
"This index has date fields with deprecated formats: " + fields + ". "
|
detailsMessageBeginning + JODA_TIME_DEPRECATION_DETAILS_SUFFIX, false, null);
|
||||||
+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -177,12 +186,14 @@ public class IndexDeprecationChecks {
|
||||||
List<String> issues = new ArrayList<>();
|
List<String> issues = new ArrayList<>();
|
||||||
fieldLevelMappingIssue(indexMetadata, ((mappingMetadata, sourceAsMap) -> issues.addAll(
|
fieldLevelMappingIssue(indexMetadata, ((mappingMetadata, sourceAsMap) -> issues.addAll(
|
||||||
findInPropertiesRecursively(mappingMetadata.type(), sourceAsMap,
|
findInPropertiesRecursively(mappingMetadata.type(), sourceAsMap,
|
||||||
IndexDeprecationChecks::containsChainedMultiFields, IndexDeprecationChecks::formatField))));
|
IndexDeprecationChecks::containsChainedMultiFields, IndexDeprecationChecks::formatField, "", ""))));
|
||||||
if (issues.size() > 0) {
|
if (issues.size() > 0) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Multi-fields within multi-fields",
|
"Defining multi-fields within multi-fields is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-chained-multi-fields",
|
"https://ela.st/es-deprecation-7-chained-multi-fields",
|
||||||
"The names of fields that contain chained multi-fields: " + issues, false, null);
|
String.format(Locale.ROOT, "Remove chained multi-fields from the \"%s\" mapping%s. Multi-fields within multi-fields " +
|
||||||
|
"are not supported in 8.0.", issues.stream().collect(Collectors.joining(",")), issues.size() > 1 ? "s" : ""),
|
||||||
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -207,9 +218,10 @@ public class IndexDeprecationChecks {
|
||||||
MappingMetadata mapping = indexMetadata.mapping();
|
MappingMetadata mapping = indexMetadata.mapping();
|
||||||
if ((mapping != null) && ClusterDeprecationChecks.mapContainsFieldNamesDisabled(mapping.getSourceAsMap())) {
|
if ((mapping != null) && ClusterDeprecationChecks.mapContainsFieldNamesDisabled(mapping.getSourceAsMap())) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Index mapping contains explicit `_field_names` enabling settings.",
|
"Disabling the \"_field_names\" field in the index mappings is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-field_names-settings",
|
"https://ela.st/es-deprecation-7-field_names-settings",
|
||||||
"The index mapping contains a deprecated `enabled` setting for `_field_names` that should be removed moving foward.",
|
"Remove the \"field_names\" mapping that configures the enabled setting. There's no longer a need to disable this " +
|
||||||
|
"field to reduce index overhead if you have a lot of fields.",
|
||||||
false, null);
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -268,10 +280,11 @@ public class IndexDeprecationChecks {
|
||||||
if (IndexSettings.INDEX_TRANSLOG_RETENTION_SIZE_SETTING.exists(indexMetadata.getSettings())
|
if (IndexSettings.INDEX_TRANSLOG_RETENTION_SIZE_SETTING.exists(indexMetadata.getSettings())
|
||||||
|| IndexSettings.INDEX_TRANSLOG_RETENTION_AGE_SETTING.exists(indexMetadata.getSettings())) {
|
|| IndexSettings.INDEX_TRANSLOG_RETENTION_AGE_SETTING.exists(indexMetadata.getSettings())) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"translog retention settings are ignored",
|
"Translog retention settings are deprecated",
|
||||||
"https://ela.st/es-deprecation-7-translog-settings",
|
"https://ela.st/es-deprecation-7-translog-settings",
|
||||||
"translog retention settings [index.translog.retention.size] and [index.translog.retention.age] are ignored " +
|
"Remove the translog retention settings: \"index.translog.retention.size\" and \"index.translog.retention.age\". The " +
|
||||||
"because translog is no longer used in peer recoveries with soft-deletes enabled (default in 7.0 or later)",
|
"translog has not been used in peer recoveries with soft-deletes enabled since 7.0 and these settings have no " +
|
||||||
|
"effect.",
|
||||||
false, null);
|
false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,9 +294,10 @@ public class IndexDeprecationChecks {
|
||||||
static DeprecationIssue checkIndexDataPath(IndexMetadata indexMetadata) {
|
static DeprecationIssue checkIndexDataPath(IndexMetadata indexMetadata) {
|
||||||
if (IndexMetadata.INDEX_DATA_PATH_SETTING.exists(indexMetadata.getSettings())) {
|
if (IndexMetadata.INDEX_DATA_PATH_SETTING.exists(indexMetadata.getSettings())) {
|
||||||
final String message = String.format(Locale.ROOT,
|
final String message = String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in a future version", IndexMetadata.INDEX_DATA_PATH_SETTING.getKey());
|
"Setting [index.data_path] is deprecated", IndexMetadata.INDEX_DATA_PATH_SETTING.getKey());
|
||||||
final String url = "https://ela.st/es-deprecation-7-shared-path-settings";
|
final String url = "https://ela.st/es-deprecation-7-shared-path-settings";
|
||||||
final String details = "Found index data path configured. Discontinue use of this setting.";
|
final String details = String.format(Locale.ROOT,
|
||||||
|
"Remove the [%s] setting. This setting has had no effect since 6.0.", IndexMetadata.INDEX_DATA_PATH_SETTING.getKey());
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -299,10 +313,11 @@ public class IndexDeprecationChecks {
|
||||||
private static DeprecationIssue slowLogSettingCheck(IndexMetadata indexMetadata, Setting<SlowLogLevel> setting) {
|
private static DeprecationIssue slowLogSettingCheck(IndexMetadata indexMetadata, Setting<SlowLogLevel> setting) {
|
||||||
if (setting.exists(indexMetadata.getSettings())) {
|
if (setting.exists(indexMetadata.getSettings())) {
|
||||||
final String message = String.format(Locale.ROOT,
|
final String message = String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in a future version", setting.getKey());
|
"Setting [%s] is deprecated", setting.getKey());
|
||||||
final String url = "https://ela.st/es-deprecation-7-slowlog-settings";
|
final String url = "https://ela.st/es-deprecation-7-slowlog-settings";
|
||||||
|
|
||||||
final String details = String.format(Locale.ROOT, "Found [%s] configured. Discontinue use of this setting. Use thresholds.",
|
final String details = String.format(Locale.ROOT, "Remove the [%s] setting. Use the [index.*.slowlog.threshold] settings to " +
|
||||||
|
"set the log levels.",
|
||||||
setting.getKey());
|
setting.getKey());
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
|
@ -313,11 +328,10 @@ public class IndexDeprecationChecks {
|
||||||
final String storeType = IndexModule.INDEX_STORE_TYPE_SETTING.get(indexMetadata.getSettings());
|
final String storeType = IndexModule.INDEX_STORE_TYPE_SETTING.get(indexMetadata.getSettings());
|
||||||
if (IndexModule.Type.SIMPLEFS.match(storeType)) {
|
if (IndexModule.Type.SIMPLEFS.match(storeType)) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"[simplefs] is deprecated and will be removed in future versions",
|
"Setting [index.store.type] to [simplefs] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-simplefs-store-type",
|
"https://ela.st/es-deprecation-7-simplefs-store-type",
|
||||||
"[simplefs] is deprecated and will be removed in 8.0. Use [niofs] or other file systems instead. " +
|
"Use [niofs] (the default) or one of the other FS types. This is an expert-only setting that might be removed in the " +
|
||||||
"Elasticsearch 7.15 or later uses [niofs] for the [simplefs] store type " +
|
"future.", false, null);
|
||||||
"as it offers superior or equivalent performance to [simplefs].", false, null);
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -325,12 +339,14 @@ public class IndexDeprecationChecks {
|
||||||
static DeprecationIssue checkRemovedSetting(final Settings settings,
|
static DeprecationIssue checkRemovedSetting(final Settings settings,
|
||||||
final Setting<?> removedSetting,
|
final Setting<?> removedSetting,
|
||||||
final String url,
|
final String url,
|
||||||
|
final String additionalDetail,
|
||||||
DeprecationIssue.Level deprecationLevel) {
|
DeprecationIssue.Level deprecationLevel) {
|
||||||
return checkRemovedSetting(
|
return checkRemovedSetting(
|
||||||
settings,
|
settings,
|
||||||
removedSetting,
|
removedSetting,
|
||||||
url,
|
url,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
|
additionalDetail,
|
||||||
deprecationLevel
|
deprecationLevel
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -339,6 +355,7 @@ public class IndexDeprecationChecks {
|
||||||
final Setting<?> removedSetting,
|
final Setting<?> removedSetting,
|
||||||
final String url,
|
final String url,
|
||||||
final String messagePattern,
|
final String messagePattern,
|
||||||
|
final String additionalDetail,
|
||||||
DeprecationIssue.Level deprecationLevel) {
|
DeprecationIssue.Level deprecationLevel) {
|
||||||
if (removedSetting.exists(settings) == false) {
|
if (removedSetting.exists(settings) == false) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -348,7 +365,7 @@ public class IndexDeprecationChecks {
|
||||||
final String message =
|
final String message =
|
||||||
String.format(Locale.ROOT, messagePattern, removedSettingKey);
|
String.format(Locale.ROOT, messagePattern, removedSettingKey);
|
||||||
final String details =
|
final String details =
|
||||||
String.format(Locale.ROOT, "the setting [%s] is currently set to [%s], remove this setting", removedSettingKey, value);
|
String.format(Locale.ROOT, "Remove the [%s] setting. %s", removedSettingKey, additionalDetail);
|
||||||
return new DeprecationIssue(deprecationLevel, message, url, details, false, null);
|
return new DeprecationIssue(deprecationLevel, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,6 +373,7 @@ public class IndexDeprecationChecks {
|
||||||
return checkRemovedSetting(indexMetadata.getSettings(),
|
return checkRemovedSetting(indexMetadata.getSettings(),
|
||||||
INDEX_ROUTING_REQUIRE_SETTING,
|
INDEX_ROUTING_REQUIRE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
|
"Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -364,6 +382,7 @@ public class IndexDeprecationChecks {
|
||||||
return checkRemovedSetting(indexMetadata.getSettings(),
|
return checkRemovedSetting(indexMetadata.getSettings(),
|
||||||
INDEX_ROUTING_INCLUDE_SETTING,
|
INDEX_ROUTING_INCLUDE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
|
"Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -372,6 +391,7 @@ public class IndexDeprecationChecks {
|
||||||
return checkRemovedSetting(indexMetadata.getSettings(),
|
return checkRemovedSetting(indexMetadata.getSettings(),
|
||||||
INDEX_ROUTING_EXCLUDE_SETTING,
|
INDEX_ROUTING_EXCLUDE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
|
"Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -381,7 +401,11 @@ public class IndexDeprecationChecks {
|
||||||
indexMetadata.getSettings(),
|
indexMetadata.getSettings(),
|
||||||
IndexSettings.MAX_ADJACENCY_MATRIX_FILTERS_SETTING,
|
IndexSettings.MAX_ADJACENCY_MATRIX_FILTERS_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-adjacency-matrix-filters-setting",
|
"https://ela.st/es-deprecation-7-adjacency-matrix-filters-setting",
|
||||||
"[%s] setting will be ignored in 8.0. Use [" + SearchModule.INDICES_MAX_CLAUSE_COUNT_SETTING.getKey() + "] instead.",
|
String.format(Locale.ROOT,"Setting [%s] is deprecated", IndexSettings.MAX_ADJACENCY_MATRIX_FILTERS_SETTING.getKey()),
|
||||||
|
String.format(Locale.ROOT, "Set [%s] to [%s]. [%s] will be ignored in 8.0.",
|
||||||
|
SearchModule.INDICES_MAX_CLAUSE_COUNT_SETTING.getKey(),
|
||||||
|
IndexSettings.MAX_ADJACENCY_MATRIX_FILTERS_SETTING.get(indexMetadata.getSettings()),
|
||||||
|
IndexSettings.MAX_ADJACENCY_MATRIX_FILTERS_SETTING.getKey()),
|
||||||
DeprecationIssue.Level.WARNING
|
DeprecationIssue.Level.WARNING
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -410,12 +434,12 @@ public class IndexDeprecationChecks {
|
||||||
Map<String, Object> sourceAsMap = indexMetadata.mapping().getSourceAsMap();
|
Map<String, Object> sourceAsMap = indexMetadata.mapping().getSourceAsMap();
|
||||||
List<String> messages = findInPropertiesRecursively(GeoShapeFieldMapper.CONTENT_TYPE, sourceAsMap,
|
List<String> messages = findInPropertiesRecursively(GeoShapeFieldMapper.CONTENT_TYPE, sourceAsMap,
|
||||||
IndexDeprecationChecks::isGeoShapeFieldWithDeprecatedParam,
|
IndexDeprecationChecks::isGeoShapeFieldWithDeprecatedParam,
|
||||||
IndexDeprecationChecks::formatDeprecatedGeoShapeParamMessage);
|
IndexDeprecationChecks::formatDeprecatedGeoShapeParamMessage, "[", "]");
|
||||||
if (messages.isEmpty()) {
|
if (messages.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
String message = String.format(Locale.ROOT,"mappings for index %s contains deprecated geo_shape properties that must be " +
|
String message = String.format(Locale.ROOT,"[%s] index uses deprecated geo_shape properties",
|
||||||
"removed", indexMetadata.getIndex().getName());
|
indexMetadata.getIndex().getName());
|
||||||
String details = String.format(Locale.ROOT,
|
String details = String.format(Locale.ROOT,
|
||||||
"The following geo_shape parameters must be removed from %s: [%s]", indexMetadata.getIndex().getName(),
|
"The following geo_shape parameters must be removed from %s: [%s]", indexMetadata.getIndex().getName(),
|
||||||
messages.stream().collect(Collectors.joining("; ")));
|
messages.stream().collect(Collectors.joining("; ")));
|
||||||
|
|
|
@ -57,10 +57,8 @@ public class MlDeprecationChecker implements DeprecationChecker {
|
||||||
if (modelSnapshot.getMinVersion().before(Version.V_7_0_0)) {
|
if (modelSnapshot.getMinVersion().before(Version.V_7_0_0)) {
|
||||||
StringBuilder details = new StringBuilder(String.format(
|
StringBuilder details = new StringBuilder(String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"model snapshot [%s] for job [%s] supports minimum version [%s] and needs to be at least [%s].",
|
"Delete model snapshot [%s] or update it to %s or greater.",
|
||||||
modelSnapshot.getSnapshotId(),
|
modelSnapshot.getSnapshotId(),
|
||||||
modelSnapshot.getJobId(),
|
|
||||||
modelSnapshot.getMinVersion(),
|
|
||||||
Version.V_7_0_0));
|
Version.V_7_0_0));
|
||||||
if (modelSnapshot.getLatestRecordTimeStamp() != null) {
|
if (modelSnapshot.getLatestRecordTimeStamp() != null) {
|
||||||
details.append(String.format(
|
details.append(String.format(
|
||||||
|
@ -72,9 +70,10 @@ public class MlDeprecationChecker implements DeprecationChecker {
|
||||||
return Optional.of(new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return Optional.of(new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"model snapshot [%s] for job [%s] needs to be deleted or upgraded",
|
"Snapshot [%s] for job [%s] has an obsolete minimum version [%s]",
|
||||||
modelSnapshot.getSnapshotId(),
|
modelSnapshot.getSnapshotId(),
|
||||||
modelSnapshot.getJobId()
|
modelSnapshot.getJobId(),
|
||||||
|
modelSnapshot.getMinVersion()
|
||||||
),
|
),
|
||||||
"https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-upgrade-job-model-snapshot.html",
|
"https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-upgrade-job-model-snapshot.html",
|
||||||
details.toString(),
|
details.toString(),
|
||||||
|
|
|
@ -7,12 +7,10 @@
|
||||||
|
|
||||||
package org.elasticsearch.xpack.deprecation;
|
package org.elasticsearch.xpack.deprecation;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
|
||||||
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
|
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
|
||||||
import org.elasticsearch.bootstrap.BootstrapSettings;
|
import org.elasticsearch.bootstrap.BootstrapSettings;
|
||||||
import org.elasticsearch.cluster.ClusterState;
|
import org.elasticsearch.cluster.ClusterState;
|
||||||
import org.elasticsearch.cluster.coordination.JoinHelper;
|
import org.elasticsearch.cluster.coordination.JoinHelper;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
||||||
import org.elasticsearch.cluster.routing.allocation.DataTier;
|
import org.elasticsearch.cluster.routing.allocation.DataTier;
|
||||||
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
|
import org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings;
|
||||||
|
@ -29,7 +27,6 @@ import org.elasticsearch.common.util.set.Sets;
|
||||||
import org.elasticsearch.core.TimeValue;
|
import org.elasticsearch.core.TimeValue;
|
||||||
import org.elasticsearch.env.Environment;
|
import org.elasticsearch.env.Environment;
|
||||||
import org.elasticsearch.env.NodeEnvironment;
|
import org.elasticsearch.env.NodeEnvironment;
|
||||||
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
|
|
||||||
import org.elasticsearch.gateway.GatewayService;
|
import org.elasticsearch.gateway.GatewayService;
|
||||||
import org.elasticsearch.jdk.JavaVersion;
|
import org.elasticsearch.jdk.JavaVersion;
|
||||||
import org.elasticsearch.license.License;
|
import org.elasticsearch.license.License;
|
||||||
|
@ -42,6 +39,7 @@ import org.elasticsearch.transport.RemoteClusterService;
|
||||||
import org.elasticsearch.transport.SniffConnectionStrategy;
|
import org.elasticsearch.transport.SniffConnectionStrategy;
|
||||||
import org.elasticsearch.transport.TransportService;
|
import org.elasticsearch.transport.TransportService;
|
||||||
import org.elasticsearch.xpack.core.XPackSettings;
|
import org.elasticsearch.xpack.core.XPackSettings;
|
||||||
|
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
|
||||||
import org.elasticsearch.xpack.core.security.SecurityField;
|
import org.elasticsearch.xpack.core.security.SecurityField;
|
||||||
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
|
import org.elasticsearch.xpack.core.security.authc.RealmConfig;
|
||||||
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
|
import org.elasticsearch.xpack.core.security.authc.RealmSettings;
|
||||||
|
@ -71,6 +69,8 @@ import static org.elasticsearch.xpack.core.security.authc.saml.SamlRealmSettings
|
||||||
|
|
||||||
class NodeDeprecationChecks {
|
class NodeDeprecationChecks {
|
||||||
|
|
||||||
|
static final String JAVA_DEPRECATION_MESSAGE = "Java 11 is required in 8.0";
|
||||||
|
|
||||||
static DeprecationIssue checkPidfile(final Settings settings, final PluginsAndModules pluginsAndModules,
|
static DeprecationIssue checkPidfile(final Settings settings, final PluginsAndModules pluginsAndModules,
|
||||||
final ClusterState clusterState, final XPackLicenseState licenseState) {
|
final ClusterState clusterState, final XPackLicenseState licenseState) {
|
||||||
return checkDeprecatedSetting(
|
return checkDeprecatedSetting(
|
||||||
|
@ -106,11 +106,11 @@ class NodeDeprecationChecks {
|
||||||
|
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"Found realms without order config: [%s]. In next major release, node will fail to start with missing realm order.",
|
"Specify the realm order for all realms [%s]. If no realm order is specified, the node will fail to start in 8.0. ",
|
||||||
String.join("; ", orderNotConfiguredRealms));
|
String.join("; ", orderNotConfiguredRealms));
|
||||||
return new DeprecationIssue(
|
return new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"Realm order will be required in next major release.",
|
"Realm order is required",
|
||||||
"https://ela.st/es-deprecation-7-realm-orders-required",
|
"https://ela.st/es-deprecation-7-realm-orders-required",
|
||||||
details,
|
details,
|
||||||
false,
|
false,
|
||||||
|
@ -140,13 +140,13 @@ class NodeDeprecationChecks {
|
||||||
|
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"Found multiple realms configured with the same order: [%s]. " +
|
"The same order is configured for multiple realms: [%s]]. Configure a unique order for each realm. If duplicate realm orders " +
|
||||||
"In next major release, node will fail to start with duplicated realm order.",
|
"exist, the node will fail to start in 8.0. ",
|
||||||
String.join("; ", duplicateOrders));
|
String.join("; ", duplicateOrders));
|
||||||
|
|
||||||
return new DeprecationIssue(
|
return new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"Realm orders must be unique in next major release.",
|
"Realm orders must be unique",
|
||||||
"https://ela.st/es-deprecation-7-realm-orders-unique",
|
"https://ela.st/es-deprecation-7-realm-orders-unique",
|
||||||
details,
|
details,
|
||||||
false, null
|
false, null
|
||||||
|
@ -160,15 +160,12 @@ class NodeDeprecationChecks {
|
||||||
if ( XPackSettings.SECURITY_ENABLED.exists(settings) == false
|
if ( XPackSettings.SECURITY_ENABLED.exists(settings) == false
|
||||||
&& (licenseState.getOperationMode().equals(License.OperationMode.BASIC)
|
&& (licenseState.getOperationMode().equals(License.OperationMode.BASIC)
|
||||||
|| licenseState.getOperationMode().equals(License.OperationMode.TRIAL))) {
|
|| licenseState.getOperationMode().equals(License.OperationMode.TRIAL))) {
|
||||||
String details = "The default behavior of disabling security on " + licenseState.getOperationMode().description()
|
String details = "Security will no longer be disabled by default for Trial licenses in 8.0. The [xpack.security.enabled] " +
|
||||||
+ " licenses is deprecated. In a later version of Elasticsearch, the value of [xpack.security.enabled] will "
|
"setting will always default to \"true\". See https://ela.st/es-deprecation-7-security-minimal-setup to secure your cluster" +
|
||||||
+ "default to \"true\" , regardless of the license level. "
|
". To explicitly disable security, set [xpack.security.enabled] to \"false\" (not recommended).";
|
||||||
+ "See https://www.elastic.co/guide/en/elasticsearch/reference/" + Version.CURRENT.major + "."
|
|
||||||
+ Version.CURRENT.minor + "/security-minimal-setup.html to enable security, or explicitly disable security by "
|
|
||||||
+ "setting [xpack.security.enabled] to \"false\" in elasticsearch.yml";
|
|
||||||
return new DeprecationIssue(
|
return new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"Security is enabled by default for all licenses in the next major version.",
|
"Security is enabled by default for all licenses",
|
||||||
"https://ela.st/es-deprecation-7-implicitly-disabled-security",
|
"https://ela.st/es-deprecation-7-implicitly-disabled-security",
|
||||||
details,
|
details,
|
||||||
false, null);
|
false, null);
|
||||||
|
@ -247,16 +244,14 @@ class NodeDeprecationChecks {
|
||||||
} else {
|
} else {
|
||||||
return new DeprecationIssue(
|
return new DeprecationIssue(
|
||||||
DeprecationIssue.Level.WARNING,
|
DeprecationIssue.Level.WARNING,
|
||||||
"Realm names cannot start with [" + RESERVED_REALM_NAME_PREFIX + "] in a future major release.",
|
"Prefixing realm names with an underscore (_) is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-realm-names",
|
"https://ela.st/es-deprecation-7-realm-names",
|
||||||
String.format(Locale.ROOT, "Found realm " + (reservedPrefixedRealmIdentifiers.size() == 1 ? "name" : "names")
|
String.format(Locale.ROOT, "Rename the following realm%s in the realm chain: %s.",
|
||||||
+ " with reserved prefix [%s]: [%s]. "
|
reservedPrefixedRealmIdentifiers.size() > 1 ? "s" : "",
|
||||||
+ "In a future major release, node will fail to start if any realm names start with reserved prefix.",
|
|
||||||
RESERVED_REALM_NAME_PREFIX,
|
|
||||||
reservedPrefixedRealmIdentifiers.stream()
|
reservedPrefixedRealmIdentifiers.stream()
|
||||||
.map(rid -> RealmSettings.PREFIX + rid.getType() + "." + rid.getName())
|
.map(rid -> RealmSettings.PREFIX + rid.getType() + "." + rid.getName())
|
||||||
.sorted()
|
.sorted()
|
||||||
.collect(Collectors.joining("; "))),
|
.collect(Collectors.joining(", "))),
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -278,7 +273,8 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(
|
return checkRemovedSetting(
|
||||||
settings,
|
settings,
|
||||||
setting.get(),
|
setting.get(),
|
||||||
"https://ela.st/es-deprecation-7-thread-pool-listener-settings");
|
"https://ela.st/es-deprecation-7-thread-pool-listener-settings",
|
||||||
|
"The listener pool is no longer used in 8.0.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DeprecationIssue checkClusterRemoteConnectSetting(final Settings settings, final PluginsAndModules pluginsAndModules,
|
public static DeprecationIssue checkClusterRemoteConnectSetting(final Settings settings, final PluginsAndModules pluginsAndModules,
|
||||||
|
@ -301,7 +297,8 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(
|
return checkRemovedSetting(
|
||||||
settings,
|
settings,
|
||||||
Node.NODE_LOCAL_STORAGE_SETTING,
|
Node.NODE_LOCAL_STORAGE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-node-local-storage-setting"
|
"https://ela.st/es-deprecation-7-node-local-storage-setting",
|
||||||
|
"All nodes require local storage in 8.0 and cannot share data paths."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +306,8 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(
|
return checkRemovedSetting(
|
||||||
settings,
|
settings,
|
||||||
setting,
|
setting,
|
||||||
"https://ela.st/es-deprecation-7-xpack-basic-feature-settings"
|
"https://ela.st/es-deprecation-7-xpack-basic-feature-settings",
|
||||||
|
"Basic features are always enabled in 8.0."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,20 +316,30 @@ class NodeDeprecationChecks {
|
||||||
final Settings settings,
|
final Settings settings,
|
||||||
final PluginsAndModules pluginsAndModules
|
final PluginsAndModules pluginsAndModules
|
||||||
) {
|
) {
|
||||||
|
assert legacyRoleSetting.isDeprecated() : legacyRoleSetting;
|
||||||
return checkDeprecatedSetting(
|
if (legacyRoleSetting.exists(settings) == false) {
|
||||||
settings,
|
return null;
|
||||||
pluginsAndModules,
|
}
|
||||||
legacyRoleSetting,
|
String legacyRoleSettingKey = legacyRoleSetting.getKey();
|
||||||
NodeRoleSettings.NODE_ROLES_SETTING,
|
String role;
|
||||||
(v, s) -> {
|
if (legacyRoleSettingKey.isEmpty() == false && legacyRoleSettingKey.contains(".")
|
||||||
return DiscoveryNode.getRolesFromSettings(s)
|
&& legacyRoleSettingKey.indexOf(".") <= legacyRoleSettingKey.length() + 2) {
|
||||||
.stream()
|
role = legacyRoleSettingKey.substring(legacyRoleSettingKey.indexOf(".") + 1);
|
||||||
.map(DiscoveryNodeRole::roleName)
|
} else {
|
||||||
.collect(Collectors.joining(","));
|
role = "unknown"; //Should never get here, but putting these checks to avoid crashing the API just in case
|
||||||
},
|
}
|
||||||
"https://ela.st/es-deprecation-7-node-roles"
|
final String message = String.format(
|
||||||
);
|
Locale.ROOT,
|
||||||
|
"Setting [%s] is deprecated",
|
||||||
|
legacyRoleSettingKey);
|
||||||
|
final String details = String.format(
|
||||||
|
Locale.ROOT,
|
||||||
|
"Remove the [%s] setting. Set [%s] and include the [%s] role.",
|
||||||
|
legacyRoleSettingKey,
|
||||||
|
NodeRoleSettings.NODE_ROLES_SETTING.getKey(),
|
||||||
|
role);
|
||||||
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message,
|
||||||
|
"https://ela.st/es-deprecation-7-node-roles", details, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DeprecationIssue checkBootstrapSystemCallFilterSetting(final Settings settings, final PluginsAndModules pluginsAndModules,
|
static DeprecationIssue checkBootstrapSystemCallFilterSetting(final Settings settings, final PluginsAndModules pluginsAndModules,
|
||||||
|
@ -339,7 +347,8 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(
|
return checkRemovedSetting(
|
||||||
settings,
|
settings,
|
||||||
BootstrapSettings.SYSTEM_CALL_FILTER_SETTING,
|
BootstrapSettings.SYSTEM_CALL_FILTER_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-system-call-filter-setting"
|
"https://ela.st/es-deprecation-7-system-call-filter-setting",
|
||||||
|
"System call filters are always required in 8.0."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,14 +379,12 @@ class NodeDeprecationChecks {
|
||||||
final String value = deprecatedSetting.get(settings).toString();
|
final String value = deprecatedSetting.get(settings).toString();
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"setting [%s] is deprecated in favor of setting [%s]",
|
"Setting [%s] is deprecated",
|
||||||
deprecatedSettingKey,
|
deprecatedSettingKey);
|
||||||
replacementSettingKey);
|
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], instead set [%s] to [%s]",
|
"Remove the [%s] setting and set [%s] to [%s].",
|
||||||
deprecatedSettingKey,
|
deprecatedSettingKey,
|
||||||
value,
|
|
||||||
replacementSettingKey,
|
replacementSettingKey,
|
||||||
replacementValue.apply(value, settings));
|
replacementValue.apply(value, settings));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
||||||
|
@ -412,20 +419,24 @@ class NodeDeprecationChecks {
|
||||||
final String value = deprecatedSetting.get(settings).toString();
|
final String value = deprecatedSetting.get(settings).toString();
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"setting [%s] is deprecated in favor of grouped setting [%s]",
|
"Setting [%s] is deprecated",
|
||||||
deprecatedSettingKey,
|
deprecatedSettingKey,
|
||||||
replacementSettingKey);
|
replacementSettingKey);
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], instead set [%s] to [%s] where * is %s",
|
"Remove the [%s] setting. Set [%s] to [%s], where * is %s",
|
||||||
deprecatedSettingKey,
|
deprecatedSettingKey,
|
||||||
value,
|
|
||||||
replacementSettingKey,
|
replacementSettingKey,
|
||||||
replacementValue.apply(value, settings),
|
replacementValue.apply(value, settings),
|
||||||
star);
|
star);
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static DeprecationIssue checkRemovedSetting(final Settings settings, final Setting<?> removedSetting, final String url,
|
||||||
|
String additionalDetailMessage) {
|
||||||
|
return checkRemovedSetting(settings, removedSetting, url, additionalDetailMessage, DeprecationIssue.Level.CRITICAL);
|
||||||
|
}
|
||||||
|
|
||||||
static DeprecationIssue checkDeprecatedSetting(final Settings settings, final Setting<?> deprecatedSetting, final String url,
|
static DeprecationIssue checkDeprecatedSetting(final Settings settings, final Setting<?> deprecatedSetting, final String url,
|
||||||
final String whenRemoved) {
|
final String whenRemoved) {
|
||||||
if (deprecatedSetting.exists(settings) == false) {
|
if (deprecatedSetting.exists(settings) == false) {
|
||||||
|
@ -440,13 +451,10 @@ class NodeDeprecationChecks {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
static DeprecationIssue checkRemovedSetting(final Settings settings, final Setting<?> removedSetting, final String url) {
|
|
||||||
return checkRemovedSetting(settings, removedSetting, url, DeprecationIssue.Level.CRITICAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static DeprecationIssue checkRemovedSetting(final Settings settings,
|
static DeprecationIssue checkRemovedSetting(final Settings settings,
|
||||||
final Setting<?> removedSetting,
|
final Setting<?> removedSetting,
|
||||||
final String url,
|
final String url,
|
||||||
|
String additionalDetailMessage,
|
||||||
DeprecationIssue.Level deprecationLevel) {
|
DeprecationIssue.Level deprecationLevel) {
|
||||||
if (removedSetting.exists(settings) == false) {
|
if (removedSetting.exists(settings) == false) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -460,9 +468,9 @@ class NodeDeprecationChecks {
|
||||||
value = removedSettingValue.toString();
|
value = removedSettingValue.toString();
|
||||||
}
|
}
|
||||||
final String message =
|
final String message =
|
||||||
String.format(Locale.ROOT, "setting [%s] is deprecated and will be removed in the next major version", removedSettingKey);
|
String.format(Locale.ROOT, "Setting [%s] is deprecated", removedSettingKey);
|
||||||
final String details =
|
final String details =
|
||||||
String.format(Locale.ROOT, "the setting [%s] is currently set to [%s], remove this setting", removedSettingKey, value);
|
String.format(Locale.ROOT, "Remove the [%s] setting. %s", removedSettingKey, additionalDetailMessage);
|
||||||
return new DeprecationIssue(deprecationLevel, message, url, details, false, null);
|
return new DeprecationIssue(deprecationLevel, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,11 +480,11 @@ class NodeDeprecationChecks {
|
||||||
|
|
||||||
if (javaVersion.compareTo(JavaVersion.parse("11")) < 0) {
|
if (javaVersion.compareTo(JavaVersion.parse("11")) < 0) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"Java 11 is required",
|
JAVA_DEPRECATION_MESSAGE,
|
||||||
"https://ela.st/es-deprecation-7-java-version",
|
"https://ela.st/es-deprecation-7-java-version",
|
||||||
"Java 11 will be required for future versions of Elasticsearch, this node is running version ["
|
"This node is running Java version [" + javaVersion.toString() + "]. Consider switching to a distribution of " +
|
||||||
+ javaVersion.toString() + "]. Consider switching to a distribution of Elasticsearch with a bundled JDK. "
|
"Elasticsearch with a bundled JDK or upgrade. If you are already using a distribution with a bundled JDK, ensure the " +
|
||||||
+ "If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.",
|
"JAVA_HOME environment variable is not set.",
|
||||||
false, null);
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -499,9 +507,11 @@ class NodeDeprecationChecks {
|
||||||
final XPackLicenseState licenseState) {
|
final XPackLicenseState licenseState) {
|
||||||
if (Environment.dataPathUsesList(nodeSettings)) {
|
if (Environment.dataPathUsesList(nodeSettings)) {
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"[path.data] in a list is deprecated, use a string value",
|
"Multiple data paths are not supported",
|
||||||
"https://ela.st/es-deprecation-7-multiple-paths",
|
"https://ela.st/es-deprecation-7-multiple-paths",
|
||||||
"Configuring [path.data] with a list is deprecated. Instead specify as a string value.", false, null);
|
"The [path.data] setting contains a list of paths. Specify a single path as a string. Use RAID or other system level " +
|
||||||
|
"features to utilize multiple disks. If multiple data paths are configured, the node will fail to start in 8.0. ",
|
||||||
|
false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -510,9 +520,10 @@ class NodeDeprecationChecks {
|
||||||
final ClusterState clusterState, final XPackLicenseState licenseState) {
|
final ClusterState clusterState, final XPackLicenseState licenseState) {
|
||||||
if (Environment.PATH_SHARED_DATA_SETTING.exists(settings)) {
|
if (Environment.PATH_SHARED_DATA_SETTING.exists(settings)) {
|
||||||
final String message = String.format(Locale.ROOT,
|
final String message = String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in a future version", Environment.PATH_SHARED_DATA_SETTING.getKey());
|
"Setting [%s] is deprecated", Environment.PATH_SHARED_DATA_SETTING.getKey());
|
||||||
final String url = "https://ela.st/es-deprecation-7-shared-path-settings";
|
final String url = "https://ela.st/es-deprecation-7-shared-path-settings";
|
||||||
final String details = "Found shared data path configured. Discontinue use of this setting.";
|
final String details = String.format(Locale.ROOT,
|
||||||
|
"Remove the [%s] setting. This setting has had no effect since 6.0.", Environment.PATH_SHARED_DATA_SETTING.getKey());
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -524,10 +535,10 @@ class NodeDeprecationChecks {
|
||||||
&& DiskThresholdDecider.ENABLE_FOR_SINGLE_DATA_NODE.exists(settings)) {
|
&& DiskThresholdDecider.ENABLE_FOR_SINGLE_DATA_NODE.exists(settings)) {
|
||||||
String key = DiskThresholdDecider.ENABLE_FOR_SINGLE_DATA_NODE.getKey();
|
String key = DiskThresholdDecider.ENABLE_FOR_SINGLE_DATA_NODE.getKey();
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT, "setting [%s=false] is deprecated and will not be available in a future version", key),
|
String.format(Locale.ROOT, "Setting [%s=false] is deprecated", key),
|
||||||
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting",
|
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting",
|
||||||
String.format(Locale.ROOT, "found [%s] configured to false. Discontinue use of this setting or set it to true.", key),
|
String.format(Locale.ROOT, "Remove the [%s] setting. Disk watermarks are always enabled for single node clusters in 8.0.",
|
||||||
false, null
|
key),false, null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,13 +547,12 @@ class NodeDeprecationChecks {
|
||||||
String key = DiskThresholdDecider.ENABLE_FOR_SINGLE_DATA_NODE.getKey();
|
String key = DiskThresholdDecider.ENABLE_FOR_SINGLE_DATA_NODE.getKey();
|
||||||
String disableDiskDecider = DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey();
|
String disableDiskDecider = DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey();
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
String.format(Locale.ROOT, "the default value [false] of setting [%s] is deprecated and will be changed to true" +
|
String.format(Locale.ROOT, "Disabling disk watermarks for single node clusters is deprecated and no longer the default",
|
||||||
" in a future version. This cluster has only one data node and behavior will therefore change when upgrading", key),
|
key),
|
||||||
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting",
|
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting",
|
||||||
String.format(Locale.ROOT, "found [%s] defaulting to false on a single data node cluster." +
|
String.format(Locale.ROOT, "Disk watermarks are always enabled in 8.0, which will affect the behavior of this single node" +
|
||||||
" Set it to true to avoid this warning." +
|
" cluster when you upgrade. You can set \"%s\" to false to disable" +
|
||||||
" Consider using [%s] to disable disk based allocation", key,
|
" disk based allocation.", disableDiskDecider),
|
||||||
disableDiskDecider),
|
|
||||||
false,
|
false,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
@ -558,7 +568,7 @@ class NodeDeprecationChecks {
|
||||||
ClusterState cs,
|
ClusterState cs,
|
||||||
XPackLicenseState licenseState
|
XPackLicenseState licenseState
|
||||||
) {
|
) {
|
||||||
// Mimic the HttpExporter#AUTH_PASSWORD_SETTING setting here to avoid a depedency on monitoring module:
|
// Mimic the HttpExporter#AUTH_PASSWORD_SETTING setting here to avoid a dependency on monitoring module:
|
||||||
// (just having the setting prefix and suffic here is sufficient to check on whether this setting is used)
|
// (just having the setting prefix and suffic here is sufficient to check on whether this setting is used)
|
||||||
final Setting.AffixSetting<String> AUTH_PASSWORD_SETTING =
|
final Setting.AffixSetting<String> AUTH_PASSWORD_SETTING =
|
||||||
Setting.affixKeySetting("xpack.monitoring.exporters.","auth.password", s -> Setting.simpleString(s));
|
Setting.affixKeySetting("xpack.monitoring.exporters.","auth.password", s -> Setting.simpleString(s));
|
||||||
|
@ -572,12 +582,13 @@ class NodeDeprecationChecks {
|
||||||
final String passwordSettings = passwords.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
final String passwordSettings = passwords.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"non-secure passwords for monitoring exporters [%s] are deprecated and will be removed in the next major version",
|
"Monitoring exporters must use secure passwords",
|
||||||
passwordSettings
|
passwordSettings
|
||||||
);
|
);
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"replace the non-secure monitoring exporter password setting(s) [%s] with their secure 'auth.secure_password' replacement",
|
"Remove the non-secure monitoring exporter password settings: [%s]. Configure secure passwords with " +
|
||||||
|
"[xpack.monitoring.exporters.*.auth.secure_password].",
|
||||||
passwordSettings
|
passwordSettings
|
||||||
);
|
);
|
||||||
final String url = "https://ela.st/es-deprecation-7-monitoring-exporter-passwords";
|
final String url = "https://ela.st/es-deprecation-7-monitoring-exporter-passwords";
|
||||||
|
@ -591,6 +602,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
JoinHelper.JOIN_TIMEOUT_SETTING,
|
JoinHelper.JOIN_TIMEOUT_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-cluster-join-timeout-setting",
|
"https://ela.st/es-deprecation-7-cluster-join-timeout-setting",
|
||||||
|
"Cluster join attempts never time out in 8.0.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -624,14 +636,10 @@ class NodeDeprecationChecks {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final String remoteClusterSeedSettings = remoteClusterSettings.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
final String remoteClusterSeedSettings = remoteClusterSettings.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
||||||
final String message = String.format(
|
final String message = "Remotes for cross cluster search must be configured with cluster remote settings";
|
||||||
Locale.ROOT,
|
|
||||||
"search.remote settings [%s] are deprecated and will be removed in the next major version",
|
|
||||||
remoteClusterSeedSettings
|
|
||||||
);
|
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"replace search.remote settings [%s] with their secure 'cluster.remote' replacements",
|
"Replace the search.remote settings [%s] with their secure [cluster.remote] equivalents",
|
||||||
remoteClusterSeedSettings
|
remoteClusterSeedSettings
|
||||||
);
|
);
|
||||||
final String url = "https://ela.st/es-deprecation-7-search-remote-settings";
|
final String url = "https://ela.st/es-deprecation-7-search-remote-settings";
|
||||||
|
@ -645,6 +653,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING,
|
CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
||||||
|
"Relocating shards are always taken into account in 8.0.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -669,10 +678,10 @@ class NodeDeprecationChecks {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String url = "https://ela.st/es-deprecation-7-fractional-byte-settings";
|
String url = "https://ela.st/es-deprecation-7-fractional-byte-settings";
|
||||||
String message = "support for fractional byte size values is deprecated and will be removed in a future release";
|
String message = "Configuring fractional byte sizes is deprecated";
|
||||||
String details = "change the following settings to non-fractional values: [" +
|
String details = String.format(Locale.ROOT, "Set the following to whole numbers: [%s].",
|
||||||
fractionalByteSettings.entrySet().stream().map(fractionalByteSetting -> fractionalByteSetting.getKey() + "->" +
|
fractionalByteSettings.entrySet().stream().map(fractionalByteSetting -> fractionalByteSetting.getKey())
|
||||||
fractionalByteSetting.getValue()).collect(Collectors.joining(", ")) + "]";
|
.collect(Collectors.joining(", ")));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,11 +696,11 @@ class NodeDeprecationChecks {
|
||||||
if (cacheSize.getBytes() > 0) {
|
if (cacheSize.getBytes() > 0) {
|
||||||
final List<DiscoveryNodeRole> roles = NodeRoleSettings.NODE_ROLES_SETTING.get(settings);
|
final List<DiscoveryNodeRole> roles = NodeRoleSettings.NODE_ROLES_SETTING.get(settings);
|
||||||
if (DataTier.isFrozenNode(new HashSet<>(roles)) == false) {
|
if (DataTier.isFrozenNode(new HashSet<>(roles)) == false) {
|
||||||
String message = String.format(Locale.ROOT, "setting [%s] cannot be greater than zero on non-frozen nodes",
|
String message = String.format(Locale.ROOT, "Only frozen nodes can have a [%s] greater than zero.",
|
||||||
cacheSizeSettingKey);
|
cacheSizeSettingKey);
|
||||||
String url = "https://ela.st/es-deprecation-7-searchable-snapshot-shared-cache-setting";
|
String url = "https://ela.st/es-deprecation-7-searchable-snapshot-shared-cache-setting";
|
||||||
String details = String.format(Locale.ROOT, "setting [%s] cannot be greater than zero on non-frozen nodes, and is " +
|
String details = String.format(Locale.ROOT, "Set [%s] to zero on any node that doesn't have the [data_frozen] role.",
|
||||||
"currently set to [%s]", cacheSizeSettingKey, settings.get(cacheSizeSettingKey));
|
cacheSizeSettingKey);
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -710,8 +719,9 @@ class NodeDeprecationChecks {
|
||||||
Settings sslSettings = settings.filter(setting -> setting.startsWith(prefix));
|
Settings sslSettings = settings.filter(setting -> setting.startsWith(prefix));
|
||||||
if (enabledSettingValue == null && sslSettings.size() > 0) {
|
if (enabledSettingValue == null && sslSettings.size() > 0) {
|
||||||
String keys = sslSettings.keySet().stream().collect(Collectors.joining(","));
|
String keys = sslSettings.keySet().stream().collect(Collectors.joining(","));
|
||||||
String detail = String.format(Locale.ROOT, "setting [%s] is unset but the following settings exist: [%s]",
|
String detail = String.format(Locale.ROOT, "The [%s] setting is not configured, but the following SSL settings are: [%s]." +
|
||||||
enabledSettingKey, keys);
|
" To configure SSL, set [%s] or the node will fail to start in 8.0.",
|
||||||
|
enabledSettingKey, keys, enabledSettingKey);
|
||||||
details.add(detail);
|
details.add(detail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -719,7 +729,7 @@ class NodeDeprecationChecks {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
String url = "https://ela.st/es-deprecation-7-explicit-ssl-required";
|
String url = "https://ela.st/es-deprecation-7-explicit-ssl-required";
|
||||||
String message = "cannot set ssl properties without explicitly enabling or disabling ssl";
|
String message = "Must explicitly enable or disable SSL to configure SSL settings";
|
||||||
String detailsString = details.stream().collect(Collectors.joining("; "));
|
String detailsString = details.stream().collect(Collectors.joining("; "));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsString, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsString, false, null);
|
||||||
}
|
}
|
||||||
|
@ -741,21 +751,21 @@ class NodeDeprecationChecks {
|
||||||
boolean keyPathSettingExists = settings.get(keyPathSettingKey) != null;
|
boolean keyPathSettingExists = settings.get(keyPathSettingKey) != null;
|
||||||
boolean certificatePathSettingExists = settings.get(certificatePathSettingKey) != null;
|
boolean certificatePathSettingExists = settings.get(certificatePathSettingKey) != null;
|
||||||
if (keystorePathSettingExists == false && keyPathSettingExists == false && certificatePathSettingExists == false) {
|
if (keystorePathSettingExists == false && keyPathSettingExists == false && certificatePathSettingExists == false) {
|
||||||
String detail = String.format(Locale.ROOT, "none of [%s], [%s], or [%s] are set. If [%s] is true either [%s] must be " +
|
String detail = String.format(Locale.ROOT, "None of [%s], [%s], or [%s] are set. If [%s] is true either use a " +
|
||||||
"set, or [%s] and [%s] must be set", keystorePathSettingKey, keyPathSettingKey,
|
"keystore, or configure [%s] and [%s].", keystorePathSettingKey, keyPathSettingKey,
|
||||||
certificatePathSettingKey, enabledSettingKey, keystorePathSettingKey, keyPathSettingKey, certificatePathSettingKey);
|
certificatePathSettingKey, enabledSettingKey, keyPathSettingKey, certificatePathSettingKey);
|
||||||
details.add(detail);
|
details.add(detail);
|
||||||
} else if (keystorePathSettingExists && keyPathSettingExists && certificatePathSettingExists) {
|
} else if (keystorePathSettingExists && keyPathSettingExists && certificatePathSettingExists) {
|
||||||
String detail = String.format(Locale.ROOT, "all of [%s], [%s], and [%s] are set. Either [%s] must be set, or [%s] and" +
|
String detail = String.format(Locale.ROOT, "All of [%s], [%s], and [%s] are set. Either use a keystore, or " +
|
||||||
" [%s] must be set", keystorePathSettingKey, keyPathSettingKey, certificatePathSettingKey,
|
"configure [%s] and [%s].", keystorePathSettingKey, keyPathSettingKey, certificatePathSettingKey,
|
||||||
keystorePathSettingKey, keyPathSettingKey, certificatePathSettingKey);
|
keyPathSettingKey, certificatePathSettingKey);
|
||||||
details.add(detail);
|
details.add(detail);
|
||||||
} else if (keystorePathSettingExists && (keyPathSettingExists || certificatePathSettingExists)) {
|
} else if (keystorePathSettingExists && (keyPathSettingExists || certificatePathSettingExists)) {
|
||||||
String detail = String.format(Locale.ROOT, "[%s] and [%s] are set. Either [%s] must be set, or [%s] and [%s] must" +
|
String detail = String.format(Locale.ROOT, "Do not configure both [%s] and [%s]. Either" +
|
||||||
" be set",
|
" use a keystore, or configure [%s] and [%s].",
|
||||||
keystorePathSettingKey,
|
keystorePathSettingKey,
|
||||||
keyPathSettingExists ? keyPathSettingKey : certificatePathSettingKey,
|
keyPathSettingExists ? keyPathSettingKey : certificatePathSettingKey,
|
||||||
keystorePathSettingKey, keyPathSettingKey, certificatePathSettingKey);
|
keyPathSettingKey, certificatePathSettingKey);
|
||||||
details.add(detail);
|
details.add(detail);
|
||||||
} else if ((keyPathSettingExists && certificatePathSettingExists == false) ||
|
} else if ((keyPathSettingExists && certificatePathSettingExists == false) ||
|
||||||
(keyPathSettingExists == false && certificatePathSettingExists)) {
|
(keyPathSettingExists == false && certificatePathSettingExists)) {
|
||||||
|
@ -770,7 +780,7 @@ class NodeDeprecationChecks {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
String url = "https://ela.st/es-deprecation-7-ssl-settings";
|
String url = "https://ela.st/es-deprecation-7-ssl-settings";
|
||||||
String message = "if ssl is enabled either keystore must be set, or key path and certificate path must be set";
|
String message = "Must either configure a keystore or set the key path and certificate path when SSL is enabled";
|
||||||
String detailsString = details.stream().collect(Collectors.joining("; "));
|
String detailsString = details.stream().collect(Collectors.joining("; "));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsString, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, detailsString, false, null);
|
||||||
}
|
}
|
||||||
|
@ -784,13 +794,12 @@ class NodeDeprecationChecks {
|
||||||
if (permitsHandshakesFromIncompatibleBuildsSupplier.get() != null) {
|
if (permitsHandshakesFromIncompatibleBuildsSupplier.get() != null) {
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"the [%s] system property is deprecated and will be removed in the next major release",
|
"Setting the [%s] system property is deprecated",
|
||||||
TransportService.PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY
|
TransportService.PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY
|
||||||
);
|
);
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"allowing handshakes from incompatibile builds is deprecated and will be removed in the next major release; the [%s] " +
|
"Remove the [%s] system property. Handshakes from incompatible builds are not allowed in 8.0.",
|
||||||
"system property must be removed",
|
|
||||||
TransportService.PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY
|
TransportService.PERMIT_HANDSHAKES_FROM_INCOMPATIBLE_BUILDS_KEY
|
||||||
);
|
);
|
||||||
String url = "https://ela.st/es-deprecation-7-permit-handshake-from-incompatible-builds-setting";
|
String url = "https://ela.st/es-deprecation-7-permit-handshake-from-incompatible-builds-setting";
|
||||||
|
@ -817,14 +826,10 @@ class NodeDeprecationChecks {
|
||||||
final String transportProfilesSettings = transportProfiles.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
final String transportProfilesSettings = transportProfiles.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"settings [%s] are deprecated and will be removed in the next major version",
|
"Settings [%s] for the Transport client are deprecated",
|
||||||
transportProfilesSettings
|
|
||||||
);
|
|
||||||
final String details = String.format(
|
|
||||||
Locale.ROOT,
|
|
||||||
"transport client will be removed in the next major version so transport client related settings [%s] must be removed",
|
|
||||||
transportProfilesSettings
|
transportProfilesSettings
|
||||||
);
|
);
|
||||||
|
final String details = "Remove all [transport.profiles] settings. The Transport client no longer exists in 8.0.";
|
||||||
|
|
||||||
final String url = "https://ela.st/es-deprecation-7-transport-profiles-settings";
|
final String url = "https://ela.st/es-deprecation-7-transport-profiles-settings";
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, message, url, details, false, null);
|
||||||
|
@ -847,13 +852,13 @@ class NodeDeprecationChecks {
|
||||||
final String settingNames = existingSettings.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
final String settingNames = existingSettings.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
||||||
final String message = String.format(
|
final String message = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"cannot use properties related to delaying cluster state recovery after a majority of master nodes have joined because " +
|
"Delaying cluster state recovery based on the number of available master nodes is not supported",
|
||||||
"they have been deprecated and will be removed in the next major version",
|
|
||||||
settingNames
|
settingNames
|
||||||
);
|
);
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"cannot use properties [%s] because they have been deprecated and will be removed in the next major version",
|
"Use gateway.expected_data_nodes to wait for a certain number of data nodes. Remove the following settings or the node will " +
|
||||||
|
"fail to start in 8.0: [%s]",
|
||||||
settingNames
|
settingNames
|
||||||
);
|
);
|
||||||
final String url = "https://ela.st/es-deprecation-7-deferred-cluster-state-recovery";
|
final String url = "https://ela.st/es-deprecation-7-deferred-cluster-state-recovery";
|
||||||
|
@ -879,16 +884,10 @@ class NodeDeprecationChecks {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final String settingNames = existingSettings.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
final String settingNames = existingSettings.stream().map(Setting::getKey).collect(Collectors.joining(","));
|
||||||
final String message = String.format(
|
final String message = "The fixed_auto_queue_size threadpool type is not supported";
|
||||||
Locale.ROOT,
|
|
||||||
"cannot use properties [%s] because fixed_auto_queue_size threadpool type has been deprecated and will be removed in the next" +
|
|
||||||
" major version",
|
|
||||||
settingNames
|
|
||||||
);
|
|
||||||
final String details = String.format(
|
final String details = String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"cannot use properties [%s] because fixed_auto_queue_size threadpool type has been deprecated and will be removed in the next" +
|
"Remove the following settings or the node will fail to start in 8.0: [%s].",
|
||||||
" major version",
|
|
||||||
settingNames
|
settingNames
|
||||||
);
|
);
|
||||||
final String url = "https://ela.st/es-deprecation-7-fixed-auto-queue-size-settings";
|
final String url = "https://ela.st/es-deprecation-7-fixed-auto-queue-size-settings";
|
||||||
|
@ -902,6 +901,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
CLUSTER_ROUTING_REQUIRE_SETTING,
|
CLUSTER_ROUTING_REQUIRE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
|
"Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -913,6 +913,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
CLUSTER_ROUTING_INCLUDE_SETTING,
|
CLUSTER_ROUTING_INCLUDE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
|
"Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -924,6 +925,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
CLUSTER_ROUTING_EXCLUDE_SETTING,
|
CLUSTER_ROUTING_EXCLUDE_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
|
"Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -935,6 +937,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
Setting.boolSetting(SecurityField.setting("authc.accept_default_password"),true, Setting.Property.Deprecated),
|
Setting.boolSetting(SecurityField.setting("authc.accept_default_password"),true, Setting.Property.Deprecated),
|
||||||
"https://ela.st/es-deprecation-7-accept-default-password-setting",
|
"https://ela.st/es-deprecation-7-accept-default-password-setting",
|
||||||
|
"This setting has not had any effect since 6.0.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -946,6 +949,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
Setting.intSetting(SecurityField.setting("authz.store.roles.index.cache.max_size"), 10000, Setting.Property.Deprecated),
|
Setting.intSetting(SecurityField.setting("authz.store.roles.index.cache.max_size"), 10000, Setting.Property.Deprecated),
|
||||||
"https://ela.st/es-deprecation-7-roles-index-cache-settings",
|
"https://ela.st/es-deprecation-7-roles-index-cache-settings",
|
||||||
|
"Native role cache settings have had no effect since 5.2.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -958,6 +962,7 @@ class NodeDeprecationChecks {
|
||||||
Setting.timeSetting(SecurityField.setting("authz.store.roles.index.cache.ttl"), TimeValue.timeValueMinutes(20),
|
Setting.timeSetting(SecurityField.setting("authz.store.roles.index.cache.ttl"), TimeValue.timeValueMinutes(20),
|
||||||
Setting.Property.Deprecated),
|
Setting.Property.Deprecated),
|
||||||
"https://ela.st/es-deprecation-7-roles-index-cache-settings",
|
"https://ela.st/es-deprecation-7-roles-index-cache-settings",
|
||||||
|
"Native role cache settings have had no effect since 5.2.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -969,6 +974,7 @@ class NodeDeprecationChecks {
|
||||||
return checkRemovedSetting(settings,
|
return checkRemovedSetting(settings,
|
||||||
NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING,
|
NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING,
|
||||||
"https://ela.st/es-deprecation-7-node-local-storage-setting",
|
"https://ela.st/es-deprecation-7-node-local-storage-setting",
|
||||||
|
"All nodes require local storage in 8.0 and cannot share data paths.",
|
||||||
DeprecationIssue.Level.CRITICAL
|
DeprecationIssue.Level.CRITICAL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -987,7 +993,7 @@ class NodeDeprecationChecks {
|
||||||
String realm = concreteSamlPrincipalSettingKey.substring(0, principalKeySuffixIndex);
|
String realm = concreteSamlPrincipalSettingKey.substring(0, principalKeySuffixIndex);
|
||||||
String concreteNameIdFormatSettingKey = realm + ".nameid_format";
|
String concreteNameIdFormatSettingKey = realm + ".nameid_format";
|
||||||
if (settings.get(concreteNameIdFormatSettingKey) == null) {
|
if (settings.get(concreteNameIdFormatSettingKey) == null) {
|
||||||
return String.format(Locale.ROOT, "no value for [%s] set in realm [%s]",
|
return String.format(Locale.ROOT, "Configure \"%s\" for SAML realms: \"%s\".",
|
||||||
concreteNameIdFormatSettingKey, realm);
|
concreteNameIdFormatSettingKey, realm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -997,10 +1003,10 @@ class NodeDeprecationChecks {
|
||||||
if (detailsList.isEmpty()) {
|
if (detailsList.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
String message = "if nameid_format is not explicitly set, the previous default of " +
|
String message = "The SAML nameid_format is not set and no longer defaults to " +
|
||||||
"'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' is no longer used";
|
"\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"";
|
||||||
String url = "https://ela.st/es-deprecation-7-saml-nameid-format";
|
String url = "https://ela.st/es-deprecation-7-saml-nameid-format";
|
||||||
String details = detailsList.stream().collect(Collectors.joining(","));
|
String details = detailsList.stream().collect(Collectors.joining(" "));
|
||||||
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
return new DeprecationIssue(DeprecationIssue.Level.WARNING, message, url, details, false, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,9 +99,10 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(CLUSTER_SETTINGS_CHECKS, c -> c.apply(finalState));
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(CLUSTER_SETTINGS_CHECKS, c -> c.apply(finalState));
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"User-Agent ingest plugin will always use ECS-formatted output",
|
"The User-Agent ingest processor's ecs parameter is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-ingest-pipeline-ecs-option",
|
"https://ela.st/es-deprecation-7-ingest-pipeline-ecs-option",
|
||||||
"Ingest pipelines [ecs_false, ecs_true] uses the [ecs] option which needs to be removed to work in 8.0", false, null);
|
"Remove the ecs parameter from your ingest pipelines. The User-Agent ingest processor always returns Elastic Common Schema " +
|
||||||
|
"(ECS) fields in 8.0.", false, null);
|
||||||
assertEquals(singletonList(expected), issues);
|
assertEquals(singletonList(expected), issues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,11 +245,11 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
assertEquals(DeprecationIssue.Level.WARNING, issue.getLevel());
|
assertEquals(DeprecationIssue.Level.WARNING, issue.getLevel());
|
||||||
assertEquals("https://ela.st/es-deprecation-7-field_names-settings"
|
assertEquals("https://ela.st/es-deprecation-7-field_names-settings"
|
||||||
, issue.getUrl());
|
, issue.getUrl());
|
||||||
assertEquals("Index templates contain _field_names settings.", issue.getMessage());
|
assertEquals("Disabling the \"_field_names\" field in a template's index mappings is deprecated", issue.getMessage());
|
||||||
assertEquals("Index templates [" + badTemplateName + "] "
|
assertEquals("Remove the \"_field_names\" mapping that configures the enabled setting from the following templates: " +
|
||||||
+ "use the deprecated `enable` setting for the `" + FieldNamesFieldMapper.NAME +
|
"\"" + badTemplateName + "\". There's no longer a need to disable this field to reduce index overhead if you have a lot " +
|
||||||
"` field. Using this setting in new index mappings will throw an error in the next major version and " +
|
"of fields.",
|
||||||
"needs to be removed from existing mappings and templates.", issue.getDetails());
|
issue.getDetails());
|
||||||
} else {
|
} else {
|
||||||
assertTrue(issues.isEmpty());
|
assertTrue(issues.isEmpty());
|
||||||
}
|
}
|
||||||
|
@ -269,8 +270,8 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"Index Lifecycle Management poll interval is set too low",
|
"Index Lifecycle Management poll interval is set too low",
|
||||||
"https://ela.st/es-deprecation-7-indices-lifecycle-poll-interval-setting",
|
"https://ela.st/es-deprecation-7-indices-lifecycle-poll-interval-setting",
|
||||||
"The Index Lifecycle Management poll interval setting [" + LIFECYCLE_POLL_INTERVAL_SETTING.getKey() + "] is " +
|
"The ILM [" + LIFECYCLE_POLL_INTERVAL_SETTING.getKey() + "] setting is set to [" + tooLowInterval + "]. " +
|
||||||
"currently set to [" + tooLowInterval + "], but must be 1s or greater", false, null);
|
"Set the interval to at least 1s.", false, null);
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(CLUSTER_SETTINGS_CHECKS, c -> c.apply(badState));
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(CLUSTER_SETTINGS_CHECKS, c -> c.apply(badState));
|
||||||
assertEquals(singletonList(expected), issues);
|
assertEquals(singletonList(expected), issues);
|
||||||
}
|
}
|
||||||
|
@ -313,7 +314,8 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(CLUSTER_SETTINGS_CHECKS, c -> c.apply(badState));
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(CLUSTER_SETTINGS_CHECKS, c -> c.apply(badState));
|
||||||
assertThat(issues, hasSize(1));
|
assertThat(issues, hasSize(1));
|
||||||
assertThat(issues.get(0).getDetails(),
|
assertThat(issues.get(0).getDetails(),
|
||||||
equalTo("Index templates [multiple-types] define multiple types and so will cause errors when used in index creation"));
|
equalTo("Update or remove the following index templates before upgrading to 8.0: [multiple-types]. See " +
|
||||||
|
"https://ela.st/es-deprecation-7-removal-of-types for alternatives to mapping types."));
|
||||||
assertWarnings("Index template multiple-types contains multiple typed mappings;" +
|
assertWarnings("Index template multiple-types contains multiple typed mappings;" +
|
||||||
" templates in 8x will only support a single mapping");
|
" templates in 8x will only support a single mapping");
|
||||||
|
|
||||||
|
@ -345,13 +347,12 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
settingKey),
|
settingKey),
|
||||||
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%b], remove this setting",
|
"Remove the [%s] setting. Relocating shards are always taken into account in 8.0.",
|
||||||
settingKey,
|
settingKey),
|
||||||
settingValue),
|
|
||||||
false,
|
false,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
@ -408,10 +409,10 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"index templates contain deprecated geo_shape properties that must be removed",
|
"[single-type] index template uses deprecated geo_shape properties",
|
||||||
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
||||||
"mappings in index template single-type contains deprecated geo_shape properties. [parameter [points_only] in field " +
|
"Remove the following deprecated geo_shape properties from the mappings: [parameter [points_only] in field [location]; " +
|
||||||
"[location]; parameter [strategy] in field [location]]", false, null)
|
"parameter [strategy] in field [location]].", false, null)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Second, testing only a component template:
|
// Second, testing only a component template:
|
||||||
|
@ -430,10 +431,10 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"component templates contain deprecated geo_shape properties that must be removed",
|
"[my-template] component template uses deprecated geo_shape properties",
|
||||||
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
||||||
"mappings in component template my-template contains deprecated geo_shape properties. [parameter [points_only] in field " +
|
"Remove the following deprecated geo_shape properties from the mappings: [parameter [points_only] in field [location]; " +
|
||||||
"[location]; parameter [strategy] in field [location]]", false, null)
|
"parameter [strategy] in field [location]].", false, null)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Third, trying a component template and an index template:
|
// Third, trying a component template and an index template:
|
||||||
|
@ -446,12 +447,11 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"component templates and index templates contain deprecated geo_shape properties that must be removed",
|
"[my-template] component template and [single-type] index template use deprecated geo_shape properties",
|
||||||
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
||||||
"mappings in component template my-template contains deprecated geo_shape properties. [parameter [points_only] in field " +
|
"Remove the following deprecated geo_shape properties from the mappings: [my-template: [parameter [points_only] in field" +
|
||||||
"[location]; parameter [strategy] in field [location]]; mappings in index template single-type contains " +
|
" [location]; parameter [strategy] in field [location]]]; [single-type: [parameter [points_only] in field " +
|
||||||
"deprecated geo_shape properties. [parameter [points_only] in field [location]; parameter [strategy] in field " +
|
"[location]; parameter [strategy] in field [location]]].", false, null)
|
||||||
"[location]]", false, null)
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,10 +488,10 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"index templates contain deprecated sparse_vector fields that must be removed",
|
"[single-type] index template uses deprecated sparse_vector properties",
|
||||||
"https://ela.st/es-deprecation-7-sparse-vector",
|
"https://ela.st/es-deprecation-7-sparse-vector",
|
||||||
"mappings in index template single-type contains deprecated sparse_vector fields: [my_sparse_vector], " +
|
"Remove the following deprecated sparse_vector properties from the mappings: [my_sparse_vector]; " +
|
||||||
"[my_nested_sparse_vector]", false, null)
|
"[my_nested_sparse_vector].", false, null)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Second, testing only a component template:
|
// Second, testing only a component template:
|
||||||
|
@ -509,9 +509,9 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"component templates contain deprecated sparse_vector fields that must be removed",
|
"[my-template] component template uses deprecated sparse_vector properties",
|
||||||
"https://ela.st/es-deprecation-7-sparse-vector",
|
"https://ela.st/es-deprecation-7-sparse-vector",
|
||||||
"mappings in component template [my-template] contains deprecated sparse_vector fields: [my_sparse_vector]", false, null)
|
"Remove the following deprecated sparse_vector properties from the mappings: [my_sparse_vector].", false, null)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Third, trying a component template and an index template:
|
// Third, trying a component template and an index template:
|
||||||
|
@ -524,11 +524,10 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"component templates and index templates contain deprecated sparse_vector fields that must be removed",
|
"[my-template] component template and [single-type] index template use deprecated sparse_vector properties",
|
||||||
"https://ela.st/es-deprecation-7-sparse-vector",
|
"https://ela.st/es-deprecation-7-sparse-vector",
|
||||||
"mappings in component template [my-template] contains deprecated sparse_vector fields: [my_sparse_vector]; " +
|
"Remove the following deprecated sparse_vector properties from the mappings: [my-template: " +
|
||||||
"mappings in index template single-type contains deprecated sparse_vector fields: " +
|
"[my_sparse_vector]]; [single-type: [my_sparse_vector]; [my_nested_sparse_vector]].", false, null)
|
||||||
"[my_sparse_vector], [my_nested_sparse_vector]", false, null)
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,9 +556,9 @@ public class ClusterDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue issue = ClusterDeprecationChecks.checkILMFreezeActions(badState);
|
DeprecationIssue issue = ClusterDeprecationChecks.checkILMFreezeActions(badState);
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"some ilm policies contain a freeze action, which is deprecated and will be removed in a future release",
|
"ILM policies use the deprecated freeze action",
|
||||||
"https://ela.st/es-deprecation-7-frozen-indices",
|
"https://ela.st/es-deprecation-7-frozen-indices",
|
||||||
"remove freeze action from the following ilm policies: [policy1,policy2]", false, null)
|
"Remove the freeze action from ILM policies: [policy1,policy2]", false, null)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
import org.elasticsearch.cluster.routing.allocation.DataTier;
|
import org.elasticsearch.cluster.routing.allocation.DataTier;
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.joda.JodaDeprecationPatterns;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.index.IndexModule;
|
import org.elasticsearch.index.IndexModule;
|
||||||
import org.elasticsearch.index.IndexSettings;
|
import org.elasticsearch.index.IndexSettings;
|
||||||
|
@ -48,6 +47,7 @@ import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocat
|
||||||
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_INCLUDE_SETTING;
|
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_INCLUDE_SETTING;
|
||||||
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_REQUIRE_SETTING;
|
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_REQUIRE_SETTING;
|
||||||
import static org.elasticsearch.xpack.deprecation.DeprecationChecks.INDEX_SETTINGS_CHECKS;
|
import static org.elasticsearch.xpack.deprecation.DeprecationChecks.INDEX_SETTINGS_CHECKS;
|
||||||
|
import static org.elasticsearch.xpack.deprecation.IndexDeprecationChecks.JODA_TIME_DEPRECATION_DETAILS_SUFFIX;
|
||||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||||
import static org.hamcrest.Matchers.empty;
|
import static org.hamcrest.Matchers.empty;
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
|
@ -66,7 +66,9 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"Index created before 7.0",
|
"Index created before 7.0",
|
||||||
"https://ela.st/es-deprecation-7-reindex",
|
"https://ela.st/es-deprecation-7-reindex",
|
||||||
"This index was created using version: " + createdWith, false, null);
|
"This index was created with version " + createdWith + " and is not compatible with 8.0. Reindex or remove the index before " +
|
||||||
|
"upgrading.",
|
||||||
|
false, null);
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, indexMetadata));
|
c -> c.apply(ClusterState.EMPTY_STATE, indexMetadata));
|
||||||
assertEquals(singletonList(expected), issues);
|
assertEquals(singletonList(expected), issues);
|
||||||
|
@ -120,10 +122,10 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Number of fields exceeds automatic field expansion limit",
|
"Number of fields exceeds automatic field expansion limit",
|
||||||
"https://ela.st/es-deprecation-7-number-of-auto-expanded-fields",
|
"https://ela.st/es-deprecation-7-number-of-auto-expanded-fields",
|
||||||
"This index has [" + fieldCount + "] fields, which exceeds the automatic field expansion limit of 1024 " +
|
"This index has " + fieldCount + " fields, which exceeds the automatic field expansion limit (1024). Set " +
|
||||||
"and does not have [" + IndexSettings.DEFAULT_FIELD_SETTING.getKey() + "] set, which may cause queries which use " +
|
IndexSettings.DEFAULT_FIELD_SETTING.getKey() + " to prevent queries that support automatic field expansion from failing " +
|
||||||
"automatic field expansion, such as query_string, simple_query_string, and multi_match to fail if fields are not " +
|
"if no fields are specified. Otherwise, you must explicitly specify fields in all query_string, simple_query_string, and " +
|
||||||
"explicitly specified in the query.", false, null);
|
"multi_match queries.", false, null);
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, tooManyFieldsIndex));
|
c -> c.apply(ClusterState.EMPTY_STATE, tooManyFieldsIndex));
|
||||||
assertEquals(singletonList(expected), issues);
|
assertEquals(singletonList(expected), issues);
|
||||||
|
@ -181,9 +183,10 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
assertEquals(1, issues.size());
|
assertEquals(1, issues.size());
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Multi-fields within multi-fields",
|
"Defining multi-fields within multi-fields is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-chained-multi-fields",
|
"https://ela.st/es-deprecation-7-chained-multi-fields",
|
||||||
"The names of fields that contain chained multi-fields: [[type: _doc, field: invalid-field]]", false, null);
|
"Remove chained multi-fields from the \"invalid-field\" mapping. Multi-fields within multi-fields are not supported in 8.0.",
|
||||||
|
false, null);
|
||||||
assertEquals(singletonList(expected), issues);
|
assertEquals(singletonList(expected), issues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,14 +232,9 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Date field format uses patterns which has changed meaning in 7.0",
|
"Date fields use deprecated Joda time formats",
|
||||||
"https://ela.st/es-deprecation-7-java-time",
|
"https://ela.st/es-deprecation-7-java-time",
|
||||||
"This index has date fields with deprecated formats: ["+
|
"Convert [date_time_field_Y] format dd-CC||MM-YYYY to java.time." + JODA_TIME_DEPRECATION_DETAILS_SUFFIX, false, null);
|
||||||
"[type: _doc, field: date_time_field_Y, format: dd-CC||MM-YYYY, " +
|
|
||||||
"suggestion: 'C' century of era is no longer supported." +
|
|
||||||
"; "+
|
|
||||||
"'Y' year-of-era should be replaced with 'y'. Use 'Y' for week-based-year.]"+
|
|
||||||
"]. "+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
|
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
|
@ -254,12 +252,9 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Date field format uses patterns which has changed meaning in 7.0",
|
"Date fields use deprecated Joda time formats",
|
||||||
"https://ela.st/es-deprecation-7-java-time",
|
"https://ela.st/es-deprecation-7-java-time",
|
||||||
"This index has date fields with deprecated formats: ["+
|
"Convert [date_time_field_Y] format dd-YYYY||MM-YYYY to java.time." + JODA_TIME_DEPRECATION_DETAILS_SUFFIX, false, null);
|
||||||
"[type: _doc, field: date_time_field_Y, format: dd-YYYY||MM-YYYY, " +
|
|
||||||
"suggestion: 'Y' year-of-era should be replaced with 'y'. Use 'Y' for week-based-year.]"+
|
|
||||||
"]. "+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
|
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
|
@ -277,12 +272,10 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Date field format uses patterns which has changed meaning in 7.0",
|
"Date fields use deprecated Joda time formats",
|
||||||
"https://ela.st/es-deprecation-7-java-time",
|
"https://ela.st/es-deprecation-7-java-time",
|
||||||
"This index has date fields with deprecated formats: ["+
|
"Convert [date_time_field_Y] format strictWeekyearWeek||MM-YYYY to java.time." + JODA_TIME_DEPRECATION_DETAILS_SUFFIX,
|
||||||
"[type: _doc, field: date_time_field_Y, format: strictWeekyearWeek||MM-YYYY, " +
|
false, null);
|
||||||
"suggestion: 'Y' year-of-era should be replaced with 'y'. Use 'Y' for week-based-year.]"+
|
|
||||||
"]. "+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
|
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
|
@ -321,23 +314,12 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Date field format uses patterns which has changed meaning in 7.0",
|
"Date fields use deprecated Joda time formats",
|
||||||
"https://ela.st/es-deprecation-7-java-time",
|
"https://ela.st/es-deprecation-7-java-time",
|
||||||
"This index has date fields with deprecated formats: ["+
|
"Convert [date_time_field_Y] format MM-YYYY to java.time. Convert [date_time_field_C] format CC to java.time. Convert " +
|
||||||
"[type: _doc, field: date_time_field_Y, format: MM-YYYY, " +
|
"[date_time_field_x] format xx-MM to java.time. Convert [date_time_field_y] format yy-MM to java.time. Convert " +
|
||||||
"suggestion: 'Y' year-of-era should be replaced with 'y'. Use 'Y' for week-based-year.], "+
|
"[date_time_field_Z] format HH:mmZ to java.time. Convert [date_time_field_z] format HH:mmz to java.time." +
|
||||||
"[type: _doc, field: date_time_field_C, format: CC, " +
|
JODA_TIME_DEPRECATION_DETAILS_SUFFIX, false, null);
|
||||||
"suggestion: 'C' century of era is no longer supported.], "+
|
|
||||||
"[type: _doc, field: date_time_field_x, format: xx-MM, " +
|
|
||||||
"suggestion: 'x' weak-year should be replaced with 'Y'. Use 'x' for zone-offset.], "+
|
|
||||||
"[type: _doc, field: date_time_field_y, format: yy-MM, " +
|
|
||||||
"suggestion: 'y' year should be replaced with 'u'. Use 'y' for year-of-era.], "+
|
|
||||||
"[type: _doc, field: date_time_field_Z, format: HH:mmZ, " +
|
|
||||||
"suggestion: 'Z' time zone offset/id fails when parsing 'Z' for Zulu timezone. Consider using 'X'.], "+
|
|
||||||
"[type: _doc, field: date_time_field_z, format: HH:mmz, " +
|
|
||||||
"suggestion: 'z' time zone text. Will print 'Z' for Zulu given UTC timezone." +
|
|
||||||
"]"+
|
|
||||||
"]. "+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
|
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
|
@ -356,16 +338,9 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
IndexMetadata simpleIndex = createV6Index(simpleMapping);
|
||||||
|
|
||||||
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expected = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"Date field format uses patterns which has changed meaning in 7.0",
|
"Date fields use deprecated Joda time formats",
|
||||||
"https://ela.st/es-deprecation-7-java-time",
|
"https://ela.st/es-deprecation-7-java-time",
|
||||||
"This index has date fields with deprecated formats: ["+
|
"Convert [date_time_field] format Y-C-x-y to java.time." + JODA_TIME_DEPRECATION_DETAILS_SUFFIX, false, null);
|
||||||
"[type: _doc, field: date_time_field, format: Y-C-x-y, " +
|
|
||||||
"suggestion: 'Y' year-of-era should be replaced with 'y'. Use 'Y' for week-based-year.; " +
|
|
||||||
"'y' year should be replaced with 'u'. Use 'y' for year-of-era.; " +
|
|
||||||
"'C' century of era is no longer supported.; " +
|
|
||||||
"'x' weak-year should be replaced with 'Y'. Use 'x' for zone-offset." +
|
|
||||||
"]"+
|
|
||||||
"]. "+ JodaDeprecationPatterns.USE_NEW_FORMAT_SPECIFIERS, false, null);
|
|
||||||
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
List<DeprecationIssue> issues = DeprecationChecks.filterChecks(INDEX_SETTINGS_CHECKS,
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
c -> c.apply(ClusterState.EMPTY_STATE, simpleIndex));
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
|
@ -426,10 +401,10 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, indexMetadata));
|
c -> c.apply(ClusterState.EMPTY_STATE, indexMetadata));
|
||||||
assertThat(issues, contains(
|
assertThat(issues, contains(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"translog retention settings are ignored",
|
"Translog retention settings are deprecated",
|
||||||
"https://ela.st/es-deprecation-7-translog-settings",
|
"https://ela.st/es-deprecation-7-translog-settings",
|
||||||
"translog retention settings [index.translog.retention.size] and [index.translog.retention.age] are ignored " +
|
"Remove the translog retention settings: \"index.translog.retention.size\" and \"index.translog.retention.age\". The " +
|
||||||
"because translog is no longer used in peer recoveries with soft-deletes enabled (default in 7.0 or later)",
|
"translog has not been used in peer recoveries with soft-deletes enabled since 7.0 and these settings have no effect.",
|
||||||
false, null)
|
false, null)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -468,8 +443,9 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue issue = issues.get(0);
|
DeprecationIssue issue = issues.get(0);
|
||||||
assertEquals(DeprecationIssue.Level.WARNING, issue.getLevel());
|
assertEquals(DeprecationIssue.Level.WARNING, issue.getLevel());
|
||||||
assertEquals("https://ela.st/es-deprecation-7-field_names-settings", issue.getUrl());
|
assertEquals("https://ela.st/es-deprecation-7-field_names-settings", issue.getUrl());
|
||||||
assertEquals("Index mapping contains explicit `_field_names` enabling settings.", issue.getMessage());
|
assertEquals("Disabling the \"_field_names\" field in the index mappings is deprecated", issue.getMessage());
|
||||||
assertEquals("The index mapping contains a deprecated `enabled` setting for `_field_names` that should be removed moving foward.",
|
assertEquals("Remove the \"field_names\" mapping that configures the enabled setting. There's no longer a need to disable this " +
|
||||||
|
"field to reduce index overhead if you have a lot of fields.",
|
||||||
issue.getDetails());
|
issue.getDetails());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,9 +458,9 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
final String expectedUrl = "https://ela.st/es-deprecation-7-shared-path-settings";
|
final String expectedUrl = "https://ela.st/es-deprecation-7-shared-path-settings";
|
||||||
assertThat(issues, contains(
|
assertThat(issues, contains(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [index.data_path] is deprecated and will be removed in a future version",
|
"Setting [index.data_path] is deprecated",
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
"Found index data path configured. Discontinue use of this setting.",
|
"Remove the [index.data_path] setting. This setting has had no effect since 6.0.",
|
||||||
false, null)));
|
false, null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,14 +474,16 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
final String expectedUrl = "https://ela.st/es-deprecation-7-slowlog-settings";
|
final String expectedUrl = "https://ela.st/es-deprecation-7-slowlog-settings";
|
||||||
assertThat(issues, containsInAnyOrder(
|
assertThat(issues, containsInAnyOrder(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"setting [index.search.slowlog.level] is deprecated and will be removed in a future version",
|
"Setting [index.search.slowlog.level] is deprecated",
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
"Found [index.search.slowlog.level] configured. Discontinue use of this setting. Use thresholds.", false, null
|
"Remove the [index.search.slowlog.level] setting. Use the [index.*.slowlog.threshold] settings to set the log levels.",
|
||||||
|
false, null
|
||||||
),
|
),
|
||||||
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"setting [index.indexing.slowlog.level] is deprecated and will be removed in a future version",
|
"Setting [index.indexing.slowlog.level] is deprecated",
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
"Found [index.indexing.slowlog.level] configured. Discontinue use of this setting. Use thresholds.", false, null
|
"Remove the [index.indexing.slowlog.level] setting. Use the [index.*.slowlog.threshold] settings to set the log levels.",
|
||||||
|
false, null
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,11 +495,10 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
c -> c.apply(ClusterState.EMPTY_STATE, indexMetadata));
|
c -> c.apply(ClusterState.EMPTY_STATE, indexMetadata));
|
||||||
assertThat(issues, contains(
|
assertThat(issues, contains(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"[simplefs] is deprecated and will be removed in future versions",
|
"Setting [index.store.type] to [simplefs] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-simplefs-store-type",
|
"https://ela.st/es-deprecation-7-simplefs-store-type",
|
||||||
"[simplefs] is deprecated and will be removed in 8.0. Use [niofs] or other file systems instead. " +
|
"Use [niofs] (the default) or one of the other FS types. This is an expert-only setting that might be removed in the " +
|
||||||
"Elasticsearch 7.15 or later uses [niofs] for the [simplefs] store type " +
|
"future.", false, null)
|
||||||
"as it offers superior or equivalent performance to [simplefs].", false, null)
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,35 +511,34 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
.build();
|
.build();
|
||||||
final DeprecationIssue expectedRequireIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedRequireIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
INDEX_ROUTING_REQUIRE_SETTING.getKey()),
|
INDEX_ROUTING_REQUIRE_SETTING.getKey()),
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
INDEX_ROUTING_REQUIRE_SETTING.getKey(),
|
INDEX_ROUTING_REQUIRE_SETTING.getKey(),
|
||||||
settingValue),
|
settingValue),
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
final DeprecationIssue expectedIncludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIncludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
INDEX_ROUTING_INCLUDE_SETTING.getKey()),
|
INDEX_ROUTING_INCLUDE_SETTING.getKey()),
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
INDEX_ROUTING_INCLUDE_SETTING.getKey(),
|
INDEX_ROUTING_INCLUDE_SETTING.getKey(),
|
||||||
settingValue),
|
settingValue),
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
final DeprecationIssue expectedExcludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedExcludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
INDEX_ROUTING_EXCLUDE_SETTING.getKey()),
|
INDEX_ROUTING_EXCLUDE_SETTING.getKey()),
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
INDEX_ROUTING_EXCLUDE_SETTING.getKey(),
|
INDEX_ROUTING_EXCLUDE_SETTING.getKey()),
|
||||||
settingValue),
|
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -625,7 +601,7 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
assertEquals(1, issues.size());
|
assertEquals(1, issues.size());
|
||||||
assertThat(issues, contains(
|
assertThat(issues, contains(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"mappings for index test contains deprecated geo_shape properties that must be removed",
|
"[test] index uses deprecated geo_shape properties",
|
||||||
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
||||||
"The following geo_shape parameters must be removed from test: [[parameter [points_only] in field [location]; parameter " +
|
"The following geo_shape parameters must be removed from test: [[parameter [points_only] in field [location]; parameter " +
|
||||||
"[strategy] in field [location]]]", false, null)
|
"[strategy] in field [location]]]", false, null)
|
||||||
|
@ -645,7 +621,7 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
assertEquals(1, issues.size());
|
assertEquals(1, issues.size());
|
||||||
assertThat(issues, contains(
|
assertThat(issues, contains(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"mappings for index test contains deprecated geo_shape properties that must be removed",
|
"[test] index uses deprecated geo_shape properties",
|
||||||
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
"https://ela.st/es-deprecation-7-geo-shape-mappings",
|
||||||
"The following geo_shape parameters must be removed from test: [[parameter [points_only] in field [location]; parameter " +
|
"The following geo_shape parameters must be removed from test: [[parameter [points_only] in field [location]; parameter " +
|
||||||
"[strategy] in field [location]]]", false, null)
|
"[strategy] in field [location]]]", false, null)
|
||||||
|
@ -663,10 +639,10 @@ public class IndexDeprecationChecksTests extends ESTestCase {
|
||||||
contains(
|
contains(
|
||||||
new DeprecationIssue(
|
new DeprecationIssue(
|
||||||
DeprecationIssue.Level.WARNING,
|
DeprecationIssue.Level.WARNING,
|
||||||
"[index.max_adjacency_matrix_filters] setting will be ignored in 8.0. "
|
"Setting [index.max_adjacency_matrix_filters] is deprecated",
|
||||||
+ "Use [indices.query.bool.max_clause_count] instead.",
|
|
||||||
"https://ela.st/es-deprecation-7-adjacency-matrix-filters-setting",
|
"https://ela.st/es-deprecation-7-adjacency-matrix-filters-setting",
|
||||||
"the setting [index.max_adjacency_matrix_filters] is currently set to [5], remove this setting",
|
"Remove the [index.max_adjacency_matrix_filters] setting. Set [indices.query.bool.max_clause_count] to [5]. " +
|
||||||
|
"[index.max_adjacency_matrix_filters] will be ignored in 8.0.",
|
||||||
false,
|
false,
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
|
|
@ -53,6 +53,7 @@ import static org.elasticsearch.cluster.routing.allocation.DiskThresholdSettings
|
||||||
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_EXCLUDE_SETTING;
|
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_EXCLUDE_SETTING;
|
||||||
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_INCLUDE_SETTING;
|
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_INCLUDE_SETTING;
|
||||||
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_REQUIRE_SETTING;
|
import static org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider.INDEX_ROUTING_REQUIRE_SETTING;
|
||||||
|
import static org.elasticsearch.xpack.deprecation.NodeDeprecationChecks.JAVA_DEPRECATION_MESSAGE;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.hamcrest.Matchers.either;
|
import static org.hamcrest.Matchers.either;
|
||||||
import static org.hamcrest.Matchers.empty;
|
import static org.hamcrest.Matchers.empty;
|
||||||
|
@ -88,11 +89,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"Java 11 is required",
|
"Java 11 is required in 8.0",
|
||||||
"https://ela.st/es-deprecation-7-java-version",
|
"https://ela.st/es-deprecation-7-java-version",
|
||||||
"Java 11 will be required for future versions of Elasticsearch, this node is running version ["
|
"This node is running Java version [" + JavaVersion.current().toString() + "]. Consider switching to a distribution of " +
|
||||||
+ JavaVersion.current().toString() + "]. Consider switching to a distribution of Elasticsearch with a bundled JDK. "
|
"Elasticsearch with a bundled JDK or upgrade. If you are already using a distribution with a bundled JDK, ensure the " +
|
||||||
+ "If you are already using a distribution with a bundled JDK, ensure the JAVA_HOME environment variable is not set.",
|
"JAVA_HOME environment variable is not set.",
|
||||||
false,
|
false,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
@ -111,9 +112,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [pidfile] is deprecated in favor of setting [node.pidfile]",
|
"Setting [pidfile] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-pidfile-setting",
|
"https://ela.st/es-deprecation-7-pidfile-setting",
|
||||||
"the setting [pidfile] is currently set to [" + pidfile + "], instead set [node.pidfile] to [" + pidfile + "]", false, null);
|
"Remove the [pidfile] setting and set [node.pidfile] to [" + pidfile + "].", false, null);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Environment.PIDFILE_SETTING});
|
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Environment.PIDFILE_SETTING});
|
||||||
}
|
}
|
||||||
|
@ -126,9 +127,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [processors] is deprecated in favor of setting [node.processors]",
|
"Setting [processors] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-processors-setting",
|
"https://ela.st/es-deprecation-7-processors-setting",
|
||||||
"the setting [processors] is currently set to [" + processors + "], instead set [node.processors] to [" + processors + "]",
|
"Remove the [processors] setting and set [node.processors] to [" + processors + "].",
|
||||||
false, null);
|
false, null);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{EsExecutors.PROCESSORS_SETTING});
|
assertSettingDeprecationsAndWarnings(new Setting<?>[]{EsExecutors.PROCESSORS_SETTING});
|
||||||
|
@ -155,11 +156,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
assertEquals(1, deprecationIssues.size());
|
assertEquals(1, deprecationIssues.size());
|
||||||
assertEquals(new DeprecationIssue(
|
assertEquals(new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"Realm order will be required in next major release.",
|
"Realm order is required",
|
||||||
"https://ela.st/es-deprecation-7-realm-orders-required",
|
"https://ela.st/es-deprecation-7-realm-orders-required",
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"Found realms without order config: [%s]. In next major release, node will fail to start with missing realm order.",
|
"Specify the realm order for all realms [%s]. If no realm order is specified, the node will fail to start in 8.0. ",
|
||||||
RealmSettings.realmSettingPrefix(invalidRealm) + RealmSettings.ORDER_SETTING_KEY
|
RealmSettings.realmSettingPrefix(invalidRealm) + RealmSettings.ORDER_SETTING_KEY
|
||||||
),
|
),
|
||||||
false,
|
false,
|
||||||
|
@ -212,8 +213,8 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"https://ela.st/es-deprecation-7-realm-orders-unique",
|
"https://ela.st/es-deprecation-7-realm-orders-unique",
|
||||||
deprecationIssues.get(0).getUrl());
|
deprecationIssues.get(0).getUrl());
|
||||||
assertEquals("Realm orders must be unique in next major release.", deprecationIssues.get(0).getMessage());
|
assertEquals("Realm orders must be unique", deprecationIssues.get(0).getMessage());
|
||||||
assertThat(deprecationIssues.get(0).getDetails(), startsWith("Found multiple realms configured with the same order:"));
|
assertThat(deprecationIssues.get(0).getDetails(), startsWith("The same order is configured for multiple realms:"));
|
||||||
assertThat(deprecationIssues.get(0).getDetails(), containsString(invalidRealm1.getType() + "." + invalidRealm1.getName()));
|
assertThat(deprecationIssues.get(0).getDetails(), containsString(invalidRealm1.getType() + "." + invalidRealm1.getName()));
|
||||||
assertThat(deprecationIssues.get(0).getDetails(), containsString(invalidRealm2.getType() + "." + invalidRealm2.getName()));
|
assertThat(deprecationIssues.get(0).getDetails(), containsString(invalidRealm2.getType() + "." + invalidRealm2.getName()));
|
||||||
assertThat(deprecationIssues.get(0).getDetails(), not(containsString(validRealm.getType() + "." + validRealm.getName())));
|
assertThat(deprecationIssues.get(0).getDetails(), not(containsString(validRealm.getType() + "." + validRealm.getName())));
|
||||||
|
@ -235,7 +236,6 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final XPackLicenseState licenseState =
|
final XPackLicenseState licenseState =
|
||||||
new XPackLicenseState(settings, () -> 0);
|
new XPackLicenseState(settings, () -> 0);
|
||||||
final List<DeprecationIssue> deprecationIssues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> deprecationIssues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
|
|
||||||
assertTrue(deprecationIssues.isEmpty());
|
assertTrue(deprecationIssues.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,13 +386,12 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
final DeprecationIssue deprecationIssue = deprecationIssues.get(0);
|
final DeprecationIssue deprecationIssue = deprecationIssues.get(0);
|
||||||
assertEquals(DeprecationIssue.Level.WARNING, deprecationIssue.getLevel());
|
assertEquals(DeprecationIssue.Level.WARNING, deprecationIssue.getLevel());
|
||||||
assertEquals("Realm names cannot start with [_] in a future major release.", deprecationIssue.getMessage());
|
assertEquals("Prefixing realm names with an underscore (_) is deprecated", deprecationIssue.getMessage());
|
||||||
assertEquals("https://ela.st/es-deprecation-7-realm-names", deprecationIssue.getUrl());
|
assertEquals("https://ela.st/es-deprecation-7-realm-names", deprecationIssue.getUrl());
|
||||||
assertEquals("Found realm " + (invalidRealmNames.size() == 1 ? "name" : "names")
|
String expectedDetails = String.format(Locale.ROOT, "Rename the following realm%s in the realm chain: %s.",
|
||||||
+ " with reserved prefix [_]: ["
|
invalidRealmNames.size() > 1 ? "s" : "",
|
||||||
+ Strings.collectionToDelimitedString(invalidRealmNames.stream().sorted().collect(Collectors.toList()), "; ") + "]. "
|
Strings.collectionToDelimitedString(invalidRealmNames.stream().sorted().collect(Collectors.toList()), ", "));
|
||||||
+ "In a future major release, node will fail to start if any realm names start with reserved prefix.",
|
assertEquals(expectedDetails, deprecationIssue.getDetails());
|
||||||
deprecationIssue.getDetails());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testThreadPoolListenerQueueSize() {
|
public void testThreadPoolListenerQueueSize() {
|
||||||
|
@ -403,9 +402,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [thread_pool.listener.queue_size] is deprecated and will be removed in the next major version",
|
"Setting [thread_pool.listener.queue_size] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-thread-pool-listener-settings",
|
"https://ela.st/es-deprecation-7-thread-pool-listener-settings",
|
||||||
"the setting [thread_pool.listener.queue_size] is currently set to [" + size + "], remove this setting", false, null);
|
"Remove the [thread_pool.listener.queue_size] setting. The listener pool is no longer used in 8.0.", false, null);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(getDeprecatedSettingsForSettingNames("thread_pool.listener.queue_size"));
|
assertSettingDeprecationsAndWarnings(getDeprecatedSettingsForSettingNames("thread_pool.listener.queue_size"));
|
||||||
}
|
}
|
||||||
|
@ -418,9 +417,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [thread_pool.listener.size] is deprecated and will be removed in the next major version",
|
"Setting [thread_pool.listener.size] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-thread-pool-listener-settings",
|
"https://ela.st/es-deprecation-7-thread-pool-listener-settings",
|
||||||
"the setting [thread_pool.listener.size] is currently set to [" + size + "], remove this setting", false, null);
|
"Remove the [thread_pool.listener.size] setting. The listener pool is no longer used in 8.0.", false, null);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(getDeprecatedSettingsForSettingNames("thread_pool.listener.size"));
|
assertSettingDeprecationsAndWarnings(getDeprecatedSettingsForSettingNames("thread_pool.listener.size"));
|
||||||
}
|
}
|
||||||
|
@ -438,14 +437,13 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [cluster.remote.connect] is deprecated in favor of setting [node.remote_cluster_client]",
|
"Setting [cluster.remote.connect] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-cluster-remote-connect-setting",
|
"https://ela.st/es-deprecation-7-cluster-remote-connect-setting",
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%b], instead set [%s] to [%2$b]",
|
"Remove the [%s] setting and set [node.remote_cluster_client] to [%b].",
|
||||||
RemoteClusterService.ENABLE_REMOTE_CLUSTERS.getKey(),
|
RemoteClusterService.ENABLE_REMOTE_CLUSTERS.getKey(),
|
||||||
value,
|
value
|
||||||
"node.remote_cluster_client"
|
|
||||||
), false, null);
|
), false, null);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{RemoteClusterService.ENABLE_REMOTE_CLUSTERS});
|
assertSettingDeprecationsAndWarnings(new Setting<?>[]{RemoteClusterService.ENABLE_REMOTE_CLUSTERS});
|
||||||
|
@ -459,9 +457,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [node.local_storage] is deprecated and will be removed in the next major version",
|
"Setting [node.local_storage] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-node-local-storage-setting",
|
"https://ela.st/es-deprecation-7-node-local-storage-setting",
|
||||||
"the setting [node.local_storage] is currently set to [" + value + "], remove this setting", false, null
|
"Remove the [node.local_storage] setting. All nodes require local storage in 8.0 and cannot share data paths.", false, null
|
||||||
);
|
);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Node.NODE_LOCAL_STORAGE_SETTING});
|
assertSettingDeprecationsAndWarnings(new Setting<?>[]{Node.NODE_LOCAL_STORAGE_SETTING});
|
||||||
|
@ -488,9 +486,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [" + deprecatedSetting.getKey() + "] is deprecated and will be removed in the next major version",
|
"Setting [" + deprecatedSetting.getKey() + "] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-xpack-basic-feature-settings",
|
"https://ela.st/es-deprecation-7-xpack-basic-feature-settings",
|
||||||
"the setting [" + deprecatedSetting.getKey() + "] is currently set to [" + value + "], remove this setting", false, null
|
"Remove the [" + deprecatedSetting.getKey() + "] setting. Basic features are always enabled in 8.0.", false, null
|
||||||
);
|
);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{deprecatedSetting});
|
assertSettingDeprecationsAndWarnings(new Setting<?>[]{deprecatedSetting});
|
||||||
|
@ -508,19 +506,15 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final PluginsAndModules pluginsAndModules = new PluginsAndModules(Collections.emptyList(), Collections.emptyList());
|
final PluginsAndModules pluginsAndModules = new PluginsAndModules(Collections.emptyList(), Collections.emptyList());
|
||||||
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
||||||
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
final List<DeprecationIssue> issues = getDeprecationIssues(settings, pluginsAndModules, licenseState);
|
||||||
final String roles = DiscoveryNode.getRolesFromSettings(settings)
|
final String role = legacyRoleSetting.getKey().substring(legacyRoleSetting.getKey().indexOf(".") + 1);
|
||||||
.stream()
|
|
||||||
.map(DiscoveryNodeRole::roleName)
|
|
||||||
.collect(Collectors.joining(","));
|
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [" + legacyRoleSetting.getKey() + "] is deprecated in favor of setting [node.roles]",
|
"Setting [" + legacyRoleSetting.getKey() + "] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-node-roles",
|
"https://ela.st/es-deprecation-7-node-roles",
|
||||||
"the setting [" + legacyRoleSetting.getKey() + "] is currently set to ["
|
"Remove the [" + legacyRoleSetting.getKey() + "] setting. Set [node.roles] and include the [" + role + "] role.", false,
|
||||||
+ value + "], instead set [node.roles] to [" + roles + "]", false, null
|
null
|
||||||
);
|
);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{legacyRoleSetting});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,9 +530,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
c -> c.apply(settings, pluginsAndModules, ClusterState.EMPTY_STATE, licenseState));
|
c -> c.apply(settings, pluginsAndModules, ClusterState.EMPTY_STATE, licenseState));
|
||||||
final DeprecationIssue expected = new DeprecationIssue(
|
final DeprecationIssue expected = new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [bootstrap.system_call_filter] is deprecated and will be removed in the next major version",
|
"Setting [bootstrap.system_call_filter] is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-system-call-filter-setting",
|
"https://ela.st/es-deprecation-7-system-call-filter-setting",
|
||||||
"the setting [bootstrap.system_call_filter] is currently set to [" + boostrapSystemCallFilter + "], remove this setting",
|
"Remove the [bootstrap.system_call_filter] setting. System call filters are always required in 8.0.",
|
||||||
false, null);
|
false, null);
|
||||||
assertThat(issues, hasItem(expected));
|
assertThat(issues, hasItem(expected));
|
||||||
assertSettingDeprecationsAndWarnings(new Setting<?>[]{BootstrapSettings.SYSTEM_CALL_FILTER_SETTING});
|
assertSettingDeprecationsAndWarnings(new Setting<?>[]{BootstrapSettings.SYSTEM_CALL_FILTER_SETTING});
|
||||||
|
@ -548,7 +542,7 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final Settings settings = Settings.EMPTY;
|
final Settings settings = Settings.EMPTY;
|
||||||
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");
|
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");
|
||||||
final DeprecationIssue issue =
|
final DeprecationIssue issue =
|
||||||
NodeDeprecationChecks.checkRemovedSetting(settings, removedSetting, "http://removed-setting.example.com");
|
NodeDeprecationChecks.checkRemovedSetting(settings, removedSetting, "http://removed-setting.example.com", "Some detail.");
|
||||||
assertThat(issue, nullValue());
|
assertThat(issue, nullValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,15 +550,15 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final Settings settings = Settings.builder().put("node.removed_setting", "value").build();
|
final Settings settings = Settings.builder().put("node.removed_setting", "value").build();
|
||||||
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");
|
final Setting<?> removedSetting = Setting.simpleString("node.removed_setting");
|
||||||
final DeprecationIssue issue =
|
final DeprecationIssue issue =
|
||||||
NodeDeprecationChecks.checkRemovedSetting(settings, removedSetting, "https://removed-setting.example.com");
|
NodeDeprecationChecks.checkRemovedSetting(settings, removedSetting, "https://removed-setting.example.com", "Some detail.");
|
||||||
assertThat(issue, not(nullValue()));
|
assertThat(issue, not(nullValue()));
|
||||||
assertThat(issue.getLevel(), equalTo(DeprecationIssue.Level.CRITICAL));
|
assertThat(issue.getLevel(), equalTo(DeprecationIssue.Level.CRITICAL));
|
||||||
assertThat(
|
assertThat(
|
||||||
issue.getMessage(),
|
issue.getMessage(),
|
||||||
equalTo("setting [node.removed_setting] is deprecated and will be removed in the next major version"));
|
equalTo("Setting [node.removed_setting] is deprecated"));
|
||||||
assertThat(
|
assertThat(
|
||||||
issue.getDetails(),
|
issue.getDetails(),
|
||||||
equalTo("the setting [node.removed_setting] is currently set to [value], remove this setting"));
|
equalTo("Remove the [node.removed_setting] setting. Some detail."));
|
||||||
assertThat(issue.getUrl(), equalTo("https://removed-setting.example.com"));
|
assertThat(issue.getUrl(), equalTo("https://removed-setting.example.com"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,7 +574,7 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isJvmEarlierThan11()) {
|
if (isJvmEarlierThan11()) {
|
||||||
return issues.stream().filter(i -> i.getMessage().equals("Java 11 is required") == false).collect(Collectors.toList());
|
return issues.stream().filter(i -> i.getMessage().equals(JAVA_DEPRECATION_MESSAGE) == false).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
return issues;
|
return issues;
|
||||||
|
@ -631,10 +625,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
assertThat(issue.getLevel(), equalTo(DeprecationIssue.Level.CRITICAL));
|
assertThat(issue.getLevel(), equalTo(DeprecationIssue.Level.CRITICAL));
|
||||||
assertThat(
|
assertThat(
|
||||||
issue.getMessage(),
|
issue.getMessage(),
|
||||||
equalTo("[path.data] in a list is deprecated, use a string value"));
|
equalTo("Multiple data paths are not supported"));
|
||||||
assertThat(
|
assertThat(
|
||||||
issue.getDetails(),
|
issue.getDetails(),
|
||||||
equalTo("Configuring [path.data] with a list is deprecated. Instead specify as a string value."));
|
equalTo("The [path.data] setting contains a list of paths. Specify a single path as a string. Use RAID or other system level " +
|
||||||
|
"features to utilize multiple disks. If multiple data paths are configured, the node will fail to start in 8.0. "));
|
||||||
String url = "https://ela.st/es-deprecation-7-multiple-paths";
|
String url = "https://ela.st/es-deprecation-7-multiple-paths";
|
||||||
assertThat(issue.getUrl(), equalTo(url));
|
assertThat(issue.getUrl(), equalTo(url));
|
||||||
}
|
}
|
||||||
|
@ -655,9 +650,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final String expectedUrl = "https://ela.st/es-deprecation-7-shared-path-settings";
|
final String expectedUrl = "https://ela.st/es-deprecation-7-shared-path-settings";
|
||||||
assertThat(issue, equalTo(
|
assertThat(issue, equalTo(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [path.shared_data] is deprecated and will be removed in a future version",
|
"Setting [path.shared_data] is deprecated",
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
"Found shared data path configured. Discontinue use of this setting.",
|
"Remove the [path.shared_data] setting. This setting has had no effect since 6.0.",
|
||||||
false, null)));
|
false, null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,11 +667,10 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting";
|
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting";
|
||||||
assertThat(issues, hasItem(
|
assertThat(issues, hasItem(
|
||||||
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"setting [cluster.routing.allocation.disk.watermark.enable_for_single_data_node=false] is deprecated and" +
|
"Setting [cluster.routing.allocation.disk.watermark.enable_for_single_data_node=false] is deprecated",
|
||||||
" will not be available in a future version",
|
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
"found [cluster.routing.allocation.disk.watermark.enable_for_single_data_node] configured to false." +
|
"Remove the [cluster.routing.allocation.disk.watermark.enable_for_single_data_node] setting. Disk watermarks are always " +
|
||||||
" Discontinue use of this setting or set it to true.",
|
"enabled for single node clusters in 8.0.",
|
||||||
false,
|
false,
|
||||||
null
|
null
|
||||||
)));
|
)));
|
||||||
|
@ -700,13 +694,10 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final String expectedUrl =
|
final String expectedUrl =
|
||||||
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting";
|
"https://ela.st/es-deprecation-7-disk-watermark-enable-for-single-node-setting";
|
||||||
DeprecationIssue deprecationIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue deprecationIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"the default value [false] of setting [cluster.routing.allocation.disk.watermark.enable_for_single_data_node]" +
|
"Disabling disk watermarks for single node clusters is deprecated and no longer the default",
|
||||||
" is deprecated and will be changed to true in a future version." +
|
|
||||||
" This cluster has only one data node and behavior will therefore change when upgrading",
|
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
"found [cluster.routing.allocation.disk.watermark.enable_for_single_data_node] defaulting to false" +
|
"Disk watermarks are always enabled in 8.0, which will affect the behavior of this single node cluster when you upgrade. You " +
|
||||||
" on a single data node cluster. Set it to true to avoid this warning." +
|
"can set \"cluster.routing.allocation.disk.threshold_enabled\" to false to disable disk based allocation.", false, null);
|
||||||
" Consider using [cluster.routing.allocation.disk.threshold_enabled] to disable disk based allocation", false, null);
|
|
||||||
|
|
||||||
assertThat(issues, hasItem(deprecationIssue));
|
assertThat(issues, hasItem(deprecationIssue));
|
||||||
|
|
||||||
|
@ -746,13 +737,14 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"non-secure passwords for monitoring exporters [%s] are deprecated and will be removed in the next major version",
|
"Monitoring exporters must use secure passwords",
|
||||||
joinedNames
|
joinedNames
|
||||||
),
|
),
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"replace the non-secure monitoring exporter password setting(s) [%s] with their secure 'auth.secure_password' replacement",
|
"Remove the non-secure monitoring exporter password settings: " +
|
||||||
|
"[%s]. Configure secure passwords with [xpack.monitoring.exporters.*.auth.secure_password].",
|
||||||
joinedNames
|
joinedNames
|
||||||
), false, null)));
|
), false, null)));
|
||||||
|
|
||||||
|
@ -769,11 +761,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
settingKey),
|
settingKey),
|
||||||
"https://ela.st/es-deprecation-7-cluster-join-timeout-setting",
|
"https://ela.st/es-deprecation-7-cluster-join-timeout-setting",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Cluster join attempts never time out in 8.0.",
|
||||||
settingKey,
|
settingKey,
|
||||||
settingValue),
|
settingValue),
|
||||||
false, null
|
false, null
|
||||||
|
@ -832,15 +824,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
|
|
||||||
assertThat(issue, equalTo(new DeprecationIssue(
|
assertThat(issue, equalTo(new DeprecationIssue(
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(
|
"Remotes for cross cluster search must be configured with cluster remote settings",
|
||||||
Locale.ROOT,
|
|
||||||
"search.remote settings [%s] are deprecated and will be removed in the next major version",
|
|
||||||
joinedNames
|
|
||||||
),
|
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"replace search.remote settings [%s] with their secure 'cluster.remote' replacements",
|
"Replace the search.remote settings [%s] with their secure [cluster.remote] equivalents",
|
||||||
joinedNames
|
joinedNames
|
||||||
), false, null)));
|
), false, null)));
|
||||||
|
|
||||||
|
@ -857,13 +845,12 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
settingKey),
|
settingKey),
|
||||||
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
"https://ela.st/es-deprecation-7-cluster-routing-allocation-disk-include-relocations-setting",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%b], remove this setting",
|
"Remove the [%s] setting. Relocating shards are always taken into account in 8.0.",
|
||||||
settingKey,
|
settingKey),
|
||||||
settingValue),
|
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -886,9 +873,9 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
ClusterState.EMPTY_STATE,
|
ClusterState.EMPTY_STATE,
|
||||||
new XPackLicenseState(Settings.EMPTY, () -> 0));
|
new XPackLicenseState(Settings.EMPTY, () -> 0));
|
||||||
assertThat(issue.getLevel(), equalTo(DeprecationIssue.Level.CRITICAL));
|
assertThat(issue.getLevel(), equalTo(DeprecationIssue.Level.CRITICAL));
|
||||||
assertThat(issue.getMessage(), equalTo("Security is enabled by default for all licenses in the next major version."));
|
assertThat(issue.getMessage(), equalTo("Security is enabled by default for all licenses"));
|
||||||
assertNotNull(issue.getDetails());
|
assertNotNull(issue.getDetails());
|
||||||
assertThat(issue.getDetails(), containsString("The default behavior of disabling security on "));
|
assertThat(issue.getDetails(), containsString("Security will no longer be disabled by default"));
|
||||||
assertThat(issue.getUrl(),
|
assertThat(issue.getUrl(),
|
||||||
equalTo("https://ela.st/es-deprecation-7-implicitly-disabled-security"));
|
equalTo("https://ela.st/es-deprecation-7-implicitly-disabled-security"));
|
||||||
}
|
}
|
||||||
|
@ -927,12 +914,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"support for fractional byte size values is deprecated and will be removed in a future release",
|
"Configuring fractional byte sizes is deprecated",
|
||||||
"https://ela.st/es-deprecation-7-fractional-byte-settings",
|
"https://ela.st/es-deprecation-7-fractional-byte-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"change the following settings to non-fractional values: [%s->%s]",
|
"Set the following to whole numbers: [%s].",
|
||||||
settingKey,
|
settingKey),
|
||||||
settingValue),
|
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -954,13 +940,12 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] cannot be greater than zero on non-frozen nodes",
|
"Only frozen nodes can have a [%s] greater than zero.",
|
||||||
cacheSizeSettingKey),
|
cacheSizeSettingKey),
|
||||||
"https://ela.st/es-deprecation-7-searchable-snapshot-shared-cache-setting",
|
"https://ela.st/es-deprecation-7-searchable-snapshot-shared-cache-setting",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] cannot be greater than zero on non-frozen nodes, and is currently set to [%s]",
|
"Set [%s] to zero on any node that doesn't have the [data_frozen] role.",
|
||||||
cacheSizeSettingKey,
|
cacheSizeSettingKey),
|
||||||
cacheSizeSettingValue),
|
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1022,23 +1007,27 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue1 = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue1 = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"cannot set ssl properties without explicitly enabling or disabling ssl",
|
"Must explicitly enable or disable SSL to configure SSL settings",
|
||||||
"https://ela.st/es-deprecation-7-explicit-ssl-required",
|
"https://ela.st/es-deprecation-7-explicit-ssl-required",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is unset but the following settings exist: [%s,%s]",
|
"The [%s] setting is not configured, but the following SSL settings are: [%s,%s]. To configure SSL, set [%s] or the node " +
|
||||||
|
"will fail to start in 8.0.",
|
||||||
httpSslEnabledKey,
|
httpSslEnabledKey,
|
||||||
problemSettingKey1,
|
problemSettingKey1,
|
||||||
problemSettingKey2),
|
problemSettingKey2,
|
||||||
|
httpSslEnabledKey),
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
final DeprecationIssue expectedIssue2 = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue2 = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"cannot set ssl properties without explicitly enabling or disabling ssl",
|
"Must explicitly enable or disable SSL to configure SSL settings",
|
||||||
"https://ela.st/es-deprecation-7-explicit-ssl-required",
|
"https://ela.st/es-deprecation-7-explicit-ssl-required",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is unset but the following settings exist: [%s,%s]",
|
"The [%s] setting is not configured, but the following SSL settings are: [%s,%s]. To configure SSL, set [%s] or the node " +
|
||||||
|
"will fail to start in 8.0.",
|
||||||
httpSslEnabledKey,
|
httpSslEnabledKey,
|
||||||
problemSettingKey2,
|
problemSettingKey2,
|
||||||
problemSettingKey1),
|
problemSettingKey1,
|
||||||
|
httpSslEnabledKey),
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1056,12 +1045,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"if ssl is enabled either keystore must be set, or key path and certificate path must be set",
|
"Must either configure a keystore or set the key path and certificate path when SSL is enabled",
|
||||||
"https://ela.st/es-deprecation-7-ssl-settings",
|
"https://ela.st/es-deprecation-7-ssl-settings",
|
||||||
"none of [xpack.security.transport.ssl.keystore.path], [xpack.security.transport.ssl.key], or [xpack.security.transport" +
|
"None of [xpack.security.transport.ssl.keystore.path], [xpack.security.transport.ssl.key], or [xpack.security.transport.ssl" +
|
||||||
".ssl.certificate] are set. If [xpack.security.transport.ssl.enabled] is true either [xpack.security.transport.ssl" +
|
".certificate] are set. If [xpack.security.transport.ssl.enabled] is true either use a keystore, or configure" +
|
||||||
".keystore.path] must be set, or [xpack.security.transport.ssl.key] and [xpack.security.transport.ssl.certificate] " +
|
" [xpack.security.transport.ssl.key] and [xpack.security.transport.ssl.certificate].",
|
||||||
"must be set",
|
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1098,11 +1086,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.put("xpack.security.transport.ssl.certificate", randomAlphaOfLength(10))
|
.put("xpack.security.transport.ssl.certificate", randomAlphaOfLength(10))
|
||||||
.build();
|
.build();
|
||||||
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"if ssl is enabled either keystore must be set, or key path and certificate path must be set",
|
"Must either configure a keystore or set the key path and certificate path when SSL is enabled",
|
||||||
"https://ela.st/es-deprecation-7-ssl-settings",
|
"https://ela.st/es-deprecation-7-ssl-settings",
|
||||||
"all of [xpack.security.transport.ssl.keystore.path], [xpack.security.transport.ssl.key], and [xpack.security.transport.ssl" +
|
"All of [xpack.security.transport.ssl.keystore.path], [xpack.security.transport.ssl.key], and [xpack.security.transport.ssl" +
|
||||||
".certificate] are set. Either [xpack.security.transport.ssl.keystore.path] must be set, or [xpack.security.transport.ssl" +
|
".certificate] are set. Either use a keystore, or configure [xpack.security.transport.ssl.key] and " +
|
||||||
".key] and [xpack.security.transport.ssl.certificate] must be set",
|
"[xpack.security.transport.ssl.certificate].",
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1117,11 +1105,10 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.put("xpack.security.transport.ssl.key", randomAlphaOfLength(10))
|
.put("xpack.security.transport.ssl.key", randomAlphaOfLength(10))
|
||||||
.build();
|
.build();
|
||||||
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"if ssl is enabled either keystore must be set, or key path and certificate path must be set",
|
"Must either configure a keystore or set the key path and certificate path when SSL is enabled",
|
||||||
"https://ela.st/es-deprecation-7-ssl-settings",
|
"https://ela.st/es-deprecation-7-ssl-settings",
|
||||||
"[xpack.security.transport.ssl.keystore.path] and [xpack.security.transport.ssl.key] are set. Either [xpack.security" +
|
"Do not configure both [xpack.security.transport.ssl.keystore.path] and [xpack.security.transport.ssl.key]. Either use a " +
|
||||||
".transport.ssl.keystore.path] must be set, or [xpack.security.transport.ssl.key] and [xpack.security.transport.ssl" +
|
"keystore, or configure [xpack.security.transport.ssl.key] and [xpack.security.transport.ssl.certificate].",
|
||||||
".certificate] must be set",
|
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1134,11 +1121,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.put("xpack.security.http.ssl.enabled", "true")
|
.put("xpack.security.http.ssl.enabled", "true")
|
||||||
.build();
|
.build();
|
||||||
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"if ssl is enabled either keystore must be set, or key path and certificate path must be set",
|
"Must either configure a keystore or set the key path and certificate path when SSL is enabled",
|
||||||
"https://ela.st/es-deprecation-7-ssl-settings",
|
"https://ela.st/es-deprecation-7-ssl-settings",
|
||||||
"none of [xpack.security.http.ssl.keystore.path], [xpack.security.http.ssl.key], or [xpack.security.http.ssl.certificate] are" +
|
"None of [xpack.security.http.ssl.keystore.path], [xpack.security.http.ssl.key], or [xpack.security.http.ssl.certificate] are" +
|
||||||
" set. If [xpack.security.http.ssl.enabled] is true either [xpack.security.http.ssl.keystore.path] must be set, or [xpack" +
|
" set. If [xpack.security.http.ssl.enabled] is true either use a keystore, or configure [xpack.security.http.ssl.key]" +
|
||||||
".security.http.ssl.key] and [xpack.security.http.ssl.certificate] must be set",
|
" and [xpack.security.http.ssl.certificate].",
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1163,7 +1150,8 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
new XPackLicenseState(Settings.EMPTY, () -> 0),
|
new XPackLicenseState(Settings.EMPTY, () -> 0),
|
||||||
() -> randomAlphaOfLengthBetween(1, 10));
|
() -> randomAlphaOfLengthBetween(1, 10));
|
||||||
assertNotNull(issue.getDetails());
|
assertNotNull(issue.getDetails());
|
||||||
assertThat(issue.getDetails(), containsString("system property must be removed"));
|
assertEquals(issue.getDetails(), "Remove the [es.unsafely_permit_handshake_from_incompatible_builds] system property. Handshakes " +
|
||||||
|
"from incompatible builds are not allowed in 8.0.");
|
||||||
assertThat(issue.getUrl(),
|
assertThat(issue.getUrl(),
|
||||||
equalTo("https://ela.st/es-deprecation-7-permit-handshake-from-incompatible-builds-setting"));
|
equalTo("https://ela.st/es-deprecation-7-permit-handshake-from-incompatible-builds-setting"));
|
||||||
}
|
}
|
||||||
|
@ -1190,15 +1178,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
DeprecationIssue.Level.CRITICAL,
|
DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(
|
String.format(
|
||||||
Locale.ROOT,
|
Locale.ROOT,
|
||||||
"settings [%s] are deprecated and will be removed in the next major version",
|
"Settings [%s] for the Transport client are deprecated",
|
||||||
joinedNames
|
joinedNames
|
||||||
),
|
),
|
||||||
expectedUrl,
|
expectedUrl,
|
||||||
String.format(
|
"Remove all [transport.profiles] settings. The Transport client no longer exists in 8.0.", false, null)));
|
||||||
Locale.ROOT,
|
|
||||||
"transport client will be removed in the next major version so transport client related settings [%s] must be removed",
|
|
||||||
joinedNames
|
|
||||||
), false, null)));
|
|
||||||
|
|
||||||
// test for absence of deprecated exporter passwords
|
// test for absence of deprecated exporter passwords
|
||||||
issue = NodeDeprecationChecks.checkTransportClientProfilesFilterSetting(Settings.builder().build(), null, null, licenseState);
|
issue = NodeDeprecationChecks.checkTransportClientProfilesFilterSetting(Settings.builder().build(), null, null, licenseState);
|
||||||
|
@ -1214,11 +1198,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.build();
|
.build();
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"cannot use properties related to delaying cluster state recovery after a majority of master nodes have joined because they " +
|
"Delaying cluster state recovery based on the number of available master nodes is not supported",
|
||||||
"have been deprecated and will be removed in the next major version",
|
|
||||||
"https://ela.st/es-deprecation-7-deferred-cluster-state-recovery",
|
"https://ela.st/es-deprecation-7-deferred-cluster-state-recovery",
|
||||||
"cannot use properties [gateway.expected_nodes,gateway.expected_master_nodes,gateway.recover_after_nodes,gateway" +
|
"Use gateway.expected_data_nodes to wait for a certain number of data nodes. Remove the following settings or the node will " +
|
||||||
".recover_after_master_nodes] because they have been deprecated and will be removed in the next major version",
|
"fail to start in 8.0: " +
|
||||||
|
"[gateway.expected_nodes,gateway.expected_master_nodes,gateway.recover_after_nodes,gateway.recover_after_master_nodes]",
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
final XPackLicenseState licenseState = mock(XPackLicenseState.class);
|
final XPackLicenseState licenseState = mock(XPackLicenseState.class);
|
||||||
|
@ -1244,17 +1228,13 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.build();
|
.build();
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
"cannot use properties [thread_pool.search.min_queue_size,thread_pool.search.max_queue_size,thread_pool.search" +
|
"The fixed_auto_queue_size threadpool type is not supported",
|
||||||
".auto_queue_frame_size,thread_pool.search.target_response_time,thread_pool.search_throttled.min_queue_size," +
|
|
||||||
"thread_pool.search_throttled.max_queue_size,thread_pool.search_throttled.auto_queue_frame_size,thread_pool" +
|
|
||||||
".search_throttled.target_response_time] because fixed_auto_queue_size threadpool type has been deprecated" +
|
|
||||||
" and will be removed in the next major version",
|
|
||||||
"https://ela.st/es-deprecation-7-fixed-auto-queue-size-settings",
|
"https://ela.st/es-deprecation-7-fixed-auto-queue-size-settings",
|
||||||
"cannot use properties [thread_pool.search.min_queue_size,thread_pool.search.max_queue_size,thread_pool.search" +
|
"Remove the following settings or the node will fail to start in 8.0: " +
|
||||||
".auto_queue_frame_size,thread_pool.search.target_response_time,thread_pool.search_throttled.min_queue_size," +
|
"[thread_pool.search.min_queue_size,thread_pool.search.max_queue_size," +
|
||||||
"thread_pool.search_throttled.max_queue_size,thread_pool.search_throttled.auto_queue_frame_size,thread_pool" +
|
"thread_pool.search.auto_queue_frame_size,thread_pool.search.target_response_time," +
|
||||||
".search_throttled.target_response_time] because fixed_auto_queue_size threadpool type has been deprecated" +
|
"thread_pool.search_throttled.min_queue_size,thread_pool.search_throttled.max_queue_size," +
|
||||||
" and will be removed in the next major version",
|
"thread_pool.search_throttled.auto_queue_frame_size,thread_pool.search_throttled.target_response_time].",
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
final XPackLicenseState licenseState = mock(XPackLicenseState.class);
|
final XPackLicenseState licenseState = mock(XPackLicenseState.class);
|
||||||
|
@ -1276,35 +1256,32 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.build();
|
.build();
|
||||||
final DeprecationIssue expectedRequireIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedRequireIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
INDEX_ROUTING_REQUIRE_SETTING.getKey()),
|
INDEX_ROUTING_REQUIRE_SETTING.getKey()),
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
INDEX_ROUTING_REQUIRE_SETTING.getKey(),
|
INDEX_ROUTING_REQUIRE_SETTING.getKey()),
|
||||||
settingValue),
|
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
final DeprecationIssue expectedIncludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIncludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
INDEX_ROUTING_INCLUDE_SETTING.getKey()),
|
INDEX_ROUTING_INCLUDE_SETTING.getKey()),
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
INDEX_ROUTING_INCLUDE_SETTING.getKey(),
|
INDEX_ROUTING_INCLUDE_SETTING.getKey()),
|
||||||
settingValue),
|
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
final DeprecationIssue expectedExcludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedExcludeIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
INDEX_ROUTING_EXCLUDE_SETTING.getKey()),
|
INDEX_ROUTING_EXCLUDE_SETTING.getKey()),
|
||||||
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
"https://ela.st/es-deprecation-7-tier-filtering-settings",
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. Use [index.routing.allocation.include._tier_preference] to control allocation to data tiers.",
|
||||||
INDEX_ROUTING_EXCLUDE_SETTING.getKey(),
|
INDEX_ROUTING_EXCLUDE_SETTING.getKey()),
|
||||||
settingValue),
|
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1334,20 +1311,20 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkSimpleSetting(String settingKey, String settingValue, String url, DeprecationChecks.NodeDeprecationCheck<Settings,
|
private void checkSimpleSetting(String settingKey, String settingValue, String url, DeprecationChecks.NodeDeprecationCheck<Settings,
|
||||||
PluginsAndModules, ClusterState, XPackLicenseState, DeprecationIssue> checkFunction) {
|
PluginsAndModules, ClusterState, XPackLicenseState, DeprecationIssue> checkFunction, String additionalDetail) {
|
||||||
final Settings nodeSettings =
|
final Settings nodeSettings =
|
||||||
Settings.builder().put(settingKey, settingValue).build();
|
Settings.builder().put(settingKey, settingValue).build();
|
||||||
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
final XPackLicenseState licenseState = new XPackLicenseState(Settings.EMPTY, () -> 0);
|
||||||
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
final ClusterState clusterState = ClusterState.EMPTY_STATE;
|
||||||
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
final DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.CRITICAL,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"setting [%s] is deprecated and will be removed in the next major version",
|
"Setting [%s] is deprecated",
|
||||||
settingKey),
|
settingKey),
|
||||||
url,
|
url,
|
||||||
String.format(Locale.ROOT,
|
String.format(Locale.ROOT,
|
||||||
"the setting [%s] is currently set to [%s], remove this setting",
|
"Remove the [%s] setting. %s",
|
||||||
settingKey,
|
settingKey,
|
||||||
settingValue),
|
additionalDetail),
|
||||||
false,null
|
false,null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1368,28 +1345,32 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
String settingKey = "xpack.security.authc.accept_default_password";
|
String settingKey = "xpack.security.authc.accept_default_password";
|
||||||
String settingValue = String.valueOf(randomBoolean());
|
String settingValue = String.valueOf(randomBoolean());
|
||||||
String url = "https://ela.st/es-deprecation-7-accept-default-password-setting";
|
String url = "https://ela.st/es-deprecation-7-accept-default-password-setting";
|
||||||
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkAcceptDefaultPasswordSetting);
|
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkAcceptDefaultPasswordSetting,
|
||||||
|
"This setting has not had any effect since 6.0.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCheckAcceptRolesCacheMaxSizeSetting() {
|
public void testCheckAcceptRolesCacheMaxSizeSetting() {
|
||||||
String settingKey = "xpack.security.authz.store.roles.index.cache.max_size";
|
String settingKey = "xpack.security.authz.store.roles.index.cache.max_size";
|
||||||
String settingValue = String.valueOf(randomIntBetween(1, 10000));
|
String settingValue = String.valueOf(randomIntBetween(1, 10000));
|
||||||
String url = "https://ela.st/es-deprecation-7-roles-index-cache-settings";
|
String url = "https://ela.st/es-deprecation-7-roles-index-cache-settings";
|
||||||
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkAcceptRolesCacheMaxSizeSetting);
|
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkAcceptRolesCacheMaxSizeSetting,
|
||||||
|
"Native role cache settings have had no effect since 5.2.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCheckRolesCacheTTLSizeSetting() {
|
public void testCheckRolesCacheTTLSizeSetting() {
|
||||||
String settingKey = "xpack.security.authz.store.roles.index.cache.ttl";
|
String settingKey = "xpack.security.authz.store.roles.index.cache.ttl";
|
||||||
String settingValue = randomPositiveTimeValue();
|
String settingValue = randomPositiveTimeValue();
|
||||||
String url = "https://ela.st/es-deprecation-7-roles-index-cache-settings";
|
String url = "https://ela.st/es-deprecation-7-roles-index-cache-settings";
|
||||||
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkRolesCacheTTLSizeSetting);
|
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkRolesCacheTTLSizeSetting,
|
||||||
|
"Native role cache settings have had no effect since 5.2.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCheckMaxLocalStorageNodesSetting() {
|
public void testCheckMaxLocalStorageNodesSetting() {
|
||||||
String settingKey = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey();
|
String settingKey = NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey();
|
||||||
String settingValue = Integer.toString(randomIntBetween(1, 100));
|
String settingValue = Integer.toString(randomIntBetween(1, 100));
|
||||||
String url = "https://ela.st/es-deprecation-7-node-local-storage-setting";
|
String url = "https://ela.st/es-deprecation-7-node-local-storage-setting";
|
||||||
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkMaxLocalStorageNodesSetting);
|
checkSimpleSetting(settingKey, settingValue, url, NodeDeprecationChecks::checkMaxLocalStorageNodesSetting,
|
||||||
|
"All nodes require local storage in 8.0 and cannot share data paths.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCheckSamlNameIdFormatSetting() {
|
public void testCheckSamlNameIdFormatSetting() {
|
||||||
|
@ -1411,10 +1392,10 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.put("xpack.security.authc.realms.saml.saml1.attributes.principal", randomIntBetween(30, 100))
|
.put("xpack.security.authc.realms.saml.saml1.attributes.principal", randomIntBetween(30, 100))
|
||||||
.build();
|
.build();
|
||||||
DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
DeprecationIssue expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"if nameid_format is not explicitly set, the previous default of 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' is no " +
|
"The SAML nameid_format is not set and no longer defaults to \"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"",
|
||||||
"longer used",
|
|
||||||
"https://ela.st/es-deprecation-7-saml-nameid-format",
|
"https://ela.st/es-deprecation-7-saml-nameid-format",
|
||||||
"no value for [xpack.security.authc.realms.saml.saml1.nameid_format] set in realm [xpack.security.authc.realms.saml.saml1]",
|
"Configure \"xpack.security.authc.realms.saml.saml1.nameid_format\" for SAML realms: " +
|
||||||
|
"\"xpack.security.authc.realms.saml.saml1\".",
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1428,10 +1409,10 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.put("xpack.security.authc.realms.saml.saml2.nameid_format", randomIntBetween(1, 25))
|
.put("xpack.security.authc.realms.saml.saml2.nameid_format", randomIntBetween(1, 25))
|
||||||
.build();
|
.build();
|
||||||
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"if nameid_format is not explicitly set, the previous default of 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' is no " +
|
"The SAML nameid_format is not set and no longer defaults to \"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"",
|
||||||
"longer used",
|
|
||||||
"https://ela.st/es-deprecation-7-saml-nameid-format",
|
"https://ela.st/es-deprecation-7-saml-nameid-format",
|
||||||
"no value for [xpack.security.authc.realms.saml.saml1.nameid_format] set in realm [xpack.security.authc.realms.saml.saml1]",
|
"Configure \"xpack.security.authc.realms.saml.saml1.nameid_format\" for SAML realms: " +
|
||||||
|
"\"xpack.security.authc.realms.saml.saml1\".",
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
@ -1444,11 +1425,11 @@ public class NodeDeprecationChecksTests extends ESTestCase {
|
||||||
.put("xpack.security.authc.realms.saml.saml2.attributes.principal", randomIntBetween(30, 100))
|
.put("xpack.security.authc.realms.saml.saml2.attributes.principal", randomIntBetween(30, 100))
|
||||||
.build();
|
.build();
|
||||||
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
expectedIssue = new DeprecationIssue(DeprecationIssue.Level.WARNING,
|
||||||
"if nameid_format is not explicitly set, the previous default of 'urn:oasis:names:tc:SAML:2.0:nameid-format:transient' is no " +
|
"The SAML nameid_format is not set and no longer defaults to \"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\"",
|
||||||
"longer used",
|
|
||||||
"https://ela.st/es-deprecation-7-saml-nameid-format",
|
"https://ela.st/es-deprecation-7-saml-nameid-format",
|
||||||
"no value for [xpack.security.authc.realms.saml.saml1.nameid_format] set in realm [xpack.security.authc.realms.saml.saml1]," +
|
"Configure \"xpack.security.authc.realms.saml.saml1.nameid_format\" for SAML realms: " +
|
||||||
"no value for [xpack.security.authc.realms.saml.saml2.nameid_format] set in realm [xpack.security.authc.realms.saml.saml2]",
|
"\"xpack.security.authc.realms.saml.saml1\". Configure \"xpack.security.authc.realms.saml.saml2.nameid_format\" for SAML " +
|
||||||
|
"realms: \"xpack.security.authc.realms.saml.saml2\".",
|
||||||
false, null
|
false, null
|
||||||
);
|
);
|
||||||
assertThat(
|
assertThat(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue