Skip to content

Phase 4 — delete the legacy in-process dispatch arm #645

Closed

Description

@athvin

Phase 4 of docs/batch-orchestration-design.md: remove the in-process arm now
that every kind runs as per-attempt Kubernetes Jobs.

Blocked by #638 — with no legacy arm, a dispatcher without an in-cluster
identity can run nothing, and local dev is currently downstream of that.

The deletion surface, measured

What Where
run_job and its kind arms dispatcher.rs, 213 lines (1230–1442)
AttemptReporter + ChannelObserver + RunReport reporter.rs, 545 lines; 14 references
ER_DISPATCH_IN_PROCESS one real reader, main.rs:125 (rest are comments)
executor.dagKinds / Executor::handles chart values, deploy.yml (TWO places), executor.rs
pg::FailureClass::classify reporter.rs ×2, dispatcher.rs, lib.rs (dispatch_pg)
jobs/update/fail_or_retry.sql retry branch declared pair + regenerated er-entities
jobs/update/mark.sql declared pair; 9 non-legacy callers
tests/pg_attempt_reporter.rs delete, not port — it asserts the inproc identity
tests/pg_job_retry.rs rewrite against tasks

Two prerequisites are already done

  • dispatch_coverage.rs no longer blocks it (refactor(server): unblock Phase 4's two structural obstacles #611). It used to hard-assert
    a textual match arm for lake_maintain as its own self-check, so deleting
    the arms would have failed the file that proves kinds are routed. It is now
    registry-backed, and its legacy half retires itself when LEGACY_ARM_KINDS
    empties — observed standing down.
  • classify no longer has a new-arm caller (refactor(server): unblock Phase 4's two structural obstacles #611). dags/tasks.rs produces
    er_errors::ErrorClass directly; the substring rules moved to the executor
    boundary with a differential test over 29 strings proving the move changed
    nothing.

Entanglements that are NOT mechanical

  • pg::mark has nine non-legacy callers, including dispatch_pg
    (lib.rs), the cancel route, and three tests. settle.sql cannot stand in
    for mark(job, "running") — its WHERE state IN ('running','canceling')
    guard is the wrong shape for queued → running. Confirm whether plan.sql
    already commits that transition before deleting anything.
  • dispatch_pg's fate needs deciding. It is the injected-runner test helper,
    not the legacy pipeline arm, and pg_profile.rs:212-221 explicitly asserts it
    records no reason ("if it starts to, assert on it here").
  • Deleting executor.dagKinds must not land before the arm, or a kind off
    the allowlist falls through to a run_job that no longer exists.
  • values.yaml's dispatcher resources and terminationGracePeriodSeconds: 300
    are justified entirely by "a killed legacy run strands its row holding the
    dataset's writer lock". That justification evaporates here.

Docs

Amend D-ARGO (context), D-JOBSPEC, D-PROGRESS, D-SIZING, D-TENANCY and add
D-TASKJOB, D-CHANNEL, D-FUSION, D-KUEUE in infrastructure-decisions.md;
infrastructure.md §6; architecture.md line 82 (three indexes, not an
advisory lock). images.yml:11 ("the in-process dispatcher runs the pipeline
itself") becomes wrong.

Accept

make check with the deletions, and make check-kind observed failing once
(a deliberately broken classifier row) before it becomes a required check.

Activity

  1. added
    mvp
    docs-backlog
    on Nov 6, 2026
  2. athvin commented on Nov 7, 2026

    @athvin
    OwnerAuthor

    #638 is resolved (PR #746), so the decision this ticket was blocked on is recorded beside Phase 4 in docs/batch-orchestration-design.md.

    Two things in it change what Phase 4 has to do:

    1. ER_DISPATCH_IN_PROCESS is already unused. It is assigned nowhere in the tree — every occurrence is prose or a comment — and scripts/frontend-dev/up.sh already runs er-dispatcher as its own host process. So "Remove ER_DISPATCH_IN_PROCESS" in this ticket's list is removing the reader in main.rs and the prose, not a live local-dev path. Three documents claimed otherwise and are corrected in docs(batch): decide how local development runs jobs once Phase 4 lands (#638) #746.

    2. Local dev's loss is the executor, not the flag. executor::from_env's third return (None, None) needs KubeApi::in_cluster, so after this ticket a host dispatcher can claim a job and execute nothing. The decision is that job execution points at kind; make run and the host stack keep API-only work.

    One consequence to land deliberately rather than discover: the full-stack tier goes from five passing specs to four, because grow-your-data executes three jobs and cannot be row-seeded. Tracked as #747 so it is not folded into this deletion silently.

  3. self-assigned this
    on Nov 7, 2026
  4. athvin commented on Nov 7, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #756 (draft). Closing that PR releases the claim.

  5. 48 remaining items

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

Metadata

Metadata

Assignees

Labels

docs-backlogmvp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions