Bundled SQLite core predates the 3.51.3 WAL-reset fix (silent loss of committed writes under concurrent checkpointing)
メンテナーはふだん 11 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
まず、libsql-ffi crates に含まれている SQLite ソースと同梱された sqlite3.h を見つけ、次に、同梱されたチェックポイントパスを SQLite 3.51.3 の WAL-reset 修正と比較します。説明されている同時書き込み、外部 WAL チェックポイント処理、コミット済みキーのアサーション、integrity_check のラウンドを使って、更新またはバックポートを検証します。
索引モデルが issue の本文から書いたものです。
説明
Summary
The SQLite core bundled in libsql-ffi predates the upstream fix for the WAL-reset race — the ~16-year-old bug where a write transaction racing a checkpoint during WAL reset confuses the checkpointer about which pages were copied, so committed writes are silently lost or the database corrupts. Upstream SQLite fixed it in 3.51.3.
Versions checked (by reading the shipped sqlite3.h in the crates, 2026-08-12):
libsql-ffi0.9.30 → bundledSQLITE_VERSION "3.45.1"— pre-fixlibsql-ffi0.10.0-pre.4 → bundled 3.47.0 — still pre-fix
As far as I can tell there is no libsql release carrying the fix.
Why this matters to libsql users specifically
The triggering topology is a separate process checkpointing while other connections write — exactly the shape of running Litestream (or any external checkpointer) against a WAL database. That is a common libsql/sqlite deployment pattern. It is a tight-timing race, but Tailscale hit it repeatedly in production over six months, and Antithesis reproduced it deterministically in ~15 minutes.
Sources:
- SQLite fix (3.51.3): the added WAL-reset check in the checkpoint path
- Antithesis reproduction: https://antithesis.com/blog/2026/wal-reset-bug/
- Tailscale production postmortem: https://tailscale.com/blog/sqlite-wal-reset-bug
Ask
Rebase the bundled core to ≥ 3.51.3, or backport the checkpoint-path fix to the currently bundled versions. Happy to provide our reproduction/verification harness methodology if useful: N writer processes through the client, an external process issuing wal_checkpoint(TRUNCATE/RESTART) aggressively, asserting every committed key remains readable plus integrity_check per round. (For what it's worth: on 3.45.1 we did not reproduce the race in bounded runs — expected for a tight-timing bug, and not evidence of safety; the upstream fix plus that harness passing on 3.51.3 is what we ended up trusting.)
- 主要言語
- C
- スター
- 17.3k
- フォーク
- 562
- 平均マージ
- 10日 15時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tursodatabase/libsql のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tursodatabase/libsql#2320 ·
メンテナーはふだん 11 日以内に返信
-
`cloudflare` feature: hrana streams are never closed対応中かも @pcbeingused333 が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
tursodatabase/libsql#2312 ·
メンテナーはふだん 11 日以内に返信
-
bottomless: finished S3 upload tasks are never reaped, so sqld memory grows by ~10 KB per WAL batch対応中かも @pavanmanishd が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
tursodatabase/libsql#2298 · コメント 1 件 ·
メンテナーはふだん 11 日以内に返信
-
Rust local Row::get_value truncates embedded NUL TEXT and panics on malformed UTF-8 (0.9.30)対応中かも @Sanjays2402 が 35 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
tursodatabase/libsql#2285 ·
メンテナーはふだん 11 日以内に返信
-
libsql-ffi: broken builds under Nix on macOS対応中かも @frectonz が 85 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
tursodatabase/libsql#2275 ·
メンテナーはふだん 11 日以内に返信
tursodatabase/libsql の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JulianKemmerer/PipelineC#395 ·
-
upstream-blocked
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libretro/parallel-n64#858 ·