Roll back the database and /data with a failed update

Before an update, coreapps dumps the app's database (pg_dump or
mariadb-dump, in the database's container) and makes a reflink copy of
/data (Cores' /federated is btrfs). A failed update restores both before
starting the old version; a failed dump refuses the update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 15:50:10 -07:00
co-authored by Claude Opus 5.5
parent 14311cee21
commit 77427f2f16
4 changed files with 149 additions and 25 deletions
+12 -1
View File
@@ -230,7 +230,18 @@ The Core's own scripts trace secrets, so their output goes to
are unchanged, the container runs the old tag and answers on its old
port, the new tag is gone from `docker image ls`, and `coreapp_hello`
isn't in PostgreSQL. With the same `version` (and `port = 9999`):
"Rolled back hello's settings. It's the same image tag as before".
"Rolled back hello (its settings and /data as before the update). It's
the same image tag as before".
Data: an app with `needs = ["postgres"]` (then again with `["mysql"]`),
a table with a row "before" and `/data/file` with "before". Start a
failing update; once `/federated/apps/.coreapps-rollback-<name>-*/` has
`db.dump` (`db.sql`) and `data`, and the container runs the new tag,
change the row to "after", add a table and a file in `/data`. After
"Rolled back: ... with its settings, its database and /data as before
the update": the row says "before", the new table and file are gone,
the table's owner is the app's user, the app's user can still read it,
and no `.coreapps-rollback-*` folder is left. A successful update leaves
none either.
11. Superpanel: after deploy, `/federated/apps/superpanel/data/applist.json`
(the dashboard) and `catalog.json` have the app; `service` has
`URL="https://hello.$DOMAIN/"` and applist the same `url`. Change