Skip to content

Commit 3b43555

Browse files
Fix bwc tests for 7.x
1 parent ccfec46 commit 3b43555

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/FeatureUpgradeIT.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
package org.elasticsearch.upgrades;
1010

1111
import org.elasticsearch.Version;
12+
import org.elasticsearch.action.admin.cluster.migration.TransportGetFeatureUpgradeStatusAction;
1213
import org.elasticsearch.client.Request;
1314
import org.elasticsearch.client.ResponseException;
1415
import org.elasticsearch.test.XContentTestUtils;
@@ -31,12 +32,15 @@ public void testGetFeatureUpgradeStatus() throws Exception {
3132
// setup - put something in the tasks index
3233
// create index
3334
Request createTestIndex = new Request("PUT", "/feature_test_index_old");
34-
createTestIndex.setJsonEntity("{\"settings\": {\"index.number_of_replicas\": 0}}");
35+
createTestIndex.setJsonEntity("{\"settings\": {" +
36+
"\"index.number_of_replicas\": 0," +
37+
"\"index.number_of_shards\": 1" +
38+
"}}");
3539
client().performRequest(createTestIndex);
3640

3741
Request bulk = new Request("POST", "/_bulk");
3842
bulk.addParameter("refresh", "true");
39-
bulk.setJsonEntity("{\"index\": {\"_index\": \"feature_test_index_old\"}}\n" +
43+
bulk.setJsonEntity("{\"index\": {\"_index\": \"feature_test_index_old\", \"_type\": \"_doc\"}}\n" +
4044
"{\"f1\": \"v1\", \"f2\": \"v2\"}\n");
4145
client().performRequest(bulk);
4246

@@ -67,6 +71,7 @@ public void testGetFeatureUpgradeStatus() throws Exception {
6771
v.compatible(systemIndexWarning);
6872
}));
6973
getTasksIndex.addParameter("allow_no_indices", "false");
74+
getTasksIndex.addParameter("include_type_name", "false");
7075

7176
assertBusy(() -> {
7277
try {
@@ -91,7 +96,7 @@ public void testGetFeatureUpgradeStatus() throws Exception {
9196

9297
assertThat(feature.size(), equalTo(4));
9398
assertThat(feature.get("minimum_index_version"), equalTo(UPGRADE_FROM_VERSION.toString()));
94-
if (UPGRADE_FROM_VERSION.before(Version.CURRENT.minimumIndexCompatibilityVersion())) {
99+
if (UPGRADE_FROM_VERSION.before(TransportGetFeatureUpgradeStatusAction.NO_UPGRADE_REQUIRED_VERSION)) {
95100
assertThat(feature.get("upgrade_status"), equalTo("UPGRADE_NEEDED"));
96101
} else {
97102
assertThat(feature.get("upgrade_status"), equalTo("NO_UPGRADE_NEEDED"));

server/src/main/java/org/elasticsearch/action/admin/cluster/migration/TransportGetFeatureUpgradeStatusAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class TransportGetFeatureUpgradeStatusAction extends TransportMasterNodeA
3838
GetFeatureUpgradeStatusRequest,
3939
GetFeatureUpgradeStatusResponse> {
4040

41+
public static final Version NO_UPGRADE_REQUIRED_VERSION = Version.V_7_0_0;
42+
4143
private final SystemIndices systemIndices;
4244

4345
@Inject

0 commit comments

Comments
 (0)