runzhiwang commented on a change in pull request #372:
URL: https://github.com/apache/incubator-ratis/pull/372#discussion_r547916107
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftConfigurationImpl.java
##########
@@ -145,6 +145,17 @@ boolean containsInConf(RaftPeerId peerId) {
return conf.contains(peerId);
}
+ boolean isHighestPriority(RaftPeerId peerId) {
+ RaftPeer target = getPeer(peerId);
+ Collection<RaftPeer> peers = getCurrentPeers();
+ for (RaftPeer peer : peers) {
+ if (peer.getPriority() >= target.getPriority() && !peer.equals(target)) {
Review comment:
@szetszwo For example, if server1, server2, server3 with the same
priority, we can not transfer leader from server1 to server2, because server1
only `yieldLeaderToHigherPriorityPeer ` when server1 find it's priorty is
smaller than followers' priority, so server2 must has the highest priority.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]