Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
3627f344
Commit
3627f344
authored
Jun 08, 2018
by
Jiale Zhi
Committed by
Willem
Jun 09, 2018
Browse files
Fix typos and extra spaces (#77)
parent
700eebe6
Changes
7
Show whitespace changes
Inline
Side-by-side
include/raft.h
View file @
3627f344
...
...
@@ -291,7 +291,7 @@ typedef int (
* @param[in] raft The Raft server making this callback
* @param[in] user_data User data that is passed from Raft server
* @param[in] term Current term
* @param[in] vote The node value dicating we haven't voted for anybody
* @param[in] vote The node value dic
t
ating we haven't voted for anybody
* @return 0 on success */
typedef
int
(
*
func_persist_term_f
...
...
@@ -722,12 +722,12 @@ int raft_node_get_id(raft_node_t* me_);
* @return get state of type raft_state_e. */
int
raft_get_state
(
raft_server_t
*
me_
);
/**
The
the most recent log's term
/**
Get
the most recent log's term
* @return the last log term */
int
raft_get_last_log_term
(
raft_server_t
*
me_
);
/** Turn a node into a voting node.
* Voting nodes can take part in elections and in-regards to commiting entries,
* Voting nodes can take part in elections and in-regards to commit
t
ing entries,
* are counted in majorities. */
void
raft_node_set_voting
(
raft_node_t
*
node
,
int
voting
);
...
...
include/raft_log.h
View file @
3627f344
...
...
@@ -17,7 +17,7 @@ void log_clear(log_t* me_);
* Add entry to log.
* Don't add entry if we've already added this entry (based off ID)
* Don't add entries with ID=0
* @return 0 if unsucessful; 1 otherwise */
* @return 0 if unsuc
c
essful; 1 otherwise */
int
log_append_entry
(
log_t
*
me_
,
raft_entry_t
*
c
);
/**
...
...
include/raft_private.h
View file @
3627f344
src/raft_server.c
View file @
3627f344
...
...
@@ -542,7 +542,7 @@ static int __should_grant_vote(raft_server_private_t* me, msg_requestvote_t* vr)
if
(
vr
->
term
<
raft_get_current_term
((
void
*
)
me
))
return
0
;
/* TODO: if voted for is candiate return 1 (if below checks pass) */
/* TODO: if voted for is candi
d
ate return 1 (if below checks pass) */
if
(
raft_already_voted
((
void
*
)
me
))
return
0
;
...
...
tests/CuTest.c
View file @
3627f344
tests/CuTest.h
View file @
3627f344
tests/test_server.c
View file @
3627f344
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment