Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
6e348ebe
Commit
6e348ebe
authored
Sep 30, 2015
by
Dulloor
Browse files
Apply entries lazily even if leader.
parent
cefdd08c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/raft_server.c
View file @
6e348ebe
...
...
@@ -144,7 +144,11 @@ int raft_periodic(raft_server_t* me_, int msec_since_last_period)
me
->
timeout_elapsed
+=
msec_since_last_period
;
if
(
me
->
state
==
RAFT_STATE_LEADER
)
{
{
if
(
me
->
last_applied_idx
<
me
->
commit_idx
)
if
(
-
1
==
raft_apply_entry
(
me_
))
return
-
1
;
if
(
me
->
request_timeout
<=
me
->
timeout_elapsed
)
{
raft_send_appendentries_all
(
me_
);
...
...
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