Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public boolean contains(int featureId) {

/** */
public boolean isUpgradableTo(IgniteComponentFeatureSet target) {
return Objects.equals(componentName(), target.componentName()) && features.isUpgradableTo(target.features);
return Objects.equals(componentName(), target.componentName())
&& ver.compareTo(target.ver) <= 0
&& features.isUpgradableTo(target.features);
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
* </tr>
* <tr>
* <td>2.19.1</td>
* <td>{@code IgniteFeatureSet [0, 1]}</td>
* <td>{@code IgniteFeatureSet [0]}</td>
* </tr>
* <tr>
* <td>2.19.2</td>
Expand Down Expand Up @@ -464,7 +464,7 @@ protected void finalizeClusterVersion(int nodeIdx, String expVer) throws Excepti

/** */
protected void restartNode(int nodeIdx) throws Exception {
String ver = resolveNodeCompoundVersion(nodeIdx);
String ver = resolveNodeCompoundVersions(nodeIdx);
boolean isClient = grid(nodeIdx).context().clientNode();

stopGrid(nodeIdx);
Expand All @@ -479,7 +479,7 @@ protected void forAllNodes(ConsumerX<Integer> nodeProcessor) throws Exception {

/** */
protected void checkUpgradeFailed(int nodeIdx, String targetVer, String errMsg) throws Exception {
String srcVer = resolveNodeCompoundVersion(nodeIdx);
String srcVer = resolveNodeCompoundVersions(nodeIdx);
boolean isClient = grid(nodeIdx).context().clientNode();

stopGrid(nodeIdx);
Expand All @@ -490,7 +490,7 @@ protected void checkUpgradeFailed(int nodeIdx, String targetVer, String errMsg)
}

/** */
String resolveNodeCompoundVersion(int nodeIdx) {
String resolveNodeCompoundVersions(int nodeIdx) {
return Arrays.stream(ru(nodeIdx).features().localVersionFeatures().values())
.sorted(Comparator.comparing(IgniteComponentFeatureSet::componentName))
.map(f -> semanticVersion(f.version()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void testVersionUpgradeDisabledFinalization() throws Exception {

/** */
@Test
public void testVersionsFinalizationNoVersionUpgrade() throws Exception {
public void testVersionFinalizationNoVersionUpgrade() throws Exception {
startCluster();

ru(1).enableVersionUpgrade();
Expand All @@ -96,6 +96,18 @@ public void testVersionsFinalizationNoVersionUpgrade() throws Exception {
restartNode(2);
}

/** */
@Test
public void testSmallerVersionsWithSameFeaturesAreNotCompatible() throws Exception {
startCluster("2.19.1");

ru(1).enableVersionUpgrade();

checkUpgradeFailed(1, "2.19.0", VER_INCOMPATIBLE_ERR);

finalizeClusterVersion(1, "2.19.1");
}

/** */
@Test
public void testVersionUpgradeCommandsIdempotency() throws Exception {
Expand Down Expand Up @@ -131,24 +143,24 @@ public void testVersionUpgradeEnabledNodeJoin() throws Exception {

checkJoinFailed(5, "2.18.0", VER_INCOMPATIBLE_ERR);

upgradeNodeVersion(0, "2.19.1");
upgradeNodeVersion(2, "2.19.1");
upgradeNodeVersion(0, "2.19.2");
upgradeNodeVersion(2, "2.19.2");

checkVersionUpgradeInProgress(TEST_DEFAULT_VER, "2.19.1");
checkVersionUpgradeInProgress(TEST_DEFAULT_VER, "2.19.2");

checkJoinFailed(5, "2.19.2", VER_INCOMPATIBLE_ERR);
checkJoinFailed(5, "2.19.3", VER_INCOMPATIBLE_ERR);

restartNode(3);
restartNode(4);

restartNode(0);
restartNode(2);

upgradeNodeVersion(1, "2.19.1");
upgradeNodeVersion(3, "2.19.1");
upgradeNodeVersion(4, "2.19.1");
upgradeNodeVersion(1, "2.19.2");
upgradeNodeVersion(3, "2.19.2");
upgradeNodeVersion(4, "2.19.2");

finalizeClusterVersion(1, "2.19.1");
finalizeClusterVersion(1, "2.19.2");
}

/** */
Expand Down Expand Up @@ -644,7 +656,7 @@ public void testFailedNodeDoesNotAffectFinalization() throws Exception {

ru(1).enableVersionUpgrade();

forAllNodes(nodeIdx -> upgradeNodeVersion(nodeIdx, "2.19.1"));
forAllNodes(nodeIdx -> upgradeNodeVersion(nodeIdx, "2.19.2"));

IgniteConfiguration cfg = getConfiguration(3, TEST_DEFAULT_VER)
.setBinaryConfiguration(new BinaryConfiguration().setCompactFooter(false));
Expand All @@ -656,7 +668,7 @@ public void testFailedNodeDoesNotAffectFinalization() throws Exception {
"Local node's binary configuration is not equal to remote node's binary configuration"
);

finalizeClusterVersion(2, "2.19.1");
finalizeClusterVersion(2, "2.19.2");
}

/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@
public class TestIgniteReleaseFeatures_2_19_1 {
/** */
public static final IgniteFeature ROLLING_UPGRADE_FEATURE = TestIgniteReleaseFeatures_2_19_0.ROLLING_UPGRADE_FEATURE;

/** */
public static final IgniteFeature VER_2_19_1_ID_1_FEATURE = new IgniteCoreFeature(1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TestIgniteReleaseFeatures_2_19_2 {
public static final IgniteFeature ROLLING_UPGRADE_FEATURE = TestIgniteReleaseFeatures_2_19_1.ROLLING_UPGRADE_FEATURE;

/** */
public static final IgniteFeature VER_2_19_2_ID_1_FEATURE = TestIgniteReleaseFeatures_2_19_1.VER_2_19_1_ID_1_FEATURE;
public static final IgniteFeature VER_2_19_2_ID_1_FEATURE = new IgniteCoreFeature(1);

/** */
public static final IgniteFeature VER_2_19_2_ID_2_FEATURE = new IgniteCoreFeature(2);
Expand Down
Loading