Closed hifi closed 11 months ago
This doesn't pass tests because they expect the WAL not to be checkpointed during snapshots. I'm looking into it if I can change the tests to match the new behavior but they are very specific about it and the first WAL index (0) is basically never used when we always checkpoint on snapshot.
Figured out the test fixes. Should be good if "losing" zero index is acceptable.
The intention of the code is to do a checkpoint before starting to write out the snapshot. Executing a manual checkpoint will at worst make Litestream lose the track of the WAL as it will in specific circumtances flush out the single page in the WAL file out.
Using the public checkpoint function of the database to issue a managed passive checkpoint will ensure the sequence table is written after and the position of the WAL isn't lost.
Fixes #521