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 @@ -92,7 +92,11 @@ public void listenActivation(IgniteFeature feature, IgniteRunnable lsnr) {

/** */
public void onGridDataReceived(IgniteNodeFeatureSet activeClusterFeatures) {
if (locVerFeatures.equals(activeClusterFeatures))
boolean hasSameFeatures = ctx.clientNode()
? activeClusterFeatures.containsAll(locVerFeatures)
: locVerFeatures.equals(activeClusterFeatures);

if (hasSameFeatures)
activateLocalVersionFeatures();
else
this.activeFeatures = activeClusterFeatures;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.apache.ignite.internal.processors.rollingupgrade.feature.TestPluginComponentFeatureSetProvider;
import org.apache.ignite.internal.processors.rollingupgrade.feature.TestPluginFeature;
import org.apache.ignite.internal.processors.rollingupgrade.feature.TestPluginReleaseFeatures_1_0_0;
import org.apache.ignite.internal.util.future.GridFutureAdapter;
import org.apache.ignite.internal.util.lang.ConsumerX;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.internal.U;
Expand Down Expand Up @@ -269,6 +270,8 @@ protected void startCluster(String ver) throws Exception {
startGrid(0, ver);
startGrid(1, ver);
startClientGrid(2, ver);

checkVersionUpgradeInactive(ver);
}

/** */
Expand Down Expand Up @@ -357,23 +360,30 @@ protected void checkVersionUpgradeInProgress(String logicalVer, String srcVer, S
/** */
protected void checkVersionUpgradeInactive(String expVer) throws Exception {
checkVersionUpgradeEnabledStatus(false);
checkVersionUpgradeFutureCompleted();
checkFeaturesActive(expVer);
}

/** */
protected void checkVersionUpgradeEnabledStatus(boolean enabled) {
List<Ignite> cluster = Ignition.allGrids();
protected void checkVersionUpgradeFutureCompleted() {
for (Ignite ignite : Ignition.allGrids()) {
GridFutureAdapter<?> fut = U.field(ru(ignite).features(), "locVerFeaturesActivationFut");

assertTrue(fut.isDone());
}
}

for (Ignite ignite : cluster)
/** */
protected void checkVersionUpgradeEnabledStatus(boolean enabled) {
for (Ignite ignite : Ignition.allGrids())
assertEquals(enabled, ru(ignite).isVersionUpgradeEnabled());
}

/** */
protected void checkFeaturesActive(String ver) throws Exception {
TestVersions versions = TestVersions.parse(ver);

if (versions.coreVersion() != null)
checkFeaturesActive(readDeclaredCoreFeatures(versions.coreVersion()));
checkFeaturesActive(readDeclaredCoreFeatures(versions.coreVersion()));

if (versions.containsPlugin())
checkFeaturesActive(readDeclaredPluginFeatures(versions.pluginVersion()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ public void testVersionUpgradeDisabledNodeJoin() throws Exception {

checkVersionUpgradeInactive(TEST_DEFAULT_VER);

String msg = VER_NOT_EQUAL_ERR;

checkJoinFailed(3, "2.18.0", msg);
checkJoinFailed(3, "2.19.1", msg);
checkJoinFailed(3, "2.18.0", VER_NOT_EQUAL_ERR);
checkJoinFailed(3, "2.19.1", VER_NOT_EQUAL_ERR);
}

/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public void testUpgradeDisabledJoinWithMissingComponent() throws Exception {

checkJoinFailed(1, "2.19.0 | 2.0.0", VER_NOT_EQUAL_ERR);

checkJoinSuccess(1, "2.19.0", true);
checkJoinSuccess(1, "2.19.0 | 1.0.0", false);
checkJoinSuccess(2, "2.19.0", true);
}

/** */
Expand Down Expand Up @@ -96,6 +97,8 @@ public void testComponentVersionValidationDuringFinalization() throws Exception
startGrid(1, "2.19.0 | 1.0.0");
startClientGrid(2, "2.19.0");

checkVersionUpgradeInactive("2.19.0 | 1.0.0");

ru(1).enableVersionUpgrade();

startClientGrid(3, "2.19.0 | 2.0.0");
Expand Down
Loading