Skip to content

fix(store): open the workspace database in WAL mode - #804

Merged
omartelo merged 1 commit into
mainfrom
fix/store-wal
Oct 17, 2026
Merged

omartelo merged 1 commit into
mainfrom
fix/store-wal

Conversation

@omartelo

@omartelo omartelo commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

The store opened SQLite with the default rollback journal and synchronous=FULL, so every commit created, synced and deleted a journal file. On Windows that costs ~37ms a commit: the timings from #802 put internal/store at 150s on the Windows runner against 8s on Linux, and it alone set the wall time of the whole backend suite. lich itself pays the same on every write on Windows.

open now adds journal_mode(WAL) and synchronous(NORMAL) to the DSN. Commits append to lich.db-wal; a power loss can drop the last commits, never corrupt the file.

  • TestOpenCommitsWithoutAJournalFilePerWrite pins both pragmas (fails on main with delete / 2).
  • Locally on Linux internal/store went from 8s to 3.3s; on Windows, read this PR's Backend tests step against the ~185s median (the per-package table arrives with ci: report the slowest Go packages and tests in every job summary #802).
  • docs/ceilings.md: the database is now three files while lich runs, so copying lich.db alone off a running lich misses recent commits.

No CHANGELOG entry: nothing a user sees changes beyond writes getting cheaper.

@omartelo
omartelo merged commit 71533ab into main Oct 17, 2026
7 checks passed
@omartelo
omartelo deleted the fix/store-wal branch October 17, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant