fix(core): harden fusion.db pragmas against mid-write crashes

Switch synchronous from NORMAL to FULL and restore the default
wal_autocheckpoint of 1000 (was 100). The aggressive checkpoint
cadence + NORMAL fsync left a wide window for torn pages whenever
a writer crashed mid-checkpoint, which is exactly what happened
when node:sqlite SIGSEGV'd inside pager_write and corrupted the
production db.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-19 22:05:36 -07:00
parent 61dd439e20
commit a164e84b46
3 changed files with 16 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Harden `fusion.db` against process crashes: switch `PRAGMA synchronous` from `NORMAL` to `FULL` and restore the default `wal_autocheckpoint = 1000` (was 100). Repeated node:sqlite SIGSEGVs inside `pager_write` had been corrupting the db; the previous settings left a wide window for torn pages whenever a writer crashed mid-checkpoint. The small fsync cost is worth the durability win.