chesnokoff commented on code in PR #12301:
URL: https://github.com/apache/ignite/pull/12301#discussion_r2417191296
##########
modules/core/src/test/java/org/apache/ignite/internal/GridReleaseTypeSelfTest.java:
##########
@@ -57,61 +81,258 @@ public class GridReleaseTypeSelfTest extends
GridCommonAbstractTest {
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
+ cleanPersistenceDir();
}
- /**
- * @throws Exception If failed.
- */
+ /** */
@Test
- public void testOsEditionDoesNotSupportRollingUpdates() throws Exception {
- nodeVer = "1.0.0";
+ public void testTwoConflictVersions() {
+ testConflictVersions("2.18.0", "2.16.0", isClient);
+ testConflictVersions("2.21.0", "2.23.1", isClient);
+ testConflictVersions("2.20.1", "2.20.2", isClient);
+ }
- startGrid(0);
+ /** */
+ @Test
+ public void testThreeConflictVersions() {
+ testConflictVersionsWithRollingUpgrade("2.18.0", "2.18.2", "2.16.0",
isClient, "2.18.2");
+ testConflictVersionsWithRollingUpgrade("2.18.0", "2.18.3", "2.20.0",
isClient, "2.18.3");
- try {
- nodeVer = "1.0.1";
+ testConflictVersionsWithRollingUpgrade("2.18.0", "2.19.2", "2.17.0",
isClient, "2.19.2");
+ testConflictVersionsWithRollingUpgrade("2.18.0", "2.17.3", "2.19.0",
isClient, "2.17.3");
- startGrid(1);
+ testConflictVersionsWithRollingUpgrade("2.18.0", "2.19.2", "2.20.0",
isClient, "2.19.2");
+ testConflictVersionsWithRollingUpgrade("2.18.0", "2.17.3", "2.16.0",
isClient, "2.17.3");
+ }
- fail("Exception has not been thrown.");
- }
- catch (IgniteCheckedException e) {
- StringWriter errors = new StringWriter();
+ /** */
+ @Test
+ public void testTwoCompatibleVersions() throws Exception {
+ testCompatibleVersions("2.18.0", "2.18.0", isClient, null);
+ testCompatibleVersions("2.19.2", "2.19.2", isClient, null);
- e.printStackTrace(new PrintWriter(errors));
+ testCompatibleVersions("2.18.0", "2.18.1", isClient, "2.18.1");
+ testCompatibleVersions("2.18.0", "2.19.6", isClient, "2.19.6");
+ }
- String stackTrace = errors.toString();
+ /** */
+ @Test
+ public void testThreeCompatibleVersions() throws Exception {
+ testCompatibleVersions("2.18.0", "2.18.0", "2.18.0", isClient, null);
+ testCompatibleVersions("2.18.2", "2.18.2", "2.18.2", isClient, null);
- if (!stackTrace.contains("Local node and remote node have
different version numbers"))
- throw e;
- }
+ testCompatibleVersions("2.18.0", "2.18.1", "2.18.1", isClient,
"2.18.1");
+ testCompatibleVersions("2.18.0", "2.18.2", "2.18.2", isClient,
"2.18.2");
}
- /**
- * @throws Exception If failed.
- */
+ /** */
@Test
- public void testOsEditionDoesNotSupportRollingUpdatesClientMode() throws
Exception {
- nodeVer = "1.0.0";
+ public void testForwardRollingUpgrade() throws Exception {
+ IgniteEx ign0 = startGrid(0, "2.18.0", false);
+ IgniteEx ign1 = startGrid(1, "2.18.0", isClient);
+ IgniteEx ign2 = startGrid(2, "2.18.0", isClient);
- startGrid(0);
+ assertClusterSize(3);
- try {
- nodeVer = "1.0.1";
+ assertRemoteRejected(() -> startGrid(3, "2.18.1", isClient));
- startClientGrid(1);
+ allowRollingUpgradeVersionCheck(ign0, "2.18.1");
- fail("Exception has not been thrown.");
- }
- catch (IgniteCheckedException e) {
- StringWriter errors = new StringWriter();
+ assertRemoteRejected(() -> startGrid(3, "2.18.0", isClient));
+
+ ign2.close();
+
+ assertClusterSize(2);
+
+ startGrid(2, "2.18.1", isClient);
+
+ assertClusterSize(3);
+
+ ign1.close();
+
+ assertClusterSize(2);
+
+ startGrid(1, "2.18.1", false);
+
+ assertClusterSize(3);
+
+ ign0.close();
+
+ assertClusterSize(2);
+
+ startGrid(0, "2.18.1", isClient);
+
+ assertClusterSize(3);
+ }
+
+ /** */
+ @Test
+ public void testCoordinatorChange() throws Exception {
+ IgniteEx ign0 = startGrid(0, "2.18.0", false);
+
+ allowRollingUpgradeVersionCheck(ign0, "2.19.0");
+
+ assertRemoteRejected(() -> startGrid(1, "2.18.0", isClient));
+
+ IgniteEx ign1 = startGrid(1, "2.19.0", false);
+
+ assertClusterSize(2);
+
+ ign0.close();
+
+ assertClusterSize(1);
+
+ assertRemoteRejected(() -> startGrid(0, "2.18.0", isClient));
+
+ allowRollingUpgradeVersionCheck(ign1, "2.20.0");
+
+ startGrid(0, "2.20.0", isClient);
+
+ assertClusterSize(2);
+
+ assertRemoteRejected(() -> startGrid(2, "2.21.0", isClient));
+
+ assertClusterSize(2);
+ }
+
+ /** */
+ @Test
+ public void testNodeRestart() throws Exception {
+ DataStorageConfiguration storageCfg = new DataStorageConfiguration();
+
storageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
+ UnaryOperator<IgniteConfiguration> cfgOp = cfg ->
cfg.setDataStorageConfiguration(storageCfg);
+
+ for (int i = 0; i < 3; i++)
+ startGrid(i, "2.18.0", false, cfgOp);
- e.printStackTrace(new PrintWriter(errors));
+ grid(0).cluster().state(ClusterState.ACTIVE);
- String stackTrace = errors.toString();
+ assertClusterSize(3);
- if (!stackTrace.contains("Local node and remote node have
different version numbers"))
- throw e;
+ allowRollingUpgradeVersionCheck(grid(0), "2.18.1");
+
+ for (int i = 0; i < 3; i++)
+ grid(i).close();
+
+ assertClusterSize(0);
+
+ for (int i = 0; i < 3; i++)
+ startGrid(i, "2.18.0", false, cfgOp);
Review Comment:
fails with
```
Remote node rejected due to incompatible version for cluster join.
Remote node info:
- Version : 2.18.0
- Addresses : [127.0.0.1]
- Node ID : 28e3551d-8372-450e-8c21-4b6da0b00001
Local node info:
- Version : 2.18.0
- Addresses : [127.0.0.1]
- Node ID : 9b1de5c0-2699-4680-aa2a-885aa7500000
Allowed version for joining: 2.18.1
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]