Backups: dump the database uncompressed so restic can deduplicate it

Aperta
#645 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, postgresql
Ambito
database, devops

Direzione di ricerca

Start with PostgresTools::dumpCommand(), which builds the pg_dump invocation, and its existing test, then add --compress=0 and a test asserting it. Next, check the Tools › Backups page for the bytes-added figures and the backups architecture doc for the note. Confirm teme:backup:restore and the weekly test restore still handle both compressed and uncompressed dumps. Done when the command requests no compression, the tests pass, and restores work for old and new snapshots.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area/backups area/deploy type/enhancement when/soon

The nightly backup asks pg_dump for its custom format with PostgreSQL's own compression (--format=custom, which compresses by default; PostgresTools::dumpCommand()), and restic stores that output. Compressed bytes don't deduplicate: a table with even one changed row compresses to different bytes throughout, so restic stores that table's data again in full every night. Only tables that didn't change at all are shared between nights. On a publication, the content table changes daily, so most of the database is stored again each night, and the uploads and storage grow by about the database's size per night instead of by what changed.

Media isn't affected: restic deduplicates and compresses the files themselves.

Expected:

  • pg_dump writes the custom format uncompressed (--compress=0), and restic deduplicates it and compresses it with zstd, as its repositories already do (format 2, the default for restic init);
  • a test that the dump command asks for no compression;
  • the figures Tools › Backups shows for a run (bytes added) reflect the smaller nightly additions; a note in the backups architecture doc saying why the dump is uncompressed;
  • teme:backup:restore and the weekly test restore keep working with both kinds of dump, since older snapshots hold compressed ones.

🤖 Generated with Claude Code

Lingua principale
PHP
Stelle
1
Fork
1
Merge medio
1h 40m
PR unite (30g)
143

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temecms/teme

Tutte le issue di temecms/teme

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.