The issue of state changes for a candidate after receiving a majority reject

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 关于candidate在收到majority reject之后的状态变化问题

| username: Haining

According to the paper, there are three scenarios in which a candidate will lose its candidate status. One is winning the election, another is being successfully contacted by a leader, and the third is not electing a leader for a long time. So, after receiving a majority of rejects, it should maintain the candidate status.

Therefore, I have always been puzzled by the TestLeaderElectionOverwriteNewerLogs2AB test in project2ab. In this test, node 1 only received a majority of rejects, so why did it become a follower?

| username: howz97 | Original post link

Many implementations do not fully follow the paper, and becoming a follower is also fine.