Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Hayakawa <[email protected]>
  • Loading branch information
akiradeveloper committed Oct 21, 2024
1 parent 6eac056 commit d511ae7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions sorock/src/process/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ impl App {
if snapshot_index == 1 {
return Ok(());
}
info!("install snapshot@{snapshot_index}");
self.install_snapshot(snapshot_index).await?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion sorock/src/process/command_log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl CommandLog {
self.kern_pointer.store(start_index, Ordering::SeqCst);
self.user_pointer.store(start_index, Ordering::SeqCst);

info!("restore state: snapshot_index={start_index}");
info!("restore state: commit_index={start_index}");
Ok(())
}
}
Expand Down
7 changes: 6 additions & 1 deletion tests/sorock-tests/tests/6_persistency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ async fn n3_restore() -> Result<()> {
cluster.add_server(0, 1, 2).await?;

let mut cur_state = 0;
for _ in 0..10 {
for i in 0..10 {
let add_v = rand::thread_rng().gen_range(1..=9);
let old_v = cluster.user(0).fetch_add(0, add_v).await?;
assert_eq!(old_v, cur_state);
cur_state += add_v;

if i == 5 {
cluster.user(0).make_snapshot(0).await?;
cluster.user(1).make_snapshot(0).await?;
}
}

cluster.env().remove_node(0);
Expand Down

0 comments on commit d511ae7

Please sign in to comment.