Files
turso/core
Jussi Saurio eeceefe49d Merge 'fix/wal: only rollback WAL if txn was write + fix start state for WalFile' from Jussi Saurio
Closes #2363
## What
The following sequence of actions is possible:
```
Some committed frames already exist in the WAL. shared.pages_in_frames.len() > 0.

Brand new connection does this:
BEGIN
^-- deferred, no read tx started yet, so its `self.start_pages_in_frames` is `0`
       because it's a brand new WalFile instance

ROLLBACK   <-- calls `wal.rollback()` and truncates `shared.pages_in_frames` to length `0`

PRAGMA wal_checkpoint();
^-- because `pages_in_frames` is empty, it doesnt actually
checkpoint anything but still sets shared.max_frame to 0, causing effectively data loss
```
## Fix
- Only call `wal.rollback()` for write transactions
- Set `start_pages_in_frames` correctly so that this doesn't happen even
if a regression starts calling `wal.rollback()` again

Reviewed-by: Preston Thorpe (@PThorpe92)

Closes #2366
2025-07-31 16:16:20 +03:00
..
2025-07-28 14:49:07 -03:00
2025-07-16 14:02:56 +04:00
2025-07-14 11:20:49 +04:00
2025-06-23 19:52:13 +01:00
2025-06-30 10:01:03 +03:00
2025-01-28 14:55:38 -05:00
2025-06-23 19:52:13 +01:00
2025-07-30 13:34:49 +05:30
2025-01-28 14:55:38 -05:00
2025-07-26 19:37:39 -05:00
2025-06-23 19:52:13 +01:00
2025-07-23 16:58:22 -04:00
2025-07-30 17:33:59 -03:00
2025-06-30 09:54:13 +03:00