Skip to content

fix(#6468): JSONL importer must fail loudly when records are skipped - #6498

Merged
lvca merged 6 commits into
ArcadeData:mainfrom
waterWang:fix-6468-jsonl-importer-errors
Aug 21, 2026
Merged

lvca merged 6 commits into
ArcadeData:mainfrom
waterWang:fix-6468-jsonl-importer-errors

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Problem

The JSONL importer catches every per-record exception, logs it at SEVERE, and continues. load() commits and returns normally regardless — so a partial import reports success. A single failed vertex leaves its RID out of the RID map, which then cascade-drops every edge touching it.

Fix

  1. loadDocument/loadVertex/loadEdge: each catch block now increments context.errors and, in the default -onRowError abort mode, rethrows ImportException to fail the whole import. Abort-on-error is the existing default (onRowError=abort); the -onRowError skip flag acts as the --skip-errors override.
  2. loadEdge early-return paths: the two out/in vertex not found branches now also increment context.errors and, in abort mode, throw ImportException.
  3. load(): catches ImportException, rolls back the in-flight transaction batch (only when this format owns the transaction — matches JSONImporterFormat's callerTransactionActiveOnEntry contract), and marks the import as failed.
  4. finally: now only commits when a transaction is still active (prevents commit-after-rollback masking the original exception).

The existing context.errors counter (already surfaced in ImporterContext.toMap()) tracks the error count for both modes.

Closes #6468

@codacy-production

codacy-production Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@mergify

mergify Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@lvca lvca self-assigned this Aug 21, 2026
@lvca lvca added this to the 26.9.1 milestone Aug 21, 2026
lvca and others added 3 commits August 21, 2026 02:08
…tralize per-record error handling

save() could still succeed before the RID-map bookkeeping failed (e.g. a malformed "r"
field), leaving an orphaned record with -onRowError skip: persisted, uncounted, and
unreachable by ridIndex - the same cascade the fix targets, just one step later. Parse
and validate the old RID before save() so that path can no longer happen, and give
skip mode true per-record atomicity (commit/rollback per row instead of riding along in
the batched commit) so a failed row can never be durably persisted by a later periodic
commit. Also fold the five duplicated catch blocks (document/vertex/two edge branches)
into load()'s dispatch loop so logging, error counting and the abort/skip decision live
in one place, which incidentally brings schema-load failures under the same "no
partial commit on abort" guarantee the rest of the fix provides.

Regression tests cover the ghost-record scenario directly and the edge cascade-drop
scenario described in ArcadeData#6468 (a failed vertex's referencing edge is now a counted,
rolled-back error instead of a silent drop).
@lvca
lvca merged commit 86c4338 into ArcadeData:main Aug 21, 2026
19 of 22 checks passed
lvca added a commit to ArcadeData/arcadedb-docs that referenced this pull request Aug 21, 2026
Was never documented even though the CSV and JSON importers already respected it;
now the JSONL importer does too (ArcadeData/arcadedb#6498), making the gap more
consequential since it governs whether an import fails loudly or silently drops
bad records by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSONL import swallows per-record errors and reports success; a failed vertex cascade-drops its edges

2 participants