Skip to content

Windows install round 4: PGlite 0.5.4 + quarantine of partially-initialized data directories - #10

Merged
dchevalier18 merged 1 commit into
mainfrom
claude/csbg-intake-review-roadmap-csjig7
Jul 12, 2026
Merged

Windows install round 4: PGlite 0.5.4 + quarantine of partially-initialized data directories#10
dchevalier18 merged 1 commit into
mainfrom
claude/csbg-intake-review-roadmap-csjig7

Conversation

@dchevalier18

Copy link
Copy Markdown
Owner

Summary

The self-diagnosing installer did its job — the log excerpt identified the real root cause of every runtime 500 since round 2.

Root cause

electric-sql/pglite#794: a PGlite data directory left partially initialized by a crashed instance aborts every subsequent open with RuntimeError: Aborted(). The round-2 crashed build workers poisoned data\pglite on the test machine, and every retest since has been opening that same corrupted directory — which is why the absolute-path change didn't help.

Changes

  • @electric-sql/pglite ^0.3.16^0.5.4 — adds NodeFS data-directory locking (#892), which prevents this corruption class entirely, and fails with a clear message instead of a WASM abort when a directory is unusable. Smoke, 69 tests, and the production build are green on 0.5.4 with drizzle 0.45.
  • Driver-level quarantine: a non-empty data dir lacking the markers of a completed initialization (PG_VERSION + postgresql.conf) is moved aside as <dir>.corrupt-<timestamp> — never deleted — and the engine initializes fresh. Verified end-to-end: a deliberately corrupted directory recovers automatically; healthy directories are untouched.

Windows retest after merge

# one-time cleanup of the poisoned directory from round 2 (no real data exists —
# setup never completed on this machine):
Remove-Item -Recurse -Force C:\CAPTrellis\data\pglite
# pull the update, then:
deploy\windows\install.cmd

(Keep .env.local this time — the absolute path in it is correct.)

🤖 Generated with Claude Code

https://claude.ai/code/session_014iDzjNAoM7NyKUorQ11wro


Generated by Claude Code

…artially-initialized data dirs

The self-diagnosing installer surfaced the real error: PGlite WASM
Aborted() on every disk-mode open. Root cause (electric-sql/pglite#794):
the round-2 crashed build workers left data\pglite PARTIALLY INITIALIZED,
and a poisoned data dir aborts every subsequent open — the absolute-path
change couldn't help because the directory itself was corrupt.

- @electric-sql/pglite ^0.3.16 -> ^0.5.4: adds NodeFS data-directory
  locking (prevents the multi-instance corruption class entirely,
  electric-sql/pglite#892) and fails with a clear message instead of a
  WASM abort when a dir is unusable. Smoke/tests/build green on 0.5.4
  with drizzle 0.45
- Embedded driver now QUARANTINES a non-empty data dir that lacks the
  markers of a completed initialization (PG_VERSION + postgresql.conf):
  moved aside as <dir>.corrupt-<timestamp> — never deleted — and the
  engine initializes fresh. Verified end-to-end: a deliberately corrupted
  dir recovers, real data dirs are untouched

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iDzjNAoM7NyKUorQ11wro
@dchevalier18
dchevalier18 marked this pull request as ready for review July 12, 2026 14:59
@dchevalier18
dchevalier18 merged commit fc123d4 into main Jul 12, 2026
1 check passed
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.

2 participants