ADMIN key (draining the server is an administrator action) and a copy of the way you installed the server, so you can reinstall the old release. For the first install, see Deploy Yukta.
Steps
1
Read what changed
Open Releases and the release notes of every release between yours and the target. While the major version is It prints the version it found and the newest one, and exits with status
0, a minor release may break things. Ask the install script whether you are behind:1 when you are behind. It changes nothing.2
Save what memory holds
By default a restart wipes sessions, workflows, versions and run history. Pick the way you keep them:
- Definitions in files. If you load a folder with
yukta.bootstrap.dir, nothing more to do. See Persist sessions. - Definitions only on the server. Download each session as JSON (Export JSON on its page in the web UI) or print it with
yukta-cli session config <session-id> -o json, and keep the files. - A Plus build with files or PostgreSQL. Back up the data directories, or the whole database, before you start. Migrations run forward only (there are no undo scripts), so the database backup is also your way back.
3
Drain the server
Draining refuses new starts with Poll until nothing runs or waits:The answer has
429 and lets running ones finish.draining, running, queued and idle. Continue when idle is true. A client that tries to start a run meanwhile gets 429 with “The server is draining for a restart; try again once it is back”. The drain flag lives in memory, so the restarted server accepts starts again.If a run will not finish, stop it with yukta-cli workflow stop <session-id> <workflow-id> or wait for the shutdown timeout in the next step. Runs that are still going when the process stops are lost, or, on a durable setup, marked ABORTED at the next start and available to resume.4
Install the new release
- Docker
- Install script
- Linux package
- Archive or source
Pull the new tag, then recreate the container with the same options (keep the volume if you have one):Pin an exact tag.
latest only moves to a stable release, never to a prerelease.5
Update the client and the workers
Update
yukta-cli on the machines that use it: the install script does it together with the server. If you run remote workers, upgrade them to the same release as the server, because a worker with another protocol version is refused.Verify it worked
/actuator/info reports the server version (it needs an ADMIN key when a key is set). session list shows your sessions, which proves that the bootstrap folder or your durable store came back. Start one workflow and read its result before you tell people the server is open again. After a restart, GET /api/admin/drain reports "draining": false.
Roll back
Reinstall the version you ran before, and restore what the new version could have changed.- Docker: run the old tag.
- Install script: run it with
--version <old>, or moveyukta.prevandyukta-cli.prevback over the new programs. - Package: install the old
.debor.rpm. Your downgrade flags depend on your package manager. - Files: state written by a newer version may not load in an older one. Restore the data directories from step 2.
- PostgreSQL: the new version may have applied migrations that the old one does not know. Restore the database from the backup you made in step 2 before you start the old release.
Variations that matter
- Several servers (high availability). Upgrade a standby first, then stop the leader so one takeover happens, and read Run highly available for what a takeover does to runs.
- Keep one version for repeatable deployments. Use exact image tags and
--version. Do not follow a moving tag. - Expect a short pause. One server admits runs, so a restart is a gap for clients. They can retry a start safely with an
Idempotency-Key.