Skip to content

Commit

Permalink
Fix a problem with changes being lost introduced by compact logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedilger committed Sep 25, 2024
1 parent 8db63d9 commit 3fc008b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gossip-lib/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,14 @@ impl Storage {
// Open env
let env = Self::new_env(false)?;

env.force_sync()?;

// Copy to backup file, compacting
tracing::info!("Compacting LMDB...");
let _ = env.copy_to_file(&backup, heed::CompactionOption::Enabled)?;

env.force_sync()?;
let _ = env.prepare_for_closing();
}

// Move the data out of the way
Expand Down

0 comments on commit 3fc008b

Please sign in to comment.