Skip to content

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.

  1. Build and sign a release with a higher generation (signed with the same Secure Boot keys as your installer). version is just a display label.

  2. Serve the release directory over HTTP or HTTPS anywhere your nodes can reach:

    Terminal window
    cd release-2 && python3 -m http.server 8000
  3. 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 2
    anastroctl 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:

  1. Drain: worker nodes live-move their machines elsewhere (Hosts). Single nodes save running machines to disk across the reboot. Pass --allow-stop to stop machines that can’t live-move instead of stalling the rollout.
  2. 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.
  3. 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.

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. Raising generation blocks replaying older releases; raising epoch also reseals /var so 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 as journal.v1) and places a rollback guard at journal. 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 delete journal, journal.v1, or journal.v2 manually.

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:

Terminal window
anastroctl cluster postgres upgrade plan --to 18 # check prerequisites and blockers
anastroctl cluster postgres upgrade start --to 18 # start new major and replicate into it
anastroctl cluster postgres upgrade status # monitor copy progress, lag, and row counts
anastroctl cluster postgres upgrade cutover # switch writes to the new major

After cutover, the old major replicates in reverse for postgres.upgrade.rollback_window (default 24h), letting you roll back without losing writes made after cutover:

Terminal window
anastroctl cluster postgres upgrade rollback # revert to the old major within rollback_window
anastroctl cluster postgres upgrade finish # drop the old major early
anastroctl cluster postgres upgrade abort # cancel before cutover and drop the new major

Once 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.