Upgrade
Upgrade with one helm upgrade: the migration Job brings the schema forward before the pods of the new version replace the old ones.
On this page
Versions
The version comes from the commit messages: a fix is a patch, a feature or a breaking change a minor release while the major version is 0. The image and the chart carry the same version, and the chart installs its own version's image. Read the notes of every release between yours and the target on the releases page; they list breaking changes apart.
Before the first stable release
Warning
Quader is pre-alpha and keeps no backward compatibility until its first stable release.
- A fresh database may be needed. A release may change a migration your database already applied. The Job then refuses with
checksum mismatch, applies nothing, and the old pods keep serving; the way forward is a new, empty database. - No rollback.
helm rollbackruns no migration, and nothing guarantees an older release against the newer schema. The way back is the database backup you took before the upgrade, losing what was written since. - Old and new pods side by side are not supported, so a request can fail during the rollout: upgrade in a maintenance window if that matters.
- Anything can change: keys, values, the API, stored formats, without an alias.
Before you upgrade
- Adjust your values to the release notes.
- Back up PostgreSQL with your platform's tools, such as CloudNativePG's backups. Quader's own backup restores into a new installation and is no rollback (Backup and restore).
- Render the new chart with your values:
helm template quader quader/quader -n quader -f values.yaml --version <version> > /dev/null. The keys insideconfigare checked by the Job. - Check
GET /api/v1/system/migrations(needssettings:read): every entry ofbackgroundshould besucceeded, because a migration that removes data a background migration converts waits for it.
Upgrade with Helm
helm upgrade quader quader/quader -n quader -f values.yaml --version <version> # example
kubectl -n quader logs job/quader-migrate
kubectl -n quader rollout status deployment/quader-api
If the Job fails, helm upgrade fails and the old pods keep serving; its log names the cause. It retries twice within 30 minutes
(migrations.backoffLimit, migrations.activeDeadlineSeconds), except after a refusal (exit status 3), which no retry can change. With
migrations.mode: disabled run quader migrate up yourself with the new image before rolling the Deployments; new pods wait unready
meanwhile.
The UI of both versions loads during the rollout: each api pod stores its version's UI files in the object store and serves the other
version's from there, for 7 days after its last pod stopped. While the object store is unreachable a page can load empty once; a reload
fixes it.
How the migrations work
- Migrations are embedded in the binary, numbered, each in its own transaction, recorded with a checksum. One run at a time holds a
PostgreSQL advisory lock; another waits up to
migrate.advisory_lock_wait. - A migration can need a minimum Quader version, or a finished background migration: the runner refuses it while that does not hold.
- A replica whose schema is behind its binary stays unready; one whose schema needs a newer binary exits.
- Corrections of stored data run after the upgrade as jobs on a worker, so the Job does not grow with the data. Follow them in
Admin area › System › System status, tab Jobs (Monitor), and under
backgroundofGET /api/v1/system/migrations.
quader migrate status prints the same report as GET /api/v1/system/migrations, from the binary it runs in.
Keys and paths in the database are ordered byte by byte; package and principal names still follow the database's collation. After an
update of the database server's collation library, rebuild Quader's indexes (REINDEX SCHEMA quader).
After the upgrade
- The Job's log ends with a JSON summary:
applied, ornothingToDo: true. GET /api/v1/system/migrationsshows the newbinary.version, an emptypending, andbackgroundfinishing.- Admin area › System › System status shows All roles ready and the new version on every replica.
- Sign in, open a repository and download a file.
Bastions
A main installation and a Bastion talk only with the same version of the Bastion interface. When a release raises it, upgrade the main
installation first and the Bastions within bastion.answers.grace_period; until then each side treats the other as unreachable and
QuaderBastionInterfaceMismatch fires. Admin area › Bastions shows each replica's interface version.
What is not verified yet
- An upgrade across several releases is one migration run, but no test covers it.
- The test that upgrades the newest release and rolls it back under load runs on request, not for every release.
- Rollback and mixed versions are not supported before the first stable release.