diff --git a/src/main/java/org/elasticsearch/rest/action/admin/indices/upgrade/RestUpgradeAction.java b/src/main/java/org/elasticsearch/rest/action/admin/indices/upgrade/RestUpgradeAction.java index 99f54868aa8..e4aa3e93184 100644 --- a/src/main/java/org/elasticsearch/rest/action/admin/indices/upgrade/RestUpgradeAction.java +++ b/src/main/java/org/elasticsearch/rest/action/admin/indices/upgrade/RestUpgradeAction.java @@ -112,7 +112,8 @@ public class RestUpgradeAction extends BaseRestHandler { for (ShardSegments segs : shard.getShards()) { for (Segment seg : segs.getSegments()) { total_bytes += seg.sizeInBytes; - if (seg.version.minor != Version.CURRENT.luceneVersion.minor) { + if (seg.version.major != Version.CURRENT.luceneVersion.major || + seg.version.minor != Version.CURRENT.luceneVersion.minor) { // TODO: this comparison is bogus! it would cause us to upgrade even with the same format // instead, we should check if the codec has changed to_upgrade_bytes += seg.sizeInBytes; diff --git a/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityTests.java b/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityTests.java index ca9c5edcb5a..a79aa3ac9ec 100644 --- a/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityTests.java +++ b/src/test/java/org/elasticsearch/bwcompat/OldIndexBackwardsCompatibilityTests.java @@ -33,24 +33,17 @@ import org.elasticsearch.search.sort.SortOrder; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.elasticsearch.test.rest.client.http.HttpRequestBuilder; import org.hamcrest.Matchers; -import org.junit.Ignore; import java.lang.reflect.Modifier; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; -@Ignore(value="index-0.90.0.Beta1.zip fails the test") public class OldIndexBackwardsCompatibilityTests extends StaticIndexBackwardCompatibilityTest { // TODO: test for proper exception on unsupported indexes (maybe via separate test?) // We have a 0.20.6.zip etc for this.