Skip to content

[iris] Complete the controller-backend phase boundary - #8762

Merged
rjpower merged 6 commits into
mainfrom
weaver/iris-controller-neutral-reconciliation
Aug 31, 2026
Merged

[iris] Complete the controller-backend phase boundary#8762
rjpower merged 6 commits into
mainfrom
weaver/iris-controller-neutral-reconciliation

Conversation

@rjpower

@rjpower rjpower commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Make Controller the sole owner of Iris persistence, worker liveness, lifecycle policy, and phase sequencing. TaskBackend now receives complete request records for initialization, scheduling, reconciliation, observation, autoscaling, and capacity removal. It returns decisions, exact runtime observations, or provider effects without receiving a controller database, transaction, transition reader, or liveness tracker.

Worker and Kubernetes reconciliation now produce the same exact task-attempt facts. The controller reloads state after provider I/O, fences each observation by Attempt UID, applies one lifecycle path, and commits before requesting physical capacity removal. Status and capacity are published on the control thread from controller-supplied facts; autoscaler recovery and updates return state for the controller to persist.

Delete BackendRuntime and DbBackendWorkerStore, and separate provisioning from worker teardown. The branch removes 1,824 lines and adds 1,536. RPC schemas and client behavior are unchanged. The controller, backend, and lifecycle journey suites pass 1,240 tests; repository formatting, Ruff, and Pyrefly checks pass.

Return neutral worker-fleet or direct-task observations from
TaskBackend.reconcile. The controller now reloads current transition state,
fences direct-provider reports by exact Attempt UID, applies task policy, folds
worker liveness, commits effects, and requests teardown after commit.

This removes controller DB transition readers and state-machine policy from the
Kubernetes and worker backend implementations. A late Kubernetes observation
from a deleted and recreated job can no longer update the replacement Attempt.
Make DbTransitionReader the only production source for reconciliation
snapshots. BackendWorkerStore now contains worker lifecycle reads only, which
prevents transition policy from drifting back into backend implementations.
@rjpower rjpower added agent-generated Created by automation/agent agentic-lint Local agentic lint review completed labels Aug 28, 2026

@rjpower rjpower left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't understand this "folding", where did that come from, and why are you leaking details about the backend type (isinstance) to the reconcile coordination layer?

Comment thread lib/iris/src/iris/cluster/controller/reconcile/snapshot.py Outdated
Comment thread lib/iris/src/iris/cluster/controller/reconcile/coordinator.py Outdated
Normalize worker RPC and Kubernetes results into one exact task-observation shape with orthogonal worker-health events. Apply every observation through the same controller-owned lifecycle path, without backend-type dispatch or a tagged result union.
@rjpower

rjpower commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Reworked the reconciliation boundary in 901007e. The tagged observation union and coordinator are gone; both worker RPC and Kubernetes adapters now return the same exact task-observation records plus optional worker-health facts. One controller operation validates Attempt identity, applies lifecycle policy, and accounts for health without inspecting backend kind. The focused controller/Kubernetes/worker-lifecycle suite passes 1,178 tests, and lint/Pyrefly pass.

Move worker liveness, controller snapshots, status and capacity publication,
autoscaler inputs, recovery, pruning, and teardown sequencing under Controller
ownership. TaskBackend now receives complete phase requests and returns bounded
decisions, observations, or provider effects without reading Iris persistence.

Delete BackendRuntime and DbBackendWorkerStore. Worker and Kubernetes adapters
retain provider I/O behind one registered backend. Physical capacity removal is
a separate post-commit phase, so autoscale no longer multiplexes provisioning
and teardown.
Split control-tick input assembly into phase-specific builders and carry
submit-time capacity validation in one JobFeasibilityRequest. Dashboard tests
now reuse the production observation-input builder, while transition tests call
the production liveness fold instead of reproducing it.

Update the reconcile and benchmark documentation to describe controller-built
worker targets, fresh transition reads, and post-commit capacity removal.
@rjpower rjpower changed the title [iris] Move reconciliation policy into the controller [iris] Complete the controller-backend phase boundary Aug 29, 2026
…r-neutral-reconciliation

# Conflicts:
#	lib/iris/tests/cluster/controller/test_dashboard.py
@rjpower
rjpower merged commit 61596dd into main Aug 31, 2026
32 checks passed
@rjpower
rjpower deleted the weaver/iris-controller-neutral-reconciliation branch August 31, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-generated Created by automation/agent agentic-lint Local agentic lint review completed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant