|
| 1 | +## Context |
| 2 | + |
| 3 | +`status._host()` currently measures only free space for `Paths.state`, even though configuration now |
| 4 | +contains an ordered `Host.data_roots` catalog and every role selects one root. The guided Host choice is |
| 5 | +a read-only screen, while database roles already have lifecycle actions. `database.info()` knows the role |
| 6 | +data path and delegates live facts to concrete engine modules, but it does not measure directory usage or |
| 7 | +engine-native data totals. |
| 8 | + |
| 9 | +## Goals / Non-Goals |
| 10 | + |
| 11 | +**Goals:** |
| 12 | + |
| 13 | +- Identify every managed storage path and the filesystem that currently backs it. |
| 14 | +- Keep frequent root-menu status checks bounded while providing richer on-demand database details. |
| 15 | +- Report physical role storage separately from engine-native logical or in-memory data. |
| 16 | +- Provide one deliberate guided action that actually restarts Traefik and verifies its health. |
| 17 | + |
| 18 | +**Non-Goals:** |
| 19 | + |
| 20 | +- No expected-device configuration, mount creation, mount repair, or startup ordering. |
| 21 | +- No per-table, per-key, or per-logical-database breakdown. |
| 22 | +- No direct host restart command or change to database lifecycle behavior. |
| 23 | +- No storage quotas, cleanup, forecasting, or background metric collection. |
| 24 | + |
| 25 | +## Decisions |
| 26 | + |
| 27 | +### Read the current Linux mount table and retain separate storage concepts |
| 28 | + |
| 29 | +Host assessment reads `/proc/self/mountinfo`, decodes its escaped fields, and selects the longest mount |
| 30 | +point containing each managed path. It reports mount point, source, filesystem type, and |
| 31 | +`shutil.disk_usage()` capacity without exposing mount options. The canonical state path remains |
| 32 | +`host.storage`; an additive `host.database_storage` list contains one item per configured root plus exact |
| 33 | +role assignments. Existing structured status fields remain present, so the status version does not |
| 34 | +change. Host health includes every configured storage location, and failures remain partial and |
| 35 | +path-specific. |
| 36 | + |
| 37 | +Using only the configured path was rejected because it cannot reveal that an intended custom mount is |
| 38 | +currently backed by `/`. Calling `findmnt` was rejected because the kernel mount table provides the |
| 39 | +required facts without adding another host tool dependency. |
| 40 | + |
| 41 | +### Measure role files only in database Details |
| 42 | + |
| 43 | +Database Details recursively sums allocated blocks under the selected role's data directory without |
| 44 | +following symlinks. It combines that value with the same backing-filesystem facts used by host status. |
| 45 | +The root menu does not scan role trees, because a large PostgreSQL data directory could make every guided |
| 46 | +refresh slow. |
| 47 | + |
| 48 | +Filesystem allocation and engine data are labeled separately. PostgreSQL reports the sum of |
| 49 | +`pg_database_size` for connectable non-template databases and their count. Redis and Dragonfly report |
| 50 | +dataset memory and total keys from `INFO memory` and `INFO keyspace`. A stopped role still reports path, |
| 51 | +directory allocation, and filesystem capacity while explicitly marking live data unavailable. |
| 52 | + |
| 53 | +### Restart only the installed Traefik service |
| 54 | + |
| 55 | +The Host submenu presents Restart traffic, warns that active database connections may briefly drop, and |
| 56 | +requires confirmation. The host operation takes the exclusive host lock, requires the installed Traefik |
| 57 | +Compose file, invokes `docker compose restart traefik`, and polls the owned container's health within the |
| 58 | +existing health timeout. It does not render files, run initialization, renew certificates, or touch |
| 59 | +database Compose projects. |
| 60 | + |
| 61 | +A Compose `up` was rejected because an unchanged service may not restart. Full initialization was |
| 62 | +rejected because it performs unrelated DNS, certificate, repository, and systemd convergence. |
| 63 | + |
| 64 | +## Risks / Trade-offs |
| 65 | + |
| 66 | +- [Two configured paths use the same filesystem] -> Show both exact paths and assignments; repeated |
| 67 | + capacity values truthfully describe their shared backing filesystem. |
| 68 | +- [A configured mount is absent] -> Show the actual fallback mount and source; evdb does not infer the |
| 69 | + intended device or repair it. |
| 70 | +- [A role contains many files] -> Restrict recursive allocation measurement to an explicit Details view. |
| 71 | +- [Live engine metrics fail] -> Preserve filesystem facts and report live data unavailable with a bounded |
| 72 | + error instead of hiding the rest of Details. |
| 73 | +- [Traefik restart interrupts clients] -> Require confirmation, restart only Traefik, and wait for health |
| 74 | + before reporting completion. |
0 commit comments