We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
com.github.wenweihu86.raft.RaftNode#advanceCommitIndex 方法里的这行: Arrays.sort(matchIndexes);
这里 sort 的时候, 升序应该不是正确的。要用降序。 考虑: peerNum: 4 leader_last_log_idx: 3 follower match indexes: peer1: 2 peer2: 1 peer3: 0
升序的话: [0,1,2,3] 即可能的新 commitIdx = idxes[4/2] = 2 降序的话: [3,2,1,0] 即可能的新 commitIdx = idxes[4/2] = 1 而 1 才是正确的。4 个 node 的话, 要 quorum >= 3
只是当 peerNum 为奇数时, 升降序的效果刚好一样罢了。
The text was updated successfully, but these errors were encountered:
peerNum要求是奇数。
Sorry, something went wrong.
No branches or pull requests
com.github.wenweihu86.raft.RaftNode#advanceCommitIndex
方法里的这行:
Arrays.sort(matchIndexes);
这里 sort 的时候, 升序应该不是正确的。要用降序。
考虑:
peerNum: 4
leader_last_log_idx: 3
follower match indexes:
peer1: 2
peer2: 1
peer3: 0
升序的话:
[0,1,2,3] 即可能的新 commitIdx = idxes[4/2] = 2
降序的话:
[3,2,1,0] 即可能的新 commitIdx = idxes[4/2] = 1
而 1 才是正确的。4 个 node 的话, 要 quorum >= 3
只是当 peerNum 为奇数时, 升降序的效果刚好一样罢了。
The text was updated successfully, but these errors were encountered: