Skip to content

Commit

Permalink
refactor: increment sync_seqn after meta update
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriele-0201 authored and pepyakin committed Feb 15, 2025
1 parent b896c9c commit a5af898
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nomt/src/store/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ impl Sync {
page_cache: PageCache,
updated_pages: impl IntoIterator<Item = (PageId, DirtyPage)> + Send + 'static,
) -> anyhow::Result<()> {
self.sync_seqn += 1;
let sync_seqn = self.sync_seqn;
let sync_seqn = self.sync_seqn + 1;

let mut bitbox_sync = bitbox.sync();
let mut beatree_sync = beatree.sync();
Expand Down Expand Up @@ -73,6 +72,7 @@ impl Sync {
rollback_end_live,
};
Meta::write(&shared.io_pool.page_pool(), &shared.meta_fd, &new_meta)?;
self.sync_seqn += 1;

if let Some(PanicOnSyncMode::PostMeta) = self.panic_on_sync {
panic!("panic_on_sync is true (post-meta)");
Expand All @@ -88,7 +88,6 @@ impl Sync {
if let Some(ref rollback) = rollback_sync {
rollback.wait_post_meta()?;
}

Ok(())
}
}

0 comments on commit a5af898

Please sign in to comment.