Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

SqlEventJournal: remote catch-up exceeds SQLite's bind-variable limit

クローズ
#10,012 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

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

@effect-bot がすでに取り組んでいます。

2026年10月27日 から。

  • #10014 @effect-bot による — マージ済み

評価

この 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

Effect-TS/effect のほかの issue

Effect-TS/effect の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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