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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user