private boolean updateTerm(long term){ if(term > this.state.getTerm()){ this.state.setTerm(term); this.state.setVotedFor(-1); this.electionCompleted = false; this.votesGranted = 0; this.votedServers.clear(); this.context.getServerStateManager().persistState(this.state); this.becomeFollower(); return true; } return false; }
private boolean updateTerm(long term){ if(term > this.state.getTerm()){ this.state.setTerm(term); this.state.setVotedFor(-1); this.electionCompleted = false; this.votesGranted = 0; this.votesResponded = 0; this.context.getServerStateManager().persistState(this.state); this.becomeFollower(); return true; } return false; }
private boolean updateTerm(long term){ if(term > this.state.getTerm()){ this.state.setTerm(term); this.state.setVotedFor(-1); this.electionCompleted = false; this.votesGranted = 0; this.votesResponded = 0; this.context.getServerStateManager().persistState(this.state); this.becomeFollower(); return true; } return false; }
this.becomeFollower(); }else if(this.role == ServerRole.Leader){ this.logger.error("Receive InstallSnapshotRequest from another leader(%d) with same term, there must be a bug, server exits", request.getSource());
this.becomeFollower(); }else if(this.role == ServerRole.Leader){ this.logger.error("Receive InstallSnapshotRequest from another leader(%d) with same term, there must be a bug, server exits", request.getSource());
this.becomeFollower(); }else if(this.role == ServerRole.Leader){ this.logger.error("Receive InstallSnapshotRequest from another leader(%d) with same term, there must be a bug, server exits", request.getSource());
this.becomeFollower(); }else if(this.role == ServerRole.Leader){ this.logger.error("Receive AppendEntriesRequest from another leader(%d) with same term, there must be a bug, server exits", request.getSource());
this.becomeFollower(); }else if(this.role == ServerRole.Leader){ this.logger.error("Receive AppendEntriesRequest from another leader(%d) with same term, there must be a bug, server exits", request.getSource());
this.becomeFollower(); }else if(this.role == ServerRole.Leader){ this.logger.error("Receive AppendEntriesRequest from another leader(%d) with same term, there must be a bug, server exits", request.getSource());