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
RedisLabs Raft
Commits
699e87d3
Commit
699e87d3
authored
May 24, 2020
by
Yossi Gottlieb
Browse files
Fix: never revert term due to a snapshot.
parent
0990cf7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/raft_server.c
View file @
699e87d3
...
@@ -1486,7 +1486,8 @@ int raft_begin_load_snapshot(
...
@@ -1486,7 +1486,8 @@ int raft_begin_load_snapshot(
if
(
last_included_term
==
me
->
snapshot_last_term
&&
last_included_index
==
me
->
snapshot_last_idx
)
if
(
last_included_term
==
me
->
snapshot_last_term
&&
last_included_index
==
me
->
snapshot_last_idx
)
return
RAFT_ERR_SNAPSHOT_ALREADY_LOADED
;
return
RAFT_ERR_SNAPSHOT_ALREADY_LOADED
;
me
->
current_term
=
last_included_term
;
if
(
me
->
current_term
<
last_included_term
)
me
->
current_term
=
last_included_term
;
me
->
voted_for
=
-
1
;
me
->
voted_for
=
-
1
;
raft_set_state
((
raft_server_t
*
)
me
,
RAFT_STATE_FOLLOWER
);
raft_set_state
((
raft_server_t
*
)
me
,
RAFT_STATE_FOLLOWER
);
me
->
current_leader
=
NULL
;
me
->
current_leader
=
NULL
;
...
...
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