Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wal checkpoint support #696

Open
2 of 6 tasks
sonhmai opened this issue Jan 15, 2025 · 2 comments
Open
2 of 6 tasks

Wal checkpoint support #696

sonhmai opened this issue Jan 15, 2025 · 2 comments

Comments

@sonhmai
Copy link
Contributor

sonhmai commented Jan 15, 2025

Hi folks,

I'd like to create this issue as an umbrella issue for adding WAL checkpoint support. See sqlite doc for wal checkpointing

Rational

  1. important feature for write ahead log to support recovery
  2. needed in benchmark(s) like mobibench like Mobibench mentioned in Add support for sqlite3_wal_checkpoint_*() #478

todos

Context

  • checkpoint is applying changes in WAL file to database file in wal journal_mode.
  • it is triggered
    • manually by pragma wal_checkpoint and sqlite3_wal_checkpoint*
    • automatically by the database when wal file is over a threshold

Feel free to comment, I will add the missing ones, or add more details.

@sonhmai
Copy link
Contributor Author

sonhmai commented Jan 19, 2025

Support for pragma wal_checkpoint; added in #694

@sonhmai
Copy link
Contributor Author

sonhmai commented Jan 19, 2025

checkpoint infra already across the modules in wal, pager, connection.

wal module

fn checkpoint(

connection

pub fn checkpoint(&self) -> Result<()> {

It seems that we need to two other things as part of checkpoint result later. Ref this todo.

  1. num modified pages written to wal file
  2. num pages moved to db after checkpoint

@sonhmai sonhmai changed the title add wal checkpoint support Wal checkpoint support Jan 19, 2025
penberg added a commit that referenced this issue Jan 20, 2025
Wire pragma wal_checkpoint to checkpoint infra
- add basic support for parsing and instruction emitting `pragma
wal_checkpoint;`
- checkpoint opcode for instruction
- checkpoint execution in `virtual machine`
- cli test
Part of #696.
Before
```
limbo> pragma wal_checkpoint;

  × Parse error: Not a valid pragma name
```
After
```
Enter ".help" for usage hints.
limbo> pragma wal_checkpoint;
0|0|0
```
```

Closes #694
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

No branches or pull requests

1 participant