Skip to content
SHC Docs

Flow: app update

Layer 11. Lifecycle. Layer page.

shc update changes a deployment that already exists. It re-renders through the same stored-render seam as install. A --where or --prefer change that moves the deployment relocates first.

sequenceDiagram
participant CLI
participant Deploy
participant Leader
participant Store
participant Node
CLI->>Deploy: POST /api/method/shc.stack.update
opt where or prefer leaves the current node
CLI->>Leader: plan, then POST /api/method/shc.stack.relocate
Leader->>Store: FinishStoredMove for the target
end
Deploy->>Deploy: ExecuteCompose renders once
Deploy->>Store: store the render, then the spec
Node->>Store: materialise clusterfs
Node->>Node: start replicas from the stored spec

The command is ce modules/app/commands/update.go. It posts /api/method/shc.stack.update. When the flags change placement, RelocateForRules plans, prints the plan, asks unless --yes, and posts /api/method/shc.stack.relocate (ce modules/app/commands/update_relocate.go). --plan prints the plan and stops. See relocate.

RunUpdateWithObserver reuses ExecuteCompose (ce modules/app/install_async.go). The update deploy runs on the render leader (ce modules/app/update_dispatch.go). The deployment directory is on whichever node led at the last render. A leader that did not render the current spec puts the directory’s state back from the store first: the manifest the stored spec carries, and the package from the app archive (ce modules/app/deployment_dir_restore.go). The stored render is still written once, before fabric, networks, and replica projects (ce modules/app/install_runner.go). The leader finishes a stored render for another node (ce modules/app/stored_render.go).

Phase 1 writes the requested settings before the re-render. If the deploy is abandoned before the engine is touched, SettleFailedUpdate restores those settings from the prior row (ce modules/app/service.go). A deploy that already touched the engine keeps the row and ends failed.

Sources: ce modules/app/commands/update.go, modules/app/commands/update_relocate.go, modules/app/install_async.go, modules/app/update_dispatch.go, modules/app/deployment_dir_restore.go, modules/app/install_runner.go, modules/app/service.go.