Backups: dump the database uncompressed so restic can deduplicate it

オープン
#645 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php, postgresql
領域
database, devops

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
PHP
スター
1
フォーク
1
平均マージ
1時間 40分
マージ済み PR(30日)
143

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

temecms/teme のほかの issue

temecms/teme の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。