Skip to content

Commit

Permalink
DAOS-333 include: Export raft_become_follower()
Browse files Browse the repository at this point in the history
Move the declaration of raft_become_follower() from raft_private.h to
raft.h, so that users may voluntarily give up leadership.

Signed-off-by: Li Wei <wei.g.li@intel.com>
  • Loading branch information
liw authored and willemt committed Nov 21, 2017
1 parent 76d56d0 commit a7a8291
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/raft.h
Expand Up @@ -691,6 +691,10 @@ int raft_apply_all(raft_server_t* me_);
* losing it's consensus guarantees. */
void raft_become_leader(raft_server_t* me);

/** Become follower. This may be used to give up leadership. It does not change
* currentTerm. */
void raft_become_follower(raft_server_t* me);

/** Determine if entry is voting configuration change.
* @param[in] ety The entry to query.
* @return 1 if this is a voting configuration change. */
Expand Down
2 changes: 0 additions & 2 deletions include/raft_private.h
Expand Up @@ -75,8 +75,6 @@ int raft_election_start(raft_server_t* me);

int raft_become_candidate(raft_server_t* me);

void raft_become_follower(raft_server_t* me);

void raft_randomize_election_timeout(raft_server_t* me_);

/**
Expand Down

0 comments on commit a7a8291

Please sign in to comment.