Check there's room for the database's copy before an update

Before dumping the app's database for a rollback, coreapps reads its size
and refuses the update, changing nothing, if the apps' disk can't hold
the copy and keep 1 GB free; big databases say the copy takes a while.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 19:40:03 -07:00
co-authored by Claude Opus 5.5
parent 2d29ca62b3
commit f56641bbe1
4 changed files with 66 additions and 1 deletions
+10 -1
View File
@@ -502,7 +502,16 @@ Later:
updating each of its apps (`lib/functions.sh`), and `bin/btrfs-snapshot`,
`restore-btrfs-snapshot` and `free-up-space -s` manage snapshots. So
`/data`'s reflink copy works on every Core
- [ ] Large databases: the dump takes time and disk on every update
- Large databases (2026-12-03): before dumping, coreapps reads the
database's size (`pg_database_size`; MariaDB's `information_schema`
table sizes) and refuses the update, changing nothing, if the apps'
disk can't hold the copy and still keep 1 GB free; above 200 MB it
says the copy takes a while, and above 30 seconds how long it took.
Tested on dev.fedcom.net (sizes, the refusal with a raised reserve, the
message with a lowered limit)
- [ ] Very large databases: a dump on every update may still be too
slow; a btrfs snapshot of the database server's data, or skipping
the copy with the user's agreement, could replace it
- [ ] Uninstalling a need without removing the app (now refused)
- [ ] `bin/start` / `bin/stop` don't know coreapps' apps (see "Tell
Federated"); `restart: always` covers reboots