On this page
Operator-run, one component per run, each independent: scripts/ops/data-plane-upgrade.sh --component postgres|redis|rustfs.
A run without --apply is a dry run (real read-only preflight, every step printed). --apply and --rollback on the
real stack also need --yes-production; a rehearsal needs DPU_REHEARSAL=1 plus its own DPU_COMPOSE_FILE,
DPU_ENV_FILE and DPU_OPS_DIR and refuses any msocloud-* container.
State on this host: all three components were applied on 2026-11-23 (run records in private/dpu/). Sign-off cleanup (see "After sign-off") is still open: msocloud_postgres_data exists as the Postgres rollback. Use this page for --rollback until then, and as the procedure for the next upgrade.
Suggested order, each with its own window: RustFS, Redis, then Postgres. Verify the app between them.
Compose and the drift guard#
The tracked template carries the new pins. scripts/verify-prod-compose.mjs (run by start-prod.sh) accepts a live
file that still carries one component's previous pin (and, for Postgres, its previous volume mount) and fails on any
other drift, so a deploy works before, between and after the three runs. Each run edits the live file for its own
component only; --rollback edits it back for that component only. After sign-off delete the matching entry from
PREVIOUS_DATA_PLANE_IMAGES in verify-prod-compose.mjs.
Before a window#
- Pull the images by digest (the preflight fails on a missing image):
postgres:19.0-alpine3.23@sha256:8b9e23fd0652e6857367455c41fd6624823995fa120a2f912222d29203ab1b6a,redis:8.10.3-alpine3.23@sha256:7958cfbb9d152f87dadfbc89f1b0b15938f0b81ff8982feb327476f4911935c3,rustfs/rustfs:1.0.6@sha256:ee717072290bec9b11abfc0365f8310b00df1cd9b3639943edae47bdef05044a. ./scripts/ops/data-plane-upgrade.sh --component <name>(dry run, exit 0). It checks, before anything stops: the NAS dump of the last 26 h in/home/backup/logs/msocloudnet.log, the clock outside 02:45-03:30, healthy containers, the compose pin, free disk on BOTH the Docker root and the checkout (3x the data), all images present, every secret the verify steps need, the worker image (Redis), the mc image (RustFS), no leftoverdpu-upgrade-*container, andstart-prod.sh --preflight-only(its env guards, topology check and network check).- Build app images first if they changed; the window runs
start-prod.sh --no-build.
The window#
./scripts/ops/data-plane-upgrade.sh --component redis --apply --yes-production 2>&1 | tee -a private/dpu/console.log
Common: stop the writers (web, worker, archive-worker, idp, cube) and prove no other session is left (Postgres
pg_stat_activity, Redis client count). Then per component:
- postgres: row counts and role/privilege/RLS/index facts, fresh
pg_dump -Fcandpg_dumpall --globals-only, clean stop,pg_upgrade --checkandpg_upgrade(copy mode, new volumemsocloud_postgres19_data,initdb --no-data-checksums, oldpg_hba.confcarried, the temporary containerdpu-upgrade-<pid>), compose edit, recreate, then before any writer starts: counts equal, SCRAM login for every role,yng_appsees no rows of a forced-RLS table without a tenant context.vacuumdbruns after the app is up. - redis: facts,
BGREWRITEAOF, stop, tar copy of the volume (exit code, listing and sha256 checked), compose edit, recreate, facts equal, one BullMQ job enqueued, processed and completed with the worker image. - rustfs: bucket object count and size, stop, tar copy (checked), compose edit, recreate, count and size equal.
Last: the real start path, start-prod.sh --no-build (with --with-idp / --with-cube if they were running).
Afterwards read the warm-asset-cache: and verify-cdn-cache: lines (section 176).
If a run stops half way#
Any non-zero exit (error, Ctrl-C, kill) removes the temporary dpu-upgrade-* container (after a fast shutdown of the old
postmaster inside it, so Postgres never runs twice on the old volume) and writes LIVE-STATE.txt in the run's ops dir
(private/dpu/<component>-<stamp>/) saying what is live. The recovery is always the same command:
| Phase in LIVE-STATE | Live | Recover |
|---|---|---|
| writers-stopped | old data plane up, writers down | - (or restart the writers) |
| component-stopped | writers and the component down, old pin, old data intact | - |
| upgraded-not-switched | as above, new data prepared but unused | - |
| switched | compose edited, new container maybe up, writers down | - |
| stack-start | component verified on the new pin, start command failed | fix and rerun the start command, or - |
Never docker start a stopped Postgres by hand while a dpu-upgrade-* container exists. Run the window through the
Monitor tool with a log file, never inside a wall-clock-limited job: SIGKILL (a runtime limit, the OOM killer) skips the
trap, so no LIVE-STATE.txt is written and dpu-upgrade-* keeps running; the next preflight and rollback refuse until it
is removed. A rollback after a failure before the writers stopped stops the running writers first, then recovers.
Rollback#
./scripts/ops/data-plane-upgrade.sh --component redis --rollback --yes-production
Validated before anything stops: the saved state, no earlier rollback, the old image, the compose file can be edited back, and for Postgres that the old volume exists, holds a PG 16 cluster and is mounted by no running container; for Redis and RustFS that the tar copy exists and passes its sha256. Then: stop the writers, stop and remove the component, Redis restores the copy through a scratch volume (replaces the contents only after the extract is counted), edit the compose file back for that component, start it, and run the real start path. RustFS first tries 1.0.4 on the current volume and restores the verified copy only if it will not start. Everything written after the cutover is lost (Redis too: its queue state returns to the writer stop, matching Postgres). The new Postgres volume is kept for a post-mortem.
After sign-off#
docker volume rm msocloud_postgres_data, then the contents of private/dpu/ (full dump, role hashes in the pg_upgrade
logs; private/ is excluded from Docker builds and from the nightly checkout rsync). autoheal=true is on these
containers: a slow Redis AOF load can be restarted by it; the script waits for health, so watch for a restart loop.
What the upgrade changes for people#
- Postgres 19: JIT is off by default,
max_locks_per_transactiondefaults to 128,standard_conforming_stringsis always on, MD5 passwords log a warning (all roles here are SCRAM). The PG 18+ image keeps the cluster in/var/lib/postgresql/19/docker, so the volume mounts at/var/lib/postgresql. Data checksums stay off. pg_dumpis 19 everywhere that execs into the container; a 19 dump does not restore into 16.verify-restore.sh,infra/db-backup/Dockerfile, the devdocker-compose.ymland.github/workflows/ci.ymlcarry the 19 image.- Redis 8 is tri-licensed (RSALv2 / SSPLv1 / AGPLv3); only
requirepassis used, so the 8.0 ACL category change does not apply.--maxmemory 512mb --maxmemory-policy noevictionis unchanged (BullMQ requirement). - RustFS 1.0.5 and 1.0.6 notes name no on-disk migration; the 1.0.5 upgrade notes concern mixed-version multi-node clusters and pool changes, neither of which exists on a single node.