CLI: SQLite import fails on graphs larger than 512MB (V8 string limit)

Aperta
#1,526 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, ocaml, sqlite
Ambito
backend, cli

Direzione di ricerca

Start by reading cli/lib/platform/node/cli_unix.ml, especially read_binary_file and its use of Node.Fs.readFileSync path latin1`. Trace how that data reaches the worker import API and identify a binary transport that avoids the V8 string limit. Reproduce with a SQLite file larger than 512 MiB and confirm import succeeds while small imports still work.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

Importing a valid SQLite database larger than ~512 MiB into the Melange/OCaml CLI fails with an exception before reaching the graph worker:

{
  "status": "error",
  "error": {
    "code": "exception",
    "message": "Cli_unix.Cli_unix_error/1(4readCannot create a string longer than 0x1fffffe8 characters)"
  }
}

Environment

  • Logseq 2.0.2 beta (Melange CLI)
  • Revision: 533ac4382a7b69baa98de3a973bff90305b212dc
  • Platform: macOS (installed native bundle)

Cause

In cli/lib/platform/node/cli_unix.ml, read_binary_file is implemented using Node.Fs.readFileSync path latin1. This wraps the binary data in a V8 string, which hits the 0x1fffffe8` character limit (~512MB) for the Latin-1 representation before the bytes can be passed to the worker import API.

Reproduction

Reproduced using a synthetic, valid sparse SQLite database:

  • Size: 536,875,008 bytes (131,073 pages).
  • Validated with sqlite3 PRAGMA quick_check (returns ok) before import.
  • CLI command: ELECTRON_RUN_AS_NODE=1 logseq .../logseq-cli.js graph import --type sqlite --path ...

A normal small SQLite import succeeds on the same build.

Suggested Fix

Pass the SQLite binary data to the worker without wrapping the full file in a V8 string, or use a more efficient transport for large binary files in the CLI.

Lingua principale
Nessun dato sulla lingua
Stelle
29
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di logseq/db-test

Tutte le issue di logseq/db-test

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.