diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java index 8bba5325cec8d..bdccf4ed389e8 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java @@ -9,6 +9,7 @@ package org.elasticsearch.upgrades; import org.elasticsearch.Version; +import org.elasticsearch.action.admin.cluster.migration.TransportGetFeatureUpgradeStatusAction; import org.elasticsearch.client.Request; import org.elasticsearch.client.ResponseException; import org.elasticsearch.test.XContentTestUtils; @@ -31,12 +32,15 @@ public void testGetFeatureUpgradeStatus() throws Exception { // setup - put something in the tasks index // create index Request createTestIndex = new Request("PUT", "/feature_test_index_old"); - createTestIndex.setJsonEntity("{\"settings\": {\"index.number_of_replicas\": 0}}"); + createTestIndex.setJsonEntity("{\"settings\": {" + + "\"index.number_of_replicas\": 0," + + "\"index.number_of_shards\": 1" + + "}}"); client().performRequest(createTestIndex); Request bulk = new Request("POST", "/_bulk"); bulk.addParameter("refresh", "true"); - bulk.setJsonEntity("{\"index\": {\"_index\": \"feature_test_index_old\"}}\n" + + bulk.setJsonEntity("{\"index\": {\"_index\": \"feature_test_index_old\", \"_type\": \"_doc\"}}\n" + "{\"f1\": \"v1\", \"f2\": \"v2\"}\n"); client().performRequest(bulk); @@ -67,6 +71,7 @@ public void testGetFeatureUpgradeStatus() throws Exception { v.compatible(systemIndexWarning); })); getTasksIndex.addParameter("allow_no_indices", "false"); + getTasksIndex.addParameter("include_type_name", "false"); assertBusy(() -> { try { @@ -91,7 +96,7 @@ public void testGetFeatureUpgradeStatus() throws Exception { assertThat(feature.size(), equalTo(4)); assertThat(feature.get("minimum_index_version"), equalTo(UPGRADE_FROM_VERSION.toString())); - if (UPGRADE_FROM_VERSION.before(Version.CURRENT.minimumIndexCompatibilityVersion())) { + if (UPGRADE_FROM_VERSION.before(TransportGetFeatureUpgradeStatusAction.NO_UPGRADE_REQUIRED_VERSION)) { assertThat(feature.get("upgrade_status"), equalTo("UPGRADE_NEEDED")); } else { assertThat(feature.get("upgrade_status"), equalTo("NO_UPGRADE_NEEDED")); diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java index 8ed487f443d13..50c38ca10d284 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java @@ -38,6 +38,8 @@ public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeA GetFeatureUpgradeStatusRequest, GetFeatureUpgradeStatusResponse> { + public static final Version NO_UPGRADE_REQUIRED_VERSION = Version.V_7_0_0; + private final SystemIndices systemIndices; @Inject