Repository navigation
Description
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_deliveryrenames 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::ExtractPullsimilarly renames the extracted page set to{source}.csv;AdvanceSfCursorqueues ingest and advances the Salesforce watermark.runctx.rs::find_deliveriesignores 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
athvin commentedon Nov 9, 2026
Claimed — working in #1006 (draft), 2026-11-09T03:57:48Z. Closing that PR releases the claim. Plan and gates are in its body.
wip: claim #1002 — immutable queued deliveries
fix(ingest): pin queued jobs to immutable deliveries (#1006)