Upgrades
Anastro upgrades nodes by writing a new signed release into the inactive A/B OS slot and rebooting into it. If a node fails to come back healthy, it automatically falls back to the previous slot.
Upgrade the node OS
Section titled “Upgrade the node OS”-
Build and sign a release with a higher
generation(signed with the same Secure Boot keys as your installer).versionis just a display label. -
Serve the release directory over HTTP or HTTPS anywhere your nodes can reach:
Terminal window cd release-2 && python3 -m http.server 8000 -
Roll it out across the cluster (or test on one replica first with
-n):Terminal window anastroctl cluster upgrade --url http://10.10.0.5:8000 --version 2anastroctl cluster upgrade --url http://10.10.0.5:8000 --version 2 -n cp3
cluster upgrade updates one node at a time—skipping nodes already on that version and upgrading
the Postgres primary last. For each node:
- Drain: worker nodes live-move their machines elsewhere (Hosts). Single
nodes save running machines to disk across the reboot. Pass
--allow-stopto stop machines that can’t live-move instead of stalling the rollout. - Verify and write: the node fetches
SHA256SUMS,SHA256SUMS.sig, and the release artifacts, verifies the operator signature, Secure Boot certificate, PCR policy, and hashes, writes the inactive OS slot, hands off the Postgres primary if needed, and reboots. - Verify health and uncordon: waits for the new boot to be blessed healthy, uncordons the node, and continues. If a node falls back to its old version, the rollout halts immediately.
Health checks and automatic rollback
Section titled “Health checks and automatic rollback”Each new release gets three boot attempts. machined only blesses the boot once every service
is active, Secure Boot and /var PCR 7 + PCR 11 sealing pass, and (in HA clusters) etcd-member
and postgres-replication are healthy. If a node isn’t healthy within 5 minutes, it reboots; after
three failed attempts, systemd-boot automatically boots the previous working slot.
Every node always retains two OS versions: the current one and the previous one. (Older PCR7-only nodes cannot upgrade in place to PCR 11 production images—reinstall them one replica at a time while maintaining quorum.)
Anti-rollback: (epoch, generation) and journal guards
Section titled “Anti-rollback: (epoch, generation) and journal guards”- Monotonic releases: every production release carries
(epoch, generation). Nodes compare them lexicographically and reject anything not strictly newer than both the running image and the highest blessed release recorded in/var/lib/anastro-node/release-floor.json. Raisinggenerationblocks replaying older releases; raisingepochalso reseals/varso older-epoch images can’t even unlock the disk. - DWFS journal v2 guard: upgrading a workspace to journal format 2 writes
journal.v2(saving the old file asjournal.v1) and places a rollback guard atjournal. An older release that only speaks format 1 refuses to mount that workspace rather than silently dropping newer journaled edits. Let the newer release checkpoint and flush the workspace before moving back to an older release—never deletejournal,journal.v1, orjournal.v2manually.
Upgrade Postgres to a new major version
Section titled “Upgrade Postgres to a new major version”When a node OS release bundles a newer Postgres major version alongside the current one, you can upgrade online with logical replication. The API stays up throughout, pausing writes briefly only during cutover:
anastroctl cluster postgres upgrade plan --to 18 # check prerequisites and blockersanastroctl cluster postgres upgrade start --to 18 # start new major and replicate into itanastroctl cluster postgres upgrade status # monitor copy progress, lag, and row countsanastroctl cluster postgres upgrade cutover # switch writes to the new majorAfter cutover, the old major replicates in reverse for postgres.upgrade.rollback_window (default
24h), letting you roll back without losing writes made after cutover:
anastroctl cluster postgres upgrade rollback # revert to the old major within rollback_windowanastroctl cluster postgres upgrade finish # drop the old major earlyanastroctl cluster postgres upgrade abort # cancel before cutover and drop the new majorOnce rollback_window elapses, each node cleans up the old major automatically. Schema migrations
pause during the upgrade and run once it finishes. If the new major doesn’t catch up within 30
seconds during cutover, writes stay on the old major so you can retry. In HA clusters, anastroctl
coordinates each step across every node.
Hosts: configure workers, GPU/USB capabilities, drains, and live moves.