@@ -292,10 +292,7 @@ struct config {
292
292
};
293
293
....
294
294
295
- void app_configure_from_snapshot (raft_server_t * r,
296
- struct config * head,
297
- raft_term_t last_applied_term
298
- raft_index_t last_applied_index)
295
+ void app_configure_from_snapshot (raft_server_t * r, struct config * head)
299
296
{
300
297
struct config * cfg = head;
301
298
@@ -313,7 +310,14 @@ void app_configure_from_snapshot(raft_server_t *r,
313
310
}
314
311
cfg = cfg->next;
315
312
}
316
-
313
+ }
314
+
315
+ void app_restore_snapshot(raft_server_t * r,
316
+ struct config * head,
317
+ raft_term_t last_applied_term
318
+ raft_index_t last_applied_index)
319
+ {
320
+ app_configure_from_snapshot(r, head);
317
321
raft_restore_snapshot(r, last_applied_term, last_applied_index);
318
322
}
319
323
@@ -348,7 +352,8 @@ void app_restore_raft_library()
348
352
// extracted node configuration list,
349
353
// extracted last_applied_term and last_applied_index
350
354
// See the example implementation above for this function.
351
- app_configure_from_snapshot (r, cfg, last_applied_term, last_applied_index);
355
+ app_configure_from_snapshot (r, cfg);
356
+ raft_restore_snapshot(r, snapshot_last_term, snapshot_last_index);
352
357
353
358
app_load_logs_to_impl(); // Load log entries in your log implementation
354
359
raft_restore_log();
0 commit comments