DAOS-279 server: Discard current_leader when term changes
When a leader learns of a newer term and steps down, it should discard
current_leader. Otherwise, a client request may be rejected with
RAFT_ERR_NOT_LEADER and a hint pointing to this replica itself!
For simplicity, this patche follows the Raft paper to discard
current_leader whenever current_term changes. And, when receiving an AE
with an up-to-date term, a server always updates current_leader, as this
information is absolute, even if the previous entry doesn't match.
This patch also fixes a test that has previously been failing due to
incorrect node IDs.
Signed-off-by:
Li Wei <wei.g.li@intel.com>
Please register or sign in to comment