-
Notifications
You must be signed in to change notification settings - Fork 356
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
Comments
Support for |
checkpoint infra already across the modules in wal, pager, connection. wal moduleLine 415 in 4a41736
connectionLine 394 in 4a41736
It seems that we need to two other things as part of checkpoint result later. Ref this todo.
|
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
I'm curious why Refs
|
The only benefit of journal vs WAL that I can think of is that journal mode lets you put the journal and database files in a network filesystem and access the DB from multiple clients over the network, while with WAL you have required data in memory that other networked clients cannot access. From how WAL works:
D. Richard Hipp on why rollback journal can be used with network FS while WAL cannot: https://www.youtube.com/watch?v=gpxnbly9bz4&t=2010s Basically, the rollback journal keeps the original pages from the database file, and the changes are made to the database file itself. In the event of a rollback, the pages from the rollback journal are written back to the database file. In WAL, since the changes are made to the WAL and not the database file, concurrent readers need to know if a page is in the database file or in the WAL file, and the mapping to current pages exists in a hash table in memory, thus only local clients can read its content. |
I was not pay attention to that feature. thanks @LtdJorge for the insight! |
working on #827 for checkpoint result . also ref'ed in the issue todo. |
### What? adding checkpoint result returning number of pages in wal and num pages checkpointed. Part of #696 ### Context SQLite returns in checkpoint result of calling `pragma wal_checkpoint;` `0|3|3` while limbo returns `0|0|0`. https://sqlite.org/pragma.html#pragma_wal_checkpoint - 1st col: 1 (checkpoint SQLITE_BUSY) or 0 (not busy). - 2nd col: # modified pages written to wal file - 3rd col: # pages moved to db after checkpoint This PR aims to add 2nd and 3rd column to the checkpoint result. SQLite ``` sqlite3 test.db sqlite> pragma journal_mode=wal; wal sqlite> pragma journal_mode; wal sqlite> create table t1 (id text); sqlite> insert into t1(id) values (1),(2); sqlite> select * from t1; 1 2 sqlite> pragma wal_checkpoint; 0|3|3 ``` Limbo ``` ./target/debug/limbo test.db Limbo v0.0.13 Enter ".help" for usage hints. limbo> pragma journal_mode; wal limbo> create table t1(id text); limbo> insert into t1(id) values (1),(2); limbo> select * from t1; 1 2 # current the 2nd and 3rd columns are hard coded in limbo to 0 limbo> pragma wal_checkpoint; 0|0|0 ``` Closes #827
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
todos
Context
pragma wal_checkpoint
and sqlite3_wal_checkpoint*Feel free to comment, I will add the missing ones, or add more details.
The text was updated successfully, but these errors were encountered: