add test case for candidate state
fix bug in major commit condition