Search in sources :

Example 1 with MismatchingGroupMembersCommitIndexException

use of com.hazelcast.cp.internal.raft.exception.MismatchingGroupMembersCommitIndexException in project hazelcast by hazelcast.

the class MembershipChangeTask method isValidGroupMemberCommitIndex.

private boolean isValidGroupMemberCommitIndex() {
    if (groupMembersCommitIndex != null) {
        RaftState state = raftNode.state();
        RaftGroupMembers groupMembers = state.committedGroupMembers();
        if (groupMembers.index() != groupMembersCommitIndex) {
            logger.severe("Cannot " + membershipChangeMode + " " + member + " because expected members commit index: " + groupMembersCommitIndex + " is different than group members commit index: " + groupMembers.index());
            Exception e = new MismatchingGroupMembersCommitIndexException(groupMembers.index(), groupMembers.members());
            resultFuture.completeExceptionally(e);
            return false;
        }
    }
    return true;
}
Also used : MismatchingGroupMembersCommitIndexException(com.hazelcast.cp.internal.raft.exception.MismatchingGroupMembersCommitIndexException) RaftState(com.hazelcast.cp.internal.raft.impl.state.RaftState) RaftGroupMembers(com.hazelcast.cp.internal.raft.impl.state.RaftGroupMembers) MemberDoesNotExistException(com.hazelcast.cp.internal.raft.exception.MemberDoesNotExistException) CPSubsystemException(com.hazelcast.cp.exception.CPSubsystemException) NotLeaderException(com.hazelcast.cp.exception.NotLeaderException) CannotReplicateException(com.hazelcast.cp.exception.CannotReplicateException) MemberAlreadyExistsException(com.hazelcast.cp.internal.raft.exception.MemberAlreadyExistsException) MismatchingGroupMembersCommitIndexException(com.hazelcast.cp.internal.raft.exception.MismatchingGroupMembersCommitIndexException)

Aggregations

CPSubsystemException (com.hazelcast.cp.exception.CPSubsystemException)1 CannotReplicateException (com.hazelcast.cp.exception.CannotReplicateException)1 NotLeaderException (com.hazelcast.cp.exception.NotLeaderException)1 MemberAlreadyExistsException (com.hazelcast.cp.internal.raft.exception.MemberAlreadyExistsException)1 MemberDoesNotExistException (com.hazelcast.cp.internal.raft.exception.MemberDoesNotExistException)1 MismatchingGroupMembersCommitIndexException (com.hazelcast.cp.internal.raft.exception.MismatchingGroupMembersCommitIndexException)1 RaftGroupMembers (com.hazelcast.cp.internal.raft.impl.state.RaftGroupMembers)1 RaftState (com.hazelcast.cp.internal.raft.impl.state.RaftState)1