efficient / epaxos

http://efficient.github.io/epaxos/
Other
612 stars 134 forks source link

Possible bug in try-pre-accept #23

Open devu1997 opened 1 year ago

devu1997 commented 1 year ago

https://github.com/efficient/epaxos/blob/master/src/epaxos/epaxos.go#L1691

In line 1691, shouldn't it be if !inst.lb.possibleQuorum[q] instead of. if !inst.lb.possibleQuorum[tpar.AcceptorId]?

Reasoning- Line 1686 sets inst.lb.possibleQuorum[tpar.AcceptorId] = false. Hence, the if condition in line 1691 will be always true. So the value of notInQuorum will be always r.N. This means if one replica rejected the try-pre-accept then notInQuorum will be directly set to r.N and then the condition in line 1695 will be always true. And hence the replica will move to phase 1 all the time. So code in lines 1700 to 1715 are never executed.