losfair / mvsqlite

Distributed, MVCC SQLite that runs on FoundationDB.
https://github.com/losfair/mvsqlite/wiki
Apache License 2.0
1.39k stars 39 forks source link

Virtual version counter #19

Closed losfair closed 2 years ago

losfair commented 2 years ago

Previously the "file change counter" field in the database header is overridden with zero, in order to notify SQLite that its page cache is out-of-date. This however only works for write transactions and is not sufficient for read transactions.

This PR introduces a virtual version counter that always increments by 2 for each transaction. This (hopefully) would flush SQLite's own page cache every time.