}
}
}
private boolean isJoinRequestFromAnExistingMember(JoinRequest joinRequest) {
MemberImpl member = getMember(joinRequest.getAddress());
if (member != null) {
if (joinRequest.getUuid().equals(member.getUuid())) {
if (logger.isFinestEnabled()) {
String message = "Ignoring join request, member already exists.. => " + joinRequest;
logger.finest(message);
}
// send members update back to node trying to join again...
Operation op = new MemberInfoUpdateOperation(createMemberInfos(getMemberList(), true),
getClusterTime(), false);
nodeEngine.getOperationService().send(op, member.getAddress());
return true;
}
// If this node is master then remove old member and process join request.
// If requesting address is equal to master node's address, that means master node
// somehow disconnected and wants to join back.
// So drop old member and process join request if this node becomes master.
if (node.isMaster() || member.getAddress().equals(node.getMasterAddress())) {
logger.warning("New join request has been received from an existing endpoint! => " + member
+ " Removing old member and processing join request...");
doRemoveAddress(member.getAddress(), false);
}
}
return false;
}