diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java index 81d052ee16a..05e4be37edc 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/migration/DeprecationInfoResponse.java @@ -141,8 +141,6 @@ public class DeprecationInfoResponse { } public enum Level { - NONE, - INFO, WARNING, CRITICAL ; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java index b5b8512114d..054b800d648 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/migration/DeprecationInfoResponseTests.java @@ -30,6 +30,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.elasticsearch.client.migration.DeprecationInfoResponse.DeprecationIssue.Level.CRITICAL; +import static org.elasticsearch.client.migration.DeprecationInfoResponse.DeprecationIssue.Level.WARNING; import static org.elasticsearch.test.AbstractXContentTestCase.xContentTester; public class DeprecationInfoResponseTests extends ESTestCase { @@ -94,7 +96,7 @@ public class DeprecationInfoResponseTests extends ESTestCase { // of elements for this list. int startingRandomNumber = canBeEmpty ? 0: 1; for (int i =0; i < randomIntBetween(startingRandomNumber, 2); i++) { - list.add(new DeprecationInfoResponse.DeprecationIssue(DeprecationInfoResponse.DeprecationIssue.Level.INFO, + list.add(new DeprecationInfoResponse.DeprecationIssue(randomFrom(WARNING, CRITICAL), randomAlphaOfLength(5), randomAlphaOfLength(5), randomBoolean() ? randomAlphaOfLength(5) : null)); diff --git a/docs/reference/migration/apis/deprecation.asciidoc b/docs/reference/migration/apis/deprecation.asciidoc index 03ce69ff219..5ff828bfa0c 100644 --- a/docs/reference/migration/apis/deprecation.asciidoc +++ b/docs/reference/migration/apis/deprecation.asciidoc @@ -49,20 +49,20 @@ Example response: { "cluster_settings" : [ { - "level" : "info", - "message" : "Network settings changes", - "url" : "{ref-60}/breaking_60_indices_changes.html#_index_templates_use_literal_index_patterns_literal_instead_of_literal_template_literal", - "details" : "templates using `template` field: watches,.monitoring-alerts,.watch-history-6,.ml-notifications,security-index-template,triggered_watches,.monitoring-es,.ml-meta,.ml-state,.monitoring-logstash,.ml-anomalies-,.monitoring-kibana" + "level" : "critical", + "message" : "Cluster name cannot contain ':'", + "url" : "{ref}/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_cluster_name", + "details" : "This cluster is named [mycompany:logging], which contains the illegal character ':'." } ], "node_settings" : [ ], "index_settings" : { - ".monitoring-es-6-2017.07.21" : [ + "logs:apache" : [ { - "level" : "info", - "message" : "Coercion of boolean fields", - "url" : "{ref-60}/breaking_60_mappings_changes.html#_coercion_of_boolean_fields", - "details" : "[[type: doc, field: spins], [type: doc, field: mlockall], [type: doc, field: node_master], [type: doc, field: primary]]" + "level" : "warning", + "message" : "Index name cannot contain ':'", + "url" : "{ref}/breaking-changes-7.0.html#_literal_literal_is_no_longer_allowed_in_index_name", + "details" : "This index is named [logs:apache], which contains the illegal character ':'." } ] } @@ -79,7 +79,7 @@ The following is an example deprecation warning: ["source","js",subs="attributes,callouts,macros"] -------------------------------------------------- { - "level" : "info", + "level" : "warning", "message" : "This is the generic descriptive message of the breaking change", "url" : "{ref-60}/breaking_60_indices_changes.html", "details" : "more information, like which nodes, indices, or settings are to blame" @@ -91,10 +91,8 @@ As is shown, there is a `level` property that describes the significance of the issue. |======= -|none | Everything is good. -|info | An advisory note that something has changed. No action needed. |warning | You can upgrade directly, but you are using deprecated functionality -which will not be available in the next major version. +which will not be available or behave differently in the next major version. |critical | You cannot upgrade without fixing this problem. |======= diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java index ff1b0d303d0..85a7edd1093 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/deprecation/DeprecationIssue.java @@ -23,9 +23,14 @@ import java.util.Objects; public class DeprecationIssue implements Writeable, ToXContentObject { public enum Level implements Writeable { - NONE, - INFO, + /** + * Resolving this issue is advised but not required to upgrade. There may be undesired changes in behavior unless this issue is + * resolved before upgrading. + */ WARNING, + /** + * This issue must be resolved to upgrade. Failures will occur unless this is resolved before upgrading. + */ CRITICAL ; diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java index b03b79dae2f..2589cb80cb5 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java @@ -38,7 +38,6 @@ public class DeprecationChecks { static List> INDEX_SETTINGS_CHECKS = Collections.unmodifiableList(Arrays.asList( IndexDeprecationChecks::baseSimilarityDefinedCheck, - IndexDeprecationChecks::coercionCheck, IndexDeprecationChecks::dynamicTemplateWithMatchMappingTypeCheck, IndexDeprecationChecks::indexSharedFileSystemCheck, IndexDeprecationChecks::indexStoreTypeCheck, diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java index 273fe1dec9d..fcc6532fc99 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecks.java @@ -79,23 +79,6 @@ public class IndexDeprecationChecks { return issues; } - static DeprecationIssue coercionCheck(IndexMetaData indexMetaData) { - if (indexMetaData.getCreationVersion().before(Version.V_6_0_0_alpha1)) { - List issues = new ArrayList<>(); - fieldLevelMappingIssue(indexMetaData, (mappingMetaData, sourceAsMap) -> { - issues.addAll(findInPropertiesRecursively(mappingMetaData.type(), sourceAsMap, - property -> "boolean".equals(property.get("type")))); - }); - if (issues.size() > 0) { - return new DeprecationIssue(DeprecationIssue.Level.INFO, "Coercion of boolean fields", - "https://www.elastic.co/guide/en/elasticsearch/reference/master/" + - "breaking_60_mappings_changes.html#_coercion_of_boolean_fields", - issues.toString()); - } - } - return null; - } - static DeprecationIssue dynamicTemplateWithMatchMappingTypeCheck(IndexMetaData indexMetaData) { if (indexMetaData.getCreationVersion().before(Version.V_6_0_0_alpha1)) { List issues = new ArrayList<>();