noCV
PBATCH-108 · Recover and verify

Resume an interrupted catalog import from a committed checkpoint

Practice briefStoryExpert

An import loses its process after several committed batches. Restarting from a byte offset inside a quoted multiline record corrupts the next batch.

Focused work estimate
6h + prerequisites
Priority in the scenario
High
Engineering practice
Checkpointing · Idempotency

Estimated field mix

  • Data engineering50%
  • Database engineering30%
  • Distributed systems20%

Field percentages are editorial estimates of the ticket's engineering focus. They total 100%; they are not measured time, proficiency scores, or ownership evidence.

Your next step

Review it, then add it to your workspace.

The board opens an editable draft; nothing is saved until you confirm it. Sign-in and workspace permissions apply, and Demo boards remain ephemeral.

Project context

A fictional wholesaler imports supplier rows into a staging catalog. The current prototype reads the entire file into memory and restarts from zero after a failure. Build the prototype and generated CSV fixture locally before measuring improvements.

Setup prerequisites

  • Generate a deterministic 250,000-row synthetic CSV with quoted newlines, invalid records and a stated maximum record size.
  • Create a disposable staging database and an import process constrained to 256 MiB; record runtime and available CPU.

Preceding work

Complete these dependencies, or supply their agreed outputs before taking this ticket.

Acceptance criteria

  • Bind checkpoints to source digest, parser configuration and import identity.
  • Checkpoint only a valid record boundary whose writes are committed, with an explicit idempotency rule for uncertain completion.
  • Reject a changed source or configuration and preserve the previous import for inspection.

Implementation constraints

  • A raw newline is not a CSV record boundary. State whether resumption seeks to a validated boundary or replays and skips already committed record identities.

Verification to include

  • Terminate after commit but before checkpoint acknowledgement, resume and compare the final digest with an uninterrupted import.
  • Change one source byte and attempt resumption; no additional staging writes may occur.

Deliverables

  • Checkpoint protocol, resume implementation and interruption matrix

Rollout and recovery

Enable resumption only after the failure matrix passes; retain the source and last valid checkpoint when recovery is refused.

Value of the work

For the engineer: Practice streaming, backpressure, allocation analysis and resumable work while retaining exact import semantics.

For the team: Develop a repeatable import performance and recovery exercise that exposes memory, throughput and data-quality tradeoffs.

Evidence boundaries

Outcome Evidence: Tests, patches, and runbooks are requested deliverables. They become Outcome Evidence only through a qualified Mission and immutable Evidence IDs.

Ownership Evidence: Independent adaptation must be observed under a declared verification policy and cite immutable Evidence IDs. Completing a planning ticket establishes no Ownership Evidence.