Declare every module's data; the backup holder measures it (hq ADR 0233)

Backup lines are derived from each module's data section instead of written by hand; the holder
measures declared items, reads the array under them, and deletes a retired item only after a last
restore point; the Go providers say each held consumer's size so an empty replacement is seen.
This commit is contained in:
jochen
2026-10-06 16:47:49 +02:00
parent 8f5a75ab9b
commit 685cb1cb1b
44 changed files with 1493 additions and 78 deletions
@@ -98,7 +98,7 @@ const SetAsideStatement = `SELECT datname, pg_database_size(datname) FROM pg_dat
// Inventory is what this server holds that the mesh made.
func (c *Client) Inventory(ctx context.Context) (Inventory, error) {
inv := Inventory{Active: []string{}, Retired: []Retired{}}
inv := Inventory{Active: []string{}, Retired: []Retired{}, Sizes: map[string]int64{}}
r, err := c.Query(ctx, "", InventoryStatement)
if err != nil {
return inv, err
@@ -111,6 +111,9 @@ func (c *Client) Inventory(ctx context.Context) (Inventory, error) {
}
if login && m.Retired == "" {
inv.Active = append(inv.Active, name)
if s := sizeOf(size); s >= 0 {
inv.Sizes[name] = s
}
continue
}
at, _ := time.Parse(time.RFC3339, m.Retired)