You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the election means of jgroups-raft has a little different from the standard algorithm, so I did some tests about it.
There are 5 nodes of the cluster, and here is the log status of term 1. The steps like below:
Apply two commands with 5 nodes
Shutdown C then apply two commands
Shutdown E then apply two commands
Shutdown all nodes then restart C, D, E of the 5 nodes cluster, C first and it become the coordinator, then D and then E. The majority has been reached, so the coordinator begin the election process, after all responses have been received, coordinator begin to find out the leader, below is the source code.
view.getMembersRaw() returns "C, D, E" which is the joining order of them, and the "self" here is C which is the coordinator, the result is E become the leader of term 2.
Trying to setAsync a command, after the log being committed and applied, the log like above.
The text was updated successfully, but these errors were encountered:
Thanks for opening the issue, @yfei-z. I think b87f5f3 fixes this issue, a problem in calculating the longest log. I'll try to create a test with the scenario described to make sure and release a new version with the fix ASAP.
I developed a small test with the scenario to try. Running against main, the correct node (D) is elected. And without b87f5f3, the wrong node is elected. An equivalent of this scenario is
I noticed that the election means of jgroups-raft has a little different from the standard algorithm, so I did some tests about it.
![raft-bug1](https://private-user-images.githubusercontent.com/4158629/316778021-e41c4bc0-dbe1-40f9-9cc0-07fbc3875aac.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MTYwMTQsIm5iZiI6MTcxOTYxNTcxNCwicGF0aCI6Ii80MTU4NjI5LzMxNjc3ODAyMS1lNDFjNGJjMC1kYmUxLTQwZjktOWNjMC0wN2ZiYzM4NzVhYWMuc3ZnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjhUMjMwMTU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjUyNDNjNDAyNTJiODQxODNmNzZkZGIxOTg2NjQwYmUxZjZjNjg0Njk5ODE3OWU0MzkxMmNkYTBiMzc3NjYwMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.klXvt3A0oCmcDg2X1Nkz27uYGbSBd0o4wIFCt7rxfw4)
There are 5 nodes of the cluster, and here is the log status of term 1. The steps like below:
Shutdown all nodes then restart C, D, E of the 5 nodes cluster, C first and it become the coordinator, then D and then E. The majority has been reached, so the coordinator begin the election process, after all responses have been received, coordinator begin to find out the leader, below is the source code.
view.getMembersRaw()
returns "C, D, E" which is the joining order of them, and the "self" here is C which is the coordinator, the result is E become the leader of term 2.Trying to setAsync a command, after the log being committed and applied, the log like above.
The text was updated successfully, but these errors were encountered: