Skip to content

Commit

Permalink
writing manifest record regardless of wal option bool flag value. all…
Browse files Browse the repository at this point in the history
… week 2 tests passing now
  • Loading branch information
redixhumayun committed Jun 7, 2024
1 parent 52f8fa6 commit f2adac4
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions mini-lsm-starter/src/lsm_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,19 +596,15 @@ impl LsmStorageInner {
state.imm_memtables.insert(0, current_memtable);
state.memtable = new_memtable;

if self.options.enable_wal {
self.manifest
.as_ref()
.map(|manifest| {
manifest.add_record(
&_state_lock_observer,
ManifestRecord::NewMemtable(memtable_id),
)
})
.ok_or_else(|| {
anyhow::anyhow!("no manifest handle found while freezing memtable")
})??;
}
self.manifest
.as_ref()
.map(|manifest| {
manifest.add_record(
&_state_lock_observer,
ManifestRecord::NewMemtable(memtable_id),
)
})
.ok_or_else(|| anyhow::anyhow!("no manifest handle found while freezing memtable"))??;
self.sync_dir()?;
Ok(())
}
Expand Down

0 comments on commit f2adac4

Please sign in to comment.