Backups
The change feed for large buckets
Back up very large buckets by reading only what changed, from the Object Storage log, with everything read once a week.
On this page
What it is for
Every backup of a bucket walks all of its objects. restic reads only new and changed files, but with millions of objects the walk alone can take hours. Object Storage logs every request to Cockpit, free and for 7 days. With the change feed, the backup job reads that log first and leaves alone what nothing changed in.
Note
The change feed is being rolled out. Until Brewless has switched it on, the setting is kept but every bucket is read in full.
Switching it on
In brewless.yml, per environment:
environments:
production:
backup:
change_feed: true
It applies to every bucket the environment backs up. The backup job's IAM application then also gets ObservabilityReadOnly in the environment's project, to read the log.
What a run does
- Nothing changed in a bucket since its newest backup: the bucket is not read again. That backup stands for this run too; the run's history says the bucket was carried.
- Something changed in a bucket that is backed up in parts (sharded, one part per top-level folder): the folders something changed in are read, and the list of every object; the other folders are carried.
- Something changed in a bucket backed up whole: it is read whole, as without the change feed.
- On Sunday (in the environment's timezone) every bucket is read in full, whatever the log says, so a change the log missed is caught within a week.
- A bucket is also read in full when it has no backup yet, when its newest backup is older than the log keeps, when the log cannot be read, and when a log line does not say which object changed (a browser form upload, or deleting many objects in one request).
Restoring a point restores a carried bucket or folder from the backup it was carried from. Retention keeps, for these buckets, every backup within the daily retention plus a week, so a point near the end of its retention still has what it was carried from. Pinning a point keeps the backups made in its run; to keep everything of a point for good, pin one made on a Sunday.