private Version getClusterOrNodeVersion() { if (node.getClusterService() != null && !node.getClusterService().getClusterVersion().isUnknown()) { return node.getClusterService().getClusterVersion(); } else { String overriddenClusterVersion = node.getProperties().getString(GroupProperty.INIT_CLUSTER_VERSION); return (overriddenClusterVersion != null) ? MemberVersion.of(overriddenClusterVersion).asVersion() : node.getVersion().asVersion(); } }
private Version getClusterOrNodeVersion() { if (node.getClusterService() != null && !node.getClusterService().getClusterVersion().isUnknown()) { return node.getClusterService().getClusterVersion(); } else { String overriddenClusterVersion = node.getProperties().getString(GroupProperty.INIT_CLUSTER_VERSION); return (overriddenClusterVersion != null) ? MemberVersion.of(overriddenClusterVersion).asVersion() : node.getVersion().asVersion(); } }
private boolean checkCompatibleSplitBrainJoinMessage(SplitBrainJoinMessage joinMessage) { Version clusterVersion = clusterService.getClusterVersion(); if (!clusterVersion.isEqualTo(joinMessage.getClusterVersion())) { if (logger.isFineEnabled()) { logger.fine("Should not merge to " + joinMessage.getAddress() + " because other cluster version is " + joinMessage.getClusterVersion() + " while this cluster version is " + clusterVersion); } return false; } return true; }
private boolean checkCompatibleSplitBrainJoinMessage(SplitBrainJoinMessage joinMessage) { Version clusterVersion = clusterService.getClusterVersion(); if (!clusterVersion.isEqualTo(joinMessage.getClusterVersion())) { if (logger.isFineEnabled()) { logger.fine("Should not merge to " + joinMessage.getAddress() + " because other cluster version is " + joinMessage.getClusterVersion() + " while this cluster version is " + clusterVersion); } return false; } return true; }
private void updatePartitionTableReplicasForCompatibility(PartitionReplica[][] partitionTable) { ClusterServiceImpl clusterService = node.getClusterService(); Version version = clusterService.getClusterVersion(); boolean compatibilityMode = version.isLessThan(Versions.V3_12);
public SplitBrainJoinMessage createSplitBrainJoinMessage() { MemberImpl localMember = getLocalMember(); boolean liteMember = localMember.isLiteMember(); Collection<Address> memberAddresses = clusterService.getMemberAddresses(); int dataMemberCount = clusterService.getSize(DATA_MEMBER_SELECTOR); Version clusterVersion = clusterService.getClusterVersion(); int memberListVersion = clusterService.getMembershipManager().getMemberListVersion(); return new SplitBrainJoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), version, address, localMember.getUuid(), liteMember, createConfigCheck(), memberAddresses, dataMemberCount, clusterVersion, memberListVersion); }
if (!service.getClusterVersion().equals(request.getClusterVersion())) { logger.info("Join check from " + getCallerAddress() + " failed validation due to incompatible version," + "remote cluster version is " + request.getClusterVersion() + ", this cluster is " + service.getClusterVersion()); return false;
public SplitBrainJoinMessage createSplitBrainJoinMessage() { MemberImpl localMember = getLocalMember(); boolean liteMember = localMember.isLiteMember(); Collection<Address> memberAddresses = clusterService.getMemberAddresses(); int dataMemberCount = clusterService.getSize(DATA_MEMBER_SELECTOR); Version clusterVersion = clusterService.getClusterVersion(); int memberListVersion = clusterService.getMembershipManager().getMemberListVersion(); return new SplitBrainJoinMessage(Packet.VERSION, buildInfo.getBuildNumber(), version, address, localMember.getUuid(), liteMember, createConfigCheck(), memberAddresses, dataMemberCount, clusterVersion, memberListVersion); }
if (!service.getClusterVersion().equals(request.getClusterVersion())) { logger.info("Join check from " + getCallerAddress() + " failed validation due to incompatible version," + "remote cluster version is " + request.getClusterVersion() + ", this cluster is " + service.getClusterVersion()); return false;
void sendExplicitSuspicion(MembersViewMetadata endpointMembersViewMetadata) { Address endpoint = endpointMembersViewMetadata.getMemberAddress(); if (endpoint.equals(node.getThisAddress())) { logger.warning("Cannot send explicit suspicion for " + endpointMembersViewMetadata + " to itself."); return; } if (!isJoined()) { if (logger.isFineEnabled()) { logger.fine("Cannot send explicit suspicion, not joined yet!"); } return; } Version clusterVersion = getClusterVersion(); assert !clusterVersion.isUnknown() : "Cluster version should not be unknown after join!"; Operation op = new ExplicitSuspicionOp(endpointMembersViewMetadata); nodeEngine.getOperationService().send(op, endpoint); }
public boolean setThisMemberAsMaster() { clusterServiceLock.lock(); try { if (clusterService.isJoined()) { logger.warning("Cannot set as master because node is already joined!"); return false; } logger.finest("This node is being set as the master"); Address thisAddress = node.getThisAddress(); MemberVersion version = node.getVersion(); clusterService.setMasterAddress(thisAddress); if (clusterService.getClusterVersion().isUnknown()) { clusterService.getClusterStateManager().setClusterVersion(version.asVersion()); } clusterService.getClusterClock().setClusterStartTime(Clock.currentTimeMillis()); clusterService.setClusterId(UuidUtil.createClusterUuid()); clusterService.getMembershipManager().setLocalMemberListJoinVersion(SINGLETON_MEMBER_LIST_VERSION); clusterService.setJoined(true); return true; } finally { clusterServiceLock.unlock(); } }
void sendExplicitSuspicion(MembersViewMetadata endpointMembersViewMetadata) { Address endpoint = endpointMembersViewMetadata.getMemberAddress(); if (endpoint.equals(node.getThisAddress())) { logger.warning("Cannot send explicit suspicion for " + endpointMembersViewMetadata + " to itself."); return; } if (!isJoined()) { if (logger.isFineEnabled()) { logger.fine("Cannot send explicit suspicion, not joined yet!"); } return; } Version clusterVersion = getClusterVersion(); assert !clusterVersion.isUnknown() : "Cluster version should not be unknown after join!"; Operation op = new ExplicitSuspicionOp(endpointMembersViewMetadata); nodeEngine.getOperationService().send(op, endpoint); }
public boolean setThisMemberAsMaster() { clusterServiceLock.lock(); try { if (clusterService.isJoined()) { logger.warning("Cannot set as master because node is already joined!"); return false; } logger.finest("This node is being set as the master"); Address thisAddress = node.getThisAddress(); MemberVersion version = node.getVersion(); clusterService.setMasterAddress(thisAddress); if (clusterService.getClusterVersion().isUnknown()) { clusterService.getClusterStateManager().setClusterVersion(version.asVersion()); } clusterService.getClusterClock().setClusterStartTime(Clock.currentTimeMillis()); clusterService.setClusterId(UuidUtil.createClusterUuid()); clusterService.getMembershipManager().setLocalMemberListJoinVersion(SINGLETON_MEMBER_LIST_VERSION); clusterService.setJoined(true); return true; } finally { clusterServiceLock.unlock(); } }
@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); } }
@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); } }
Operation op = new FinalizeJoinOp(member.getUuid(), newMembersView, preJoinOp, postJoinOp, time, clusterService.getClusterId(), startTime, clusterStateManager.getState(), clusterService.getClusterVersion(), partitionRuntimeState); op.setCallerUuid(thisUuid); invokeClusterOp(op, member.getAddress());
@Override public void run() { if (node.isMaster()) { MigrationManager migrationManager = partitionService.getMigrationManager(); boolean migrationAllowed = migrationManager.areMigrationTasksAllowed() && !partitionService.isFetchMostRecentPartitionTableTaskRequired(); if (!migrationAllowed) { logger.fine("Not publishing partition runtime state since migration is not allowed."); return; } if (migrationManager.hasOnGoingMigration()) { logger.info("Remaining migration tasks in queue => " + partitionService.getMigrationQueueSize() + ". (" + migrationManager.getStats().formatToString(logger.isFineEnabled()) + ")"); } else if (node.getState() == NodeState.ACTIVE) { if (node.getClusterService().getClusterVersion().isGreaterOrEqual(Versions.V3_12)) { partitionService.checkClusterPartitionRuntimeStates(); } else { // RU_COMPAT_3_11 partitionService.publishPartitionRuntimeState(); } } } } }
clusterClock.getClusterTime(), clusterService.getClusterId(), clusterClock.getClusterStartTime(), clusterStateManager.getState(), clusterService.getClusterVersion(), partitionRuntimeState); op.setCallerUuid(clusterService.getThisUuid()); invokeClusterOp(op, target);
clusterClock.getClusterTime(), clusterService.getClusterId(), clusterClock.getClusterStartTime(), clusterStateManager.getState(), clusterService.getClusterVersion(), partitionRuntimeState); op.setCallerUuid(clusterService.getThisUuid()); invokeClusterOp(op, target);
if (clusterService.getClusterVersion().isLessThan(Versions.V3_12) && node.getNodeExtension().getInternalHotRestartService().isEnabled() && clusterService.isMissingMember(target, uuid)) {