Skip to content

Integrate the WAL writer into the memtable. - #3

Merged
Eroui merged 4 commits into
mainfrom
feat/walintegration
Aug 20, 2026
Merged

Eroui merged 4 commits into
mainfrom
feat/walintegration

Conversation

@Eroui

@Eroui Eroui commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

This is a simple integration at the moment We can rediscuss things and find a better way to integrate.

This is a simple integration at the moment.

@chermehdi chermehdi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should inject the writer

pub(crate) fn new() -> Self {
Self {
pub(crate) fn new(path: &Path) -> Result<Self> {
let wal_writer = WalWriter::new(path)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking the Memtable should take this by reference (i.e we should inject the WalWriter into the the MemTable).

Comment thread pugmill-db/src/memtable.rs Outdated

pub(crate) fn put(&mut self, key: Key, value: Value) -> Result<()> {
self.wal_writer
.append(crate::Entry::Put(key.clone(), value.clone()))?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
.append(crate::Entry::Put(key.clone(), value.clone()))?;
.append(Entry::Put(key.clone(), value.clone()))?;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@Eroui
Eroui merged commit af1411f into main Aug 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants