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:
@@ -59,6 +59,33 @@
|
||||
"superuser": "${dir:state}/superuser.secret",
|
||||
"reader": "${dir:state}/reader.secret"
|
||||
},
|
||||
"data": {
|
||||
"own": [
|
||||
{
|
||||
"id": "store",
|
||||
"path": "${dir:store-data}",
|
||||
"class": "valuable",
|
||||
"backup": {
|
||||
"dump": "docker exec -u postgres postgres sh -c 'cd /var/lib/postgresql/data/dumps && for db in $(psql -Atc \"select datname from pg_database where oid >= 16384 order by 1\"); do pg_dump -Fc -f \"$db.dump.partial\" \"$db\" && mv \"$db.dump.partial\" \"$db.dump\" || exit 1; done'",
|
||||
"into": "dumps"
|
||||
},
|
||||
"why": "every consumer's database; copied by the dump below, since a running store's files are not a consistent copy"
|
||||
},
|
||||
{
|
||||
"id": "dumps",
|
||||
"path": "${dir:dumps}",
|
||||
"class": "rebuildable",
|
||||
"why": "last night's dump of the store, made again every night"
|
||||
}
|
||||
],
|
||||
"consumers": {
|
||||
"postgres-database": {
|
||||
"class": "valuable",
|
||||
"in": "store",
|
||||
"why": "a consumer's rows are the only copy of what it wrote"
|
||||
}
|
||||
}
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"id": "state",
|
||||
@@ -128,12 +155,5 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"contributions": [
|
||||
{
|
||||
"seat": "node-backup",
|
||||
"kind": "backup",
|
||||
"content": "run docker exec -u postgres postgres sh -c 'cd /var/lib/postgresql/data/dumps && for db in $(psql -Atc \"select datname from pg_database where oid >= 16384 order by 1\"); do pg_dump -Fc -f \"$db.dump.partial\" \"$db\" && mv \"$db.dump.partial\" \"$db.dump\" || exit 1; done'\npath ${dir:dumps}\n"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user