Update passive HA application hosts - #890
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: NONE FindingsNo concrete security, correctness, or reliability findings were identified in the changed hunks. NotesReviewed the authoritative Generated by Codex Security Review | |
There was a problem hiding this comment.
Pull request overview
This PR extends the existing host-updater flow to support HA passive-host application-only updates while keeping the standalone updater behavior intact. It introduces a shared Unix-socket updater client, adds an HA deployment mode to the updater manager, and adds a fleet-ha update VERSION operator workflow that updates only fleet-api and fleet-client on a passive HA node.
Changes:
- Add
server/internal/updaterapiHTTP-over-unix-socket client and reuse it from the domain updates executor andfleet-ha. - Add
DeploymentMode(standalonevsha) to the updater manager to run HA-specific preflight/stop/start commands and support rollback to the previous app on failed start. - Add HA application update helpers (
PrepareApplicationUpdate,StopApplication,StartApplication) plus wiring in installer/docs and HA compose to disable UI-triggered updates.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/internal/updaterapi/types.go | Updates package docstring for the shared local updater protocol. |
| server/internal/updaterapi/client.go | Adds reusable Unix-socket HTTP client with protocol/transport error types. |
| server/internal/updater/manager.go | Adds HA deployment mode, HA preflight/activation paths, and HA rollback behavior. |
| server/internal/updater/manager_test.go | Adds HA-mode coverage (passive-only, rollback, preflight failure, interrupted recovery). |
| server/internal/ha/deployment/update.go | Adds HA application-only update operations (prepare/stop/start + passive verification). |
| server/internal/ha/deployment/install.go | Installs and configures the host-updater for HA database nodes; exposes ReleaseRoot and compose arg helpers. |
| server/internal/ha/deployment/install_test.go | Extends golden/witness install assertions for updater installation and enablement. |
| server/internal/domain/updates/service.go | Maps executor errors to the new updaterapi error types. |
| server/internal/domain/updates/service_test.go | Updates tests to use updaterapi error types. |
| server/internal/domain/updates/executor.go | Replaces bespoke unix executor client with updaterapi.Client. |
| server/internal/domain/updates/executor_test.go | Updates executor tests for updaterapi.Client and error types. |
| server/cmd/fleet-updater/main.go | Adds --deployment-mode flag/env wiring into updater manager config. |
| server/cmd/fleet-ha/main.go | Adds fleet-ha update VERSION and internal HA lifecycle subcommands used by the updater. |
| server/cmd/fleet-ha/main_test.go | Adds tests ensuring passive enforcement and terminal success reporting for update. |
| deployment-files/ha/tests/test-profile.sh | Adds contract assertions disabling updates in HA and preventing updater socket mounts into services. |
| deployment-files/ha/README.md | Documents passive-host update workflow (fleet-ha update VERSION). |
| deployment-files/ha/fleet-compose.yaml | Sets UPDATES_ENABLED=false for HA services (explicit operator-only updates). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf2fe7e12e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
cf2fe7e to
5db3353
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5db3353f74
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
5db3353 to
9c363fa
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c363fa3d8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
9c363fa to
5dc52fc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5dc52fcc5f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
5dc52fc to
3ccca78
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ccca78ce1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
3ccca78 to
f5bf5fe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66cee057f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- reconcile ambiguous update submissions by operation ID\n- order HA repair before the updater daemon\n- converge interrupted updater repair from the installed deployment
Reviewable diff: +942/-218 across 15 files (excludes generated, test, and story files).
Summary
Adds application-only updates for a passive HA host while preserving the standalone updater path. Operators choose whether a stable release or release candidate is compatible with their deployment; Fleet verifies the artifact and runtime conditions but does not impose adjacent-release or source-version policy. The update replaces only Fleet API and client services, leaves the HA substrate running, and retains enough recovery state to restart the selected application after an interrupted update.
Stack: #890 -> #891. This diff is relative to
main; the guided installer from #888 and promotion-observation guard from #914 are merged prerequisites. This PR owns passive-host update and restart recovery. #891 completes the old active host through bounded failover.How it works
Installation fixes the updater in HA mode.
fleet-ha update VERSIONrequires the local node to be healthy and passive, then sends an idempotent request over the updater's local Unix socket.The updater downloads the requested official release bundle and checksum, validates the archive manifest, stages and fsyncs the deployment, and rechecks passivity immediately before stopping Fleet. It loads only the packaged Fleet API and client images. The installed HA infrastructure Compose file remains pinned and is copied into the staged deployment.
After the atomic deployment swap, the updater starts the requested application release and verifies that the host is current, healthy, and passive. It then removes dangling images left by the application replacement. Startup repair reconciles interrupted directory swaps and updater handoffs. If the application was left stopped, the updater retains an
app-startrecovery command and systemd keeps retrying recovery until the application can run.The updater requires every target to be newer than the installed release. It does not infer whether a skipped-version update is compatible, so operators must still check release notes and migration requirements before choosing a newer stable or RC release.
Areas of the code involved
server/internal/ha/deployment/update.goserver/cmd/fleet-ha/update VERSIONand make cancellation clear that an accepted update may continueKey technical decisions & trade-offs
Testing & validation
git diff --checkpass.Post-Deploy Monitoring & Validation
fleet-ha statusreports one active and one passive host, both Fleet endpoints report the expected version, and etcd, Patroni, and PostgreSQL remain continuously running.fleet-ha status, and follow the emitted recovery command before updating the active host.