Add 6.6.0 version to master (#34847)

This commit adds the 6.6.0 version constant to the master branch, and
adapts the VersionTests.
This commit is contained in:
Tanguy Leroux 2018-10-25 17:30:25 +02:00 committed by GitHub
parent d824cbe992
commit 3225b2dcd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 15 deletions

View File

@ -107,6 +107,8 @@ public class Version implements Comparable<Version>, ToXContentFragment {
public static final Version V_6_4_3 = new Version(V_6_4_3_ID, org.apache.lucene.util.Version.LUCENE_7_4_0); public static final Version V_6_4_3 = new Version(V_6_4_3_ID, org.apache.lucene.util.Version.LUCENE_7_4_0);
public static final int V_6_5_0_ID = 6050099; public static final int V_6_5_0_ID = 6050099;
public static final Version V_6_5_0 = new Version(V_6_5_0_ID, org.apache.lucene.util.Version.LUCENE_7_5_0); public static final Version V_6_5_0 = new Version(V_6_5_0_ID, org.apache.lucene.util.Version.LUCENE_7_5_0);
public static final int V_6_6_0_ID = 6060099;
public static final Version V_6_6_0 = new Version(V_6_6_0_ID, org.apache.lucene.util.Version.LUCENE_7_5_0);
public static final int V_7_0_0_alpha1_ID = 7000001; public static final int V_7_0_0_alpha1_ID = 7000001;
public static final Version V_7_0_0_alpha1 = public static final Version V_7_0_0_alpha1 =
new Version(V_7_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_8_0_0); new Version(V_7_0_0_alpha1_ID, org.apache.lucene.util.Version.LUCENE_8_0_0);
@ -125,6 +127,8 @@ public class Version implements Comparable<Version>, ToXContentFragment {
switch (id) { switch (id) {
case V_7_0_0_alpha1_ID: case V_7_0_0_alpha1_ID:
return V_7_0_0_alpha1; return V_7_0_0_alpha1;
case V_6_6_0_ID:
return V_6_6_0;
case V_6_5_0_ID: case V_6_5_0_ID:
return V_6_5_0; return V_6_5_0;
case V_6_4_3_ID: case V_6_4_3_ID:

View File

@ -181,7 +181,7 @@ public class VersionTests extends ESTestCase {
// from 7.0 on we are supporting the latest minor of the previous major... this might fail once we add a new version ie. 5.x is // from 7.0 on we are supporting the latest minor of the previous major... this might fail once we add a new version ie. 5.x is
// released since we need to bump the supported minor in Version#minimumCompatibilityVersion() // released since we need to bump the supported minor in Version#minimumCompatibilityVersion()
Version lastVersion = Version.V_6_5_0; // TODO: remove this once min compat version is a constant instead of method Version lastVersion = Version.V_6_6_0; // TODO: remove this once min compat version is a constant instead of method
assertEquals(lastVersion.major, Version.V_7_0_0_alpha1.minimumCompatibilityVersion().major); assertEquals(lastVersion.major, Version.V_7_0_0_alpha1.minimumCompatibilityVersion().major);
assertEquals("did you miss to bump the minor in Version#minimumCompatibilityVersion()", assertEquals("did you miss to bump the minor in Version#minimumCompatibilityVersion()",
lastVersion.minor, Version.V_7_0_0_alpha1.minimumCompatibilityVersion().minor); lastVersion.minor, Version.V_7_0_0_alpha1.minimumCompatibilityVersion().minor);
@ -340,7 +340,8 @@ public class VersionTests extends ESTestCase {
public void testIsCompatible() { public void testIsCompatible() {
assertTrue(isCompatible(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion())); assertTrue(isCompatible(Version.CURRENT, Version.CURRENT.minimumCompatibilityVersion()));
assertTrue(isCompatible(Version.V_6_5_0, Version.V_7_0_0_alpha1)); assertFalse(isCompatible(Version.V_6_5_0, Version.V_7_0_0_alpha1));
assertTrue(isCompatible(Version.V_6_6_0, Version.V_7_0_0_alpha1));
assertFalse(isCompatible(Version.fromId(2000099), Version.V_7_0_0_alpha1)); assertFalse(isCompatible(Version.fromId(2000099), Version.V_7_0_0_alpha1));
assertFalse(isCompatible(Version.fromId(2000099), Version.V_6_5_0)); assertFalse(isCompatible(Version.fromId(2000099), Version.V_6_5_0));
assertFalse(isCompatible(Version.fromString("7.0.0"), Version.fromString("8.0.0"))); assertFalse(isCompatible(Version.fromString("7.0.0"), Version.fromString("8.0.0")));

View File

@ -156,27 +156,29 @@ public class TcpTransportTests extends ESTestCase {
TcpTransport.ensureVersionCompatibility(VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumCompatibilityVersion(), TcpTransport.ensureVersionCompatibility(VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumCompatibilityVersion(),
Version.CURRENT), Version.CURRENT, randomBoolean()); Version.CURRENT), Version.CURRENT, randomBoolean());
TcpTransport.ensureVersionCompatibility(Version.fromString("6.0.0"), Version.fromString("7.0.0"), true); final Version version = Version.fromString("7.0.0");
TcpTransport.ensureVersionCompatibility(Version.fromString("6.0.0"), version, true);
IllegalStateException ise = expectThrows(IllegalStateException.class, () -> IllegalStateException ise = expectThrows(IllegalStateException.class, () ->
TcpTransport.ensureVersionCompatibility(Version.fromString("6.0.0"), Version.fromString("7.0.0"), false)); TcpTransport.ensureVersionCompatibility(Version.fromString("6.0.0"), version, false));
assertEquals("Received message from unsupported version: [6.0.0] minimal compatible version is: [6.5.0]", ise.getMessage()); assertEquals("Received message from unsupported version: [6.0.0] minimal compatible version is: ["
+ version.minimumCompatibilityVersion() + "]", ise.getMessage());
// For handshake we are compatible with N-2 // For handshake we are compatible with N-2
TcpTransport.ensureVersionCompatibility(Version.fromString("5.6.0"), Version.fromString("7.0.0"), true); TcpTransport.ensureVersionCompatibility(Version.fromString("5.6.0"), version, true);
ise = expectThrows(IllegalStateException.class, () -> ise = expectThrows(IllegalStateException.class, () ->
TcpTransport.ensureVersionCompatibility(Version.fromString("5.6.0"), Version.fromString("7.0.0"), false)); TcpTransport.ensureVersionCompatibility(Version.fromString("5.6.0"), version, false));
assertEquals("Received message from unsupported version: [5.6.0] minimal compatible version is: [6.5.0]", assertEquals("Received message from unsupported version: [5.6.0] minimal compatible version is: ["
ise.getMessage()); + version.minimumCompatibilityVersion() + "]", ise.getMessage());
ise = expectThrows(IllegalStateException.class, () -> ise = expectThrows(IllegalStateException.class, () ->
TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), Version.fromString("7.0.0"), true)); TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), version, true));
assertEquals("Received handshake message from unsupported version: [2.3.0] minimal compatible version is: [6.5.0]", assertEquals("Received handshake message from unsupported version: [2.3.0] minimal compatible version is: ["
ise.getMessage()); + version.minimumCompatibilityVersion() + "]", ise.getMessage());
ise = expectThrows(IllegalStateException.class, () -> ise = expectThrows(IllegalStateException.class, () ->
TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), Version.fromString("7.0.0"), false)); TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), version, false));
assertEquals("Received message from unsupported version: [2.3.0] minimal compatible version is: [6.5.0]", assertEquals("Received message from unsupported version: [2.3.0] minimal compatible version is: ["
ise.getMessage()); + version.minimumCompatibilityVersion() + "]", ise.getMessage());
} }
public void testCompressRequest() throws IOException { public void testCompressRequest() throws IOException {