CLI: SQLite import fails on graphs larger than 512MB (V8 string limit)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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(returnsok) 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.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 29
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của logseq/db-test
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Potential Dataloss: Deleting an entry from the property page's node table has no confirmation dialogCó thể đã có người làm @tiensonqin đã nhận 59 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Disabling Flashcards in Settings does not disable Flashcard shortcuts or tagsCó thể đã có người làm @tiensonqin đã nhận 60 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tất cả issue của logseq/db-test
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
jembi/openhim-core-js#1243 ·
-
go good first issue test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
writerslogic/scrivener-mcp#272 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug external-issue to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 3-5 ngày Mức phù hợp với người mới 62/100
syuratick/LoveQuiltsUSA#39 ·