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:
parent
d824cbe992
commit
3225b2dcd3
|
@ -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 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 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 Version V_7_0_0_alpha1 =
|
||||
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) {
|
||||
case V_7_0_0_alpha1_ID:
|
||||
return V_7_0_0_alpha1;
|
||||
case V_6_6_0_ID:
|
||||
return V_6_6_0;
|
||||
case V_6_5_0_ID:
|
||||
return V_6_5_0;
|
||||
case V_6_4_3_ID:
|
||||
|
|
|
@ -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
|
||||
// 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("did you miss to bump the minor in Version#minimumCompatibilityVersion()",
|
||||
lastVersion.minor, Version.V_7_0_0_alpha1.minimumCompatibilityVersion().minor);
|
||||
|
@ -340,7 +340,8 @@ public class VersionTests extends ESTestCase {
|
|||
|
||||
public void testIsCompatible() {
|
||||
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_6_5_0));
|
||||
assertFalse(isCompatible(Version.fromString("7.0.0"), Version.fromString("8.0.0")));
|
||||
|
|
|
@ -156,27 +156,29 @@ public class TcpTransportTests extends ESTestCase {
|
|||
TcpTransport.ensureVersionCompatibility(VersionUtils.randomVersionBetween(random(), Version.CURRENT.minimumCompatibilityVersion(),
|
||||
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, () ->
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("6.0.0"), Version.fromString("7.0.0"), false));
|
||||
assertEquals("Received message from unsupported version: [6.0.0] minimal compatible version is: [6.5.0]", ise.getMessage());
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("6.0.0"), version, false));
|
||||
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
|
||||
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, () ->
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("5.6.0"), Version.fromString("7.0.0"), false));
|
||||
assertEquals("Received message from unsupported version: [5.6.0] minimal compatible version is: [6.5.0]",
|
||||
ise.getMessage());
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("5.6.0"), version, false));
|
||||
assertEquals("Received message from unsupported version: [5.6.0] minimal compatible version is: ["
|
||||
+ version.minimumCompatibilityVersion() + "]", ise.getMessage());
|
||||
|
||||
ise = expectThrows(IllegalStateException.class, () ->
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), Version.fromString("7.0.0"), true));
|
||||
assertEquals("Received handshake message from unsupported version: [2.3.0] minimal compatible version is: [6.5.0]",
|
||||
ise.getMessage());
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), version, true));
|
||||
assertEquals("Received handshake message from unsupported version: [2.3.0] minimal compatible version is: ["
|
||||
+ version.minimumCompatibilityVersion() + "]", ise.getMessage());
|
||||
|
||||
ise = expectThrows(IllegalStateException.class, () ->
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), Version.fromString("7.0.0"), false));
|
||||
assertEquals("Received message from unsupported version: [2.3.0] minimal compatible version is: [6.5.0]",
|
||||
ise.getMessage());
|
||||
TcpTransport.ensureVersionCompatibility(Version.fromString("2.3.0"), version, false));
|
||||
assertEquals("Received message from unsupported version: [2.3.0] minimal compatible version is: ["
|
||||
+ version.minimumCompatibilityVersion() + "]", ise.getMessage());
|
||||
}
|
||||
|
||||
public void testCompressRequest() throws IOException {
|
||||
|
|
Loading…
Reference in New Issue