diff --git a/tutorials/src/bin/replication.rs b/tutorials/src/bin/replication.rs index 6db03af0..440cb64e 100644 --- a/tutorials/src/bin/replication.rs +++ b/tutorials/src/bin/replication.rs @@ -252,8 +252,10 @@ fn sync_db_demo( chunk_queue.extend(more_chunks); } - target_db.commit_session(session); - + if session.is_sync_completed() { + target_db.commit_session(session); + } + Ok(()) }