diff --git a/walkeeper/src/safekeeper.rs b/walkeeper/src/safekeeper.rs index a4747f2086..22a8481e45 100644 --- a/walkeeper/src/safekeeper.rs +++ b/walkeeper/src/safekeeper.rs @@ -514,11 +514,16 @@ where WAL: wal_storage::Storage, { // constructor - pub fn new(ztli: ZTimelineId, state: CTRL, wal_store: WAL) -> Result> { + pub fn new( + ztli: ZTimelineId, + state: CTRL, + mut wal_store: WAL, + ) -> Result> { if state.timeline_id != ZTimelineId::from([0u8; 16]) && ztli != state.timeline_id { bail!("Calling SafeKeeper::new with inconsistent ztli ({}) and SafeKeeperState.server.timeline_id ({})", ztli, state.timeline_id); } + // initialize wal_store, if state is already initialized wal_store.init_storage(&state)?; Ok(SafeKeeper {