Investigating empty reads after a very large transaction on Bun/macOS (0.4.6)

オープン
#1,200 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
bun, postgresql, typescript, wasm
領域
databases

調査の方向性

The issue does not identify a PGlite source file, test, or entry point, and it has no minimal standalone reproduction. Start by investigating how to reproduce empty reads after a large transaction, then capture diagnostics that distinguish engine results from driver parsing or application transaction misuse. Done means the failure is isolated with evidence; the issue currently asks for diagnostic direction rather than defining a fix.

索引モデルが issue の本文から書いたものです。

説明

We are investigating an observed failure after a very large PGlite transaction in Prompt Studio. We have bounded and made the application migration resumable, but have not isolated the subsequent empty reads to PGlite itself. Is this a known failure mode, or is there a useful diagnostic build/trace to capture next?

Environment: macOS arm64, Bun, @electric-sql/pglite 0.4.6, Drizzle 0.45.2. Application source: https://github.com/pufflyai/prompt-studio/pull/1776 (ordered storage host). The incident occurred on the 2026-11-07 nightly host, after upgrading a legacy database.

Observed workload:

  • 66,129 legacy records for one owner, including 51,437 tombstones.
  • 84,669 pending legacy frames, about 110 MB, retained locally.
  • Approximately 977,000 SQL statements in one outer transaction. Owners used nested savepoints; no transaction was committed between migration pages.
  • Roughly 100% of one CPU core, RSS up to 6.4 GB, 373–614 seconds. PGlite's immediately resolved query promises kept the application's macrotask queue from running during the chain.

Last statements reported by the trace, after one owner savepoint was released:

SAVEPOINT sp1;
SELECT id FROM projects WHERE id = $1 FOR UPDATE;
INSERT INTO storage_documents (...) VALUES (...) ON CONFLICT DO NOTHING;
INSERT INTO storage_record_projections (...) VALUES (...) ON CONFLICT DO NOTHING;
SELECT revision FROM storage_record_projections
WHERE workbench_id = $1 AND extension_id = $2 FOR UPDATE;
-- Application received no row, then threw while reading row.revision.
ROLLBACK TO SAVEPOINT sp1;
ROLLBACK;

After rollback, queries for the existing projects in the same process/instance also returned no rows: the projects endpoint returned []. A fresh process opening the same database files read all 11 projects. Restarting with the old migration repeated the long transaction and failure. No PostgreSQL SQL error before the empty result was captured.

Control on a backup: removing the 90,297 legacy outbox rows across the project let conversion finish in about 30 seconds (~130,000 statements); project reads then worked. This changes the transaction workload, so it does not establish a PGlite bug or rule out application/concurrency/driver behavior.

The original affected database contains private user content and is not attached. A synthetic application fixture with 60,000 records (48,000 tombstones) and 80,000 pending frames completes after our batching change and preserves project reads, but does not reproduce the post-transaction empty reads. We have not yet produced a minimal standalone SQL reproduction. We are preserving this distinction rather than claiming a demonstrated engine corruption.

Would engine/driver memory growth, nested savepoint bookkeeping, or an invalidated result buffer be useful areas to instrument? What diagnostics would distinguish an engine result from driver parsing or application transaction misuse after such a workload?

主要言語
TypeScript
スター
16.3k
フォーク
474
平均マージ
23時間 53分
マージ済み PR(30日)
53

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

electric-sql/pglite のほかの issue

electric-sql/pglite の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。