Skip to content

Pin accepted deliveries to immutable inputs before queued ingestion #1002

Closed

Description

@athvin

Found while preparing #993 under E9 (#514). Distinct from #957, which makes the lake INSERT/tombstone transaction atomic.

Evidence

  • er-server/src/lib.rs::finish_delivery renames every accepted upload/push/S3 delivery to {drop_root}/{source}.csv, then queues a job carrying source and delivery_id. Its own comment promises two accepted deliveries run twice.
  • dags/tasks.rs::ExtractPull similarly renames the extracted page set to {source}.csv; AdvanceSfCursor queues ingest and advances the Salesforce watermark.
  • runctx.rs::find_deliveries ignores the queued delivery identity and rereads every declared source's current CSV.

Source at 3d456d8f.

Concrete interleaving: accept delivery A with record a, accept delivery B of the same source with record b before A's ingest stage runs; both jobs read B, so a never lands. Two queued extract jobs can do the same thing because the second extract was queued before the first extract's downstream ingest. A watermark advanced past A means its lost incremental records need not be extracted again. One active job per dataset does not serialize HTTP delivery producers, nor pin files for later jobs.

Acceptance

  • Publish accepted delivery bytes at an immutable, tenant/dataset-scoped path and durably bind queued ingestion to its exact delivery identity. Do not trust arbitrary client-supplied filesystem paths.
  • All producer paths (upload, push, S3, Salesforce) share the invariant, and an ingest job must consume its declared source/delivery rather than whichever files happen to be latest.
  • Advance Salesforce/S3 cursors only after the exact immutable delivery and its consumption job are durable; retain data until consumption/retry no longer needs it. A partial publication/enqueue failure must be recoverable without silent loss.
  • Regression tests accept A and B before either consumer runs and prove both exact batches land once, with correct receipts. Cover extract-before-ingest ordering, a retry, changed source mappings, and cross-dataset/path isolation.
  • Define the explicit behavior for operator run-all and old jobs without a pinned delivery; do not silently interpret a pinned but missing delivery as an unpinned latest-file run.
  • Pass make check and the real Postgres/lake integration tier. Preserve rust: make ingest deliveries atomic #957's transaction-atomicity work as a separate concern.

This is also the delivery-provenance prerequisite for #993: writeback must never infer provider ownership from bytes that another accepted delivery replaced.

Activity

  1. added
    mvp
    followup
    on Nov 9, 2026
  2. self-assigned this
    on Nov 9, 2026
  3. athvin commented on Nov 9, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #1006 (draft), 2026-11-09T03:57:48Z. Closing that PR releases the claim. Plan and gates are in its body.

  4. added 2 commits that reference this issue on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

followupmvp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions