Skip to content

Runs: retry a failed run from a safe node/checkpoint without repeating successful side effects #305

Description

@LouisDeconinck

Current state

Duckle has durable run IDs, node outcomes, item checkpoints, content-addressed stage caching, partition/backfill primitives in progress, and cancellation.

A failed full run still generally requires starting the pipeline again and relying on each stage’s incremental/cache behavior.

Problem

For a long pipeline:

download -> parse -> normalize -> enrich -> validate -> publish

a transient failure near the end should not require repeating hours of deterministic upstream work.

At the same time, “resume from node” is unsafe if it silently skips or repeats side-effecting stages.

Proposed solution

Add an explicit retry command that creates a new linked run.

Examples:

duckle run retry <run_id>
duckle run retry <run_id> --from validate
duckle run retry <run_id> --failed-partitions

Safety checks

Before reuse, verify:

same release/pipeline hash, unless explicitly overridden
same normalized non-secret parameters
same partition
required upstream cache/artifacts still exist
content hashes match
runtime compatibility

If any prerequisite is unavailable, fail clearly or require the operator to choose an earlier start.

Side effects

Never implicitly reuse or repeat a side-effecting sink.

Classify stages as:

pure/deterministic and reusable
read-only but non-deterministic
side-effecting/idempotent
side-effecting/unsafe to repeat

For unsafe stages, require an explicit operator choice.

Atomic publish groups can safely rerun as a complete publication where supported.

Provenance

The new run should record:

parent_run_id
retry reason
requested start node/partition
reused stages and source run/cache keys
re-executed stages
operator/actor

The original failed run remains immutable.

Node output contract

A stage can be reused only when Duckle has a durable output reference and verified cache key, not merely because the old log says “succeeded.”

UI/API/MCP

Expose the same plan as a dry run before execution:

reuse nodes A-D
execute nodes E-G
refuse/require confirmation for sink H

Scope

This is not process-level checkpoint restoration.

It is a safe new run that reuses verified durable outputs.

Acceptance criteria

  1. retrying a late failure can reuse valid deterministic upstream stages;
  2. changing release/parameters invalidates reuse by default;
  3. unsafe side effects are never repeated silently;
  4. the retry is a new run linked to the original;
  5. the dry-run plan explains every reuse/re-execution decision.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions