Skip to content

Commit

Permalink
fix: avoid double open of wal during bootstrap (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Oct 24, 2024
1 parent 79b8412 commit fe3a5b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/bin/dolos/bootstrap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ pub fn run(config: &crate::Config, args: &Args, feedback: &Feedback) -> miette::
return Ok(());
}

// it's important to drop the wal before we start the command
// because the commands might need to re-open the wal
drop(wal);

let command = match args.command.clone() {
Some(x) => x,
None => Command::inquire()?,
Expand Down
2 changes: 1 addition & 1 deletion src/wal/redb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ where
const DEFAULT_CACHE_SIZE_MB: usize = 50;

/// Concrete implementation of WalStore using Redb
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct WalStore {
db: Arc<redb::Database>,
max_slots: Option<u64>,
Expand Down

0 comments on commit fe3a5b8

Please sign in to comment.