SqlEventJournal: remote catch-up exceeds SQLite's bind-variable limit
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
What version of Effect is running?
[email protected] and @effect/[email protected] (npm latest), Node v26.11.1, macOS 27.0 arm64. SQLite 3.53.4 reports MAX_VARIABLE_NUMBER=32766.
Source-checked main (4ee3a6799f) and v4/next-minor (4f49b72685): both still pass each non-empty imported batch to one insert.
What steps can reproduce the bug?
A SQLite journal import of 6,554 small RemoteEntry values through SqlEventJournal.writeFromRemote, with default settings, fails while preparing the batch insert and rolls back. This is the minimal journal reproduction:
npm install --min-release-age=0 [email protected] @effect/[email protected]
Save as repro.mjs:
import { Cause, Effect, Exit } from "effect"
import { EventJournal, SqlEventJournal } from "effect/eventlog"
import * as Sqlite from "@effect/sql-sqlite-node/SqliteClient"
const count = Number(process.argv[2] ?? 6554)
const program = Effect.gen(function*() {
const journal = yield* SqlEventJournal.make()
const remoteId = EventJournal.makeRemoteIdUnsafe()
const entries = Array.from({ length: count }, (_, i) => new EventJournal.RemoteEntry({
remoteSequence: i + 1,
entry: new EventJournal.Entry({
id: EventJournal.makeEntryIdUnsafe({ msecs: 1792900000000 + i }),
event: "Set",
primaryKey: String(i),
payload: new Uint8Array([1])
})
}))
const result = yield* Effect.exit(journal.writeFromRemote({
remoteId,
entries,
effect: () => Effect.void
}))
console.log({
count,
exit: result._tag,
stored: (yield* journal.entries).length,
next: yield* journal.nextRemoteSequence(remoteId)
})
if (Exit.isFailure(result)) console.log(Cause.pretty(result.cause))
}).pipe(
Effect.provide(Sqlite.layer({ filename: ":memory:" })),
Effect.scoped
)
await Effect.runPromise(program)
node repro.mjs 6553
node repro.mjs 6554
What is the expected behavior?
Both valid batches commit and advance the remote cursor. The batch-import contract commits after the callback succeeds and declares no entry-count limit. A backlog delivered by the built-in remote should not require the caller to resize the journal's SQL statements.
What do you see instead?
{ count: 6553, exit: 'Success', stored: 6553, next: 6554 }
{ count: 6554, exit: 'Failure', stored: 0, next: 0 }
EventJournalError -> SqlError: Failed to prepare statement -> Error: too many SQL variables
A 10,000-entry import fails the same way. In the network catch-up recorded for this release, the failed journal and projection writes remain empty, and the remote consumer retries without advancing its cursor.
Additional information
insertEntries creates one multi-row insert with five bound columns per entry. Therefore, 6,554 entries require 32,770 binds and 10,000 require 50,000. writeFromRemote passes the complete uncommitted imported batch to it; writeMany shares the helper and reproduces the same boundary.
EventLog.runRemote takes all queued changes into this call and retries a failed batch.
- 主要言語
- TypeScript
- スター
- 16.7k
- フォーク
- 808
- 平均マージ
- 10時間 17分
- マージ済み PR(30日)
- 850
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Effect-TS/effect のほかの issue
-
[email protected]: crypto declarations require a global CryptoKey type, breaking Node-only type-checks with @types/node 22 and 24対応中かも @effect-bot が今日担当しました。 オープンbug
Effect-TS/effect#10196 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
OpenApi.fromApi (4.1.0) emits duplicate component schemas with a _1 suffix when the encoded side differs再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
メンテナーはふだん 1 日以内に返信
-
`fromJsonSchemaDocument`: import open `patternProperties`対応中かも @effect-bot が 2 日前に担当しました。 オープン
Effect-TS/effect#10048 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
Effect-TS/effect の issue をすべて見る
似ている issue
-
bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
PhyberApex/kuroshiro#1687 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
microsoft/monaco-editor#5563 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
awslabs/visual-asset-management-system#937 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100