Skip to content

feat(bulk-submit): ingest a manifest's output files concurrently (fan-out) - #933

Merged
smunini merged 1 commit into
mainfrom
feat/bulk-submit-fan-out
Sep 4, 2026
Merged

feat(bulk-submit): ingest a manifest's output files concurrently (fan-out)#933
smunini merged 1 commit into
mainfrom
feat/bulk-submit-fan-out

Conversation

@angela-helios

Copy link
Copy Markdown
Contributor

Why

A worker processed a manifest's output files one at a time. Since the bottleneck is per-resource CPU, one sequential worker is one core's worth — and a concurrent-writer backend (PostgreSQL) sits mostly idle.

What

HFS_BULK_SUBMIT_FILE_CONCURRENCY (default 1 = today's sequential behavior) ingests up to N of a manifest's files at once through a bounded buffer_unordered stream, so their fetch, parse, and write overlap. Counts accumulate into shared atomics; per-file failures are recorded and counted without aborting the manifest, and only a storage error on the bookkeeping path aborts the job — identical semantics to the sequential loop.

Measured

On the 31 GB benchmark manifest, a single submission (no manual splitting): ~5× on PostgreSQL (concurrent writers scale), ~1.4× on SQLite (the single writer caps it). Combined with the search-index allowlist, this brings the full 31 GB import to ~30 minutes, fully searchable.

Tests

  • test_fan_out_ingests_every_file_of_a_multi_file_manifest — a 6-file / 6-type manifest at concurrency 4: every resource stored, counts complete, one receipt per type.
  • Existing bulk-submit worker suite green; compiles with --features postgres.

…-out)

A worker processed a manifest's output files one at a time. With a
concurrent-writer backend (PostgreSQL) that leaves most of the machine
idle: the bottleneck is per-resource CPU, and one worker is one core's worth.

HFS_BULK_SUBMIT_FILE_CONCURRENCY (default 1 = today's sequential behavior)
runs up to N files at once through a bounded buffer_unordered stream, so
their fetch, parse, and write overlap. Counts accumulate into shared atomics;
per-file failures are recorded and counted without aborting the manifest,
and only a storage error on the bookkeeping path aborts the job — the same
semantics as the sequential loop.

Measured on the 31GB benchmark manifest, single submission: ~5x on
PostgreSQL (concurrent writers), ~1.4x on SQLite (single writer caps it).
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.50000% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/persistence/src/core/bulk_submit_worker.rs 89.39% 21 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

2 participants