libraft icon indicating copy to clipboard operation
libraft copied to clipboard

LeaderElection never ends

Open Jason2031 opened this issue 7 years ago • 3 comments

For some reasons, libraft nodes repeatedly handle election timeout and change role FOLLOWER->CANDIDATE, even when the term number is 100+. The YAML files used are sxx-kayvee.yml under testenv dir.

Jason2031 avatar Mar 31 '17 09:03 Jason2031

It's been a couple of years since I've looked at the code, but...it's hard to debug this without seeing the logs from all the nodes. FWIW, you could see this if the timeouts are too aggressive for the network setup you have, or if messages are repeatedly lost, etc.

allengeorge avatar Apr 04 '17 19:04 allengeorge

The logs from all the nodes are same as follow:

INFO [TIME] io.libraft.algorithm.RaftAlgorithm: [SERVER_ID]: handle election timeout INFO [TIME] io.libraft.algorithm.RaftAlgorithm: [SERVER_ID]: changing role FOLLOWER->CANDIDATE in term [TERM_ID]

BTW, a java.sql.SQLException: [SQLITE_BUSY] The database file is locked exception was thrown when I commented the raftConfiguration.setXXX() functions at line 110~116 in KayVee.java. Don't know the cause of this exception...

Jason2031 avatar Apr 13 '17 02:04 Jason2031

Why did you comment those functions out?

allengeorge avatar May 11 '17 02:05 allengeorge