Architecture¶
CNPG Repair Flow¶
- Triage — Collect
pg_controldatafrom all instances, query replication status, check disk space - Safety gate — Verify primary is running, check for split-brain via timeline analysis
- Escrow — Stream
pg_dumpallfrom primary throughrestic backup --stdin(type=backup) - Diverged — If split-brain: dump each running instance individually (
type=diverged, ordinal-prefixed, sharedjobtag) - Heal — Fence instance, clear pgdata on existing PVC,
pg_basebackupfrom primary, unfence - Re-triage — Verify cluster health post-repair
Galera Repair Flow¶
- Triage — Read
grastate.datfrom all nodes, querywsrepstatus, check disk space - Safety gate — Verify healthy donor exists, check for split-brain via UUID/seqno comparison
- Escrow — Stream
mysqldumpfrom healthy donor throughrestic backup --stdin(type=backup) - Diverged — If split-brain: dump each running instance individually (
type=diverged, ordinal-prefixed, sharedjobtag) - Heal — Suspend CR, scale down, preserve and reset
grastate.dat/galera.cache, scale up, resume - Re-triage — Verify cluster health post-repair
Backup Streaming¶
Backups use Kubernetes exec API to pipe database dump output directly through restic backup --stdin. No intermediate storage or temporary files on the database pods. Restic handles chunking, dedup, encryption, and compression.