Search in sources :

Example 1 with VersionMismatchException

use of com.hazelcast.internal.cluster.impl.VersionMismatchException in project hazelcast by hazelcast.

the class DefaultNodeExtension method validateJoinRequest.

@Override
public void validateJoinRequest(JoinMessage joinMessage) {
    // check joining member's major.minor version is same as current cluster version's major.minor numbers
    MemberVersion memberVersion = joinMessage.getMemberVersion();
    Version clusterVersion = node.getClusterService().getClusterVersion();
    if (!memberVersion.asVersion().equals(clusterVersion)) {
        String msg = "Joining node's version " + memberVersion + " is not compatible with cluster version " + clusterVersion;
        if (clusterVersion.getMajor() != memberVersion.getMajor()) {
            msg += " (Rolling Member Upgrades are only supported for the same major version)";
        }
        if (clusterVersion.getMinor() > memberVersion.getMinor()) {
            msg += " (Rolling Member Upgrades are only supported for the next minor version)";
        }
        if (!BuildInfoProvider.getBuildInfo().isEnterprise()) {
            msg += " (Rolling Member Upgrades are only supported in Hazelcast Enterprise)";
        }
        throw new VersionMismatchException(msg);
    }
}
Also used : Version(com.hazelcast.version.Version) MemberVersion(com.hazelcast.version.MemberVersion) VersionMismatchException(com.hazelcast.internal.cluster.impl.VersionMismatchException) MemberVersion(com.hazelcast.version.MemberVersion)

Aggregations

VersionMismatchException (com.hazelcast.internal.cluster.impl.VersionMismatchException)1 MemberVersion (com.hazelcast.version.MemberVersion)1 Version (com.hazelcast.version.Version)1