diff --git a/sorock/src/process/app.rs b/sorock/src/process/app.rs index 46807f5b..ff31166b 100644 --- a/sorock/src/process/app.rs +++ b/sorock/src/process/app.rs @@ -31,6 +31,7 @@ impl App { if snapshot_index == 1 { return Ok(()); } + info!("install snapshot@{snapshot_index}"); self.install_snapshot(snapshot_index).await?; Ok(()) } diff --git a/sorock/src/process/command_log/mod.rs b/sorock/src/process/command_log/mod.rs index c1ce6730..fed5c246 100644 --- a/sorock/src/process/command_log/mod.rs +++ b/sorock/src/process/command_log/mod.rs @@ -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(()) } } diff --git a/tests/sorock-tests/tests/6_persistency.rs b/tests/sorock-tests/tests/6_persistency.rs index f10ad630..bde2b438 100644 --- a/tests/sorock-tests/tests/6_persistency.rs +++ b/tests/sorock-tests/tests/6_persistency.rs @@ -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);