From 08b3db104db9d6131f9e05b5fd2f02e897a3dfe4 Mon Sep 17 00:00:00 2001 From: Piotr Kazmierczak <470696+pkazmierczak@users.noreply.github.com> Date: Fri, 11 Jul 2025 15:34:07 +0200 Subject: [PATCH] docs: update reconciler diagram to reflect recent refactors (#26260) Co-authored-by: Tim Gross --- scheduler/README.md | 86 +++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 50 deletions(-) diff --git a/scheduler/README.md b/scheduler/README.md index d825a510b..ddc3a57a3 100644 --- a/scheduler/README.md +++ b/scheduler/README.md @@ -85,40 +85,30 @@ The following diagram illustrates the logic flow of the cluster reconciler: |Compute()| +---------+ | - v - +------------+ - |create a new| allocMatrix is created from existing - | allocation | allocations for a job, and is a map of - | matrix m | task groups to allocation sets. - +------------+ + | | v deployments are unneeded in 3 cases: +---------------------------+ 1. when the are already successful - |cancelUnneededDeployments()| 2. when they are active but reference an older job + | cancelUnneededDeployments | 2. when they are active but reference an older job +---------------------------+ 3. when the job is marked as stopped, but the | deployment is non-terminal v +-----------+ if the job is stopped, we stop |handle stop| all allocations and handle the +-----------+ lost allocations. - | - v - +-------------------------+ sets deploymentPaused and - |computeDeploymentPaused()| deploymentFailed fields on the - +-------------------------+ reconciler. | | | for every task group, this method - v calls computeGroup which returns -+----------------------------+ "true" if deployment is complete -|computeDeploymentComplete(m)| for the task group. -+----------------------------+ computeDeploymentComplete itself - | returns a boolean. + | calls computeGroup which returns ++--------------+-------------+ "true" if deployment is complete +| computeDeploymentComplete | for the task group. ++--------------+-------------+ computeDeploymentComplete itself + | returns a boolean and a + | ReconcileResults object. | - | +------------------------------------+ - | | computeGroup(groupName, all | - +------------->| allocations) | - | +------------------------------------+ + | +---------------+ + +----------------------->| computeGroup | + | +---------------+ | | contains the main, and most complex part | of the reconciler. it calls many helper @@ -134,35 +124,31 @@ The following diagram illustrates the logic flow of the cluster reconciler: | - filterByRescheduleable: updates the | untainted bucket and creates 2 new ones: | rescheduleNow and rescheduleLater - +-------+ - reconcileReconnecting: returns which - | allocs should be marked for reconnecting - | and which should be stopped - | - computeStop - | - computeCanaries - | - computePlacements: allocs are placed if - | deployment is not paused or failed, they - | are not canaries (unless promoted), - | previous alloc was lost - | - computeReplacements - | - createDeployment - | - | - | - | - | - | - | - v -+--------------------------------------------+ -|computeDeploymentUpdates(deploymentComplete)| -+--------------------------------------------+ - | - +------+ for complete deployments, it - | handles multi-region case and - v sets the deploymentUpdates - +---------------+ - |return a.result| - +---------------+ + | - reconcileReconnecting: returns which + | allocs should be marked for reconnecting + | and which should be stopped + | - computeStop + | - computeCanaries + | - computePlacements: allocs are placed if + | deployment is not paused or failed, they + | are not canaries (unless promoted), + | previous alloc was lost + | - placeAllocs + | - computeDestructiveUpdates + | - computeMigrations + | - createDeployment + | + v ++-----------------------------+ +|setDeploymentStatusAndUpdates| ++-----------------------------+ + | + | for complete deployments, it + | handles multi-region case and + v sets the deploymentUpdates + +------------------------+ + |return *ReconcileResults| + +------------------------+ ``` ### Node Reconciler