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
0cf0ee6b
Unverified
Commit
0cf0ee6b
authored
Sep 22, 2022
by
Ozan Tezcan
Committed by
GitHub
Sep 22, 2022
Browse files
Documentation fix (#145)
Documentation fix Co-authored-by:
Hanna Fadida
<
hanna.fadida@redislabs.com
>
parent
63c09185
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/Using.md
View file @
0cf0ee6b
...
@@ -292,10 +292,7 @@ struct config {
...
@@ -292,10 +292,7 @@ struct config {
};
};
....
....
void
app_configure_from_snapshot
(
raft_server_t
*
r
,
void
app_configure_from_snapshot
(
raft_server_t
*
r
,
struct
config
*
head
)
struct
config
*
head
,
raft_term_t
last_applied_term
raft_index_t
last_applied_index
)
{
{
struct
config
*
cfg
=
head
;
struct
config
*
cfg
=
head
;
...
@@ -313,7 +310,14 @@ void app_configure_from_snapshot(raft_server_t *r,
...
@@ -313,7 +310,14 @@ void app_configure_from_snapshot(raft_server_t *r,
}
}
cfg
=
cfg
->
next
;
cfg
=
cfg
->
next
;
}
}
}
void
app_restore_snapshot
(
raft_server_t
*
r
,
struct
config
*
head
,
raft_term_t
last_applied_term
raft_index_t
last_applied_index
)
{
app_configure_from_snapshot
(
r
,
head
);
raft_restore_snapshot
(
r
,
last_applied_term
,
last_applied_index
);
raft_restore_snapshot
(
r
,
last_applied_term
,
last_applied_index
);
}
}
...
@@ -348,7 +352,8 @@ void app_restore_raft_library()
...
@@ -348,7 +352,8 @@ void app_restore_raft_library()
// extracted node configuration list,
// extracted node configuration list,
// extracted last_applied_term and last_applied_index
// extracted last_applied_term and last_applied_index
// See the example implementation above for this function.
// See the example implementation above for this function.
app_configure_from_snapshot
(
r
,
cfg
,
last_applied_term
,
last_applied_index
);
app_configure_from_snapshot
(
r
,
cfg
);
raft_restore_snapshot
(
r
,
snapshot_last_term
,
snapshot_last_index
);
app_load_logs_to_impl
();
// Load log entries in your log implementation
app_load_logs_to_impl
();
// Load log entries in your log implementation
raft_restore_log
();
raft_restore_log
();
...
...
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