pg.ddx.io pgbackrest/pgbackrest GitHub issues and pull requestshelp / color / mirror / Atom feed
[pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock 12+ messages / 2 participants [nested] [flat]
* [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-09 02:45 "Jyrgal (@Jyrgal)" <noreply+Jyrgal@github.com> 0 siblings, 0 replies; 12+ messages in thread From: Jyrgal (@Jyrgal) @ 2026-11-09 02:45 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> ## Problem When `resume` is enabled (the default), the backup command saves the manifest to `backup.manifest.copy` periodically during a backup, controlled by `manifest-save-threshold`. On S3 each save overwrites the object, and on a bucket with Object Lock enabled every overwrite creates a new object version. If the bucket has a default retention rule, every one of these versions is locked for the full default period. That period is usually sized for the backups themselves (e.g. 30 days to several years), not for temporary checkpoints. So: - A long backup can produce many locked checkpoint versions of `backup.manifest.copy`. Only the final version is needed once the backup completes. - These versions can't be deleted (in compliance mode, by anyone) until retention expires, so they add storage cost and clutter for the whole retention period. - Lifecycle rules can't clean them up early, because Object Lock takes precedence over lifecycle expiration. ## Current workarounds - `resume=n` stops the checkpoint saves but gives up resuming a failed backup, which matters most for large and long backups. - Raising `manifest-save-threshold` cuts the number of versions but doesn't avoid the full-length lock on each one. - Lowering the bucket default retention weakens protection for the actual backup files. None of these lets you keep both resume and strong retention on the backup itself. ## Proposal S3 lets a PutObject / CreateMultipartUpload request set explicit retention on the object version it creates with `x-amz-object-lock-mode` and `x-amz-object-lock-retain-until-date`. Explicit retention on a version overrides the bucket default ([AWS docs](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html)). Add per-repo options to set a separate, usually shorter, retention on checkpoint saves only: - `repo-s3-manifest-save-object-lock`: retention period for checkpoint copies of `backup.manifest.copy` (e.g. `1d`). Unset by default, so current behavior doesn't change. - `repo-s3-manifest-save-object-lock-mode`: `governance` (default) or `compliance`. The final `backup.manifest.copy` and `backup.manifest` would not be affected and would keep the bucket default retention. Obviously, this configuration assumes the bucket have Object Lock enabled on the bucket and the `s3:PutObjectRetention` permission for the credentials. I have an implementation ready and will open a PR referencing this issue if we are happy with making this change. ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-09 02:46 ` "Jyrgal (@Jyrgal)" <noreply+Jyrgal@github.com> 10 siblings, 0 replies; 12+ messages in thread From: Jyrgal (@Jyrgal) @ 2026-11-09 02:46 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @Jyrgal renamed this. ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-09 18:53 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-09 18:53 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele assigned @dwsteele. ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-09 18:53 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-09 18:53 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele applied label "question". ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-09 19:11 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-09 19:11 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> I think we'd be open to this change but not as written (yes, I peeked!). The problem is that it takes a very S3-centric approach to the problem which does not honor our storage abstraction. To make it work you'd need to create a generic parameter to pass to storageOpenWriteP(), something like `tmp`, defined as a file that is not intended to last longer than the current operation. Then that gets pushed down to the driver and the driver can decide what to do with it. What you did inside the S3 driver looks fine at a glance, but how the flag gets there is important. Further, if possible, I'd like to make this a repo-storage-* option that works with GCS, Azure, and S3 (using different mode lists). That would not be needed for a first draft, though, and it might not even be possible to make it work sensibly. So, yes -- I think the idea has merit and I'm happy to look at a patch that works roughly as described above. ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 05:03 ` "Jyrgal (@Jyrgal)" <noreply+Jyrgal@github.com> 10 siblings, 0 replies; 12+ messages in thread From: Jyrgal (@Jyrgal) @ 2026-11-12 05:03 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> Thanks! I've reworked it as you suggested. - **`tmp` flag**: added to `storageNewWriteP()` and passed through to the driver, including over the remote protocol. Backup sets `.tmp = !final` for the checkpoint copies of `backup.manifest.copy`. Other drivers ignore it. - **`repo-storage-tmp-retention`**: on tmp files, S3 sets an Object Lock retention and Azure sets a blob immutability policy. Both override the default retention. - **Modes**: `repo-s3-tmp-retention-mode` (`governance`/`compliance`) and `repo-azure-tmp-retention-mode` (`unlocked`/`locked`). They're separate options because the config builder doesn't support a per-type `allow-list`. I'm happy to switch to a single option if you prefer. - **GCS**: not supported. An object retention can't shorten a bucket retention policy (GCS keeps the object until both are satisfied), so it would only add retention. I've left it out of the possible options as it doesn't really make sense as the bucket policy would override it anyway if we try to shorten the retention. I've opened a draft PR with the changes: https://github.com/pgbackrest/pgbackrest/pull/2918 ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 12:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-12 12:12 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele applied label "enhancement". ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 12:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-12 12:12 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele removed label "question". ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 12:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-12 12:12 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele applied label "module [core]". ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 12:13 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-12 12:13 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele set milestone to "2.61.0". ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 12:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-12 12:14 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> @dwsteele closed this. ^ permalink raw [nested|flat] 12+ messages in thread
* Re: [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock @ 2026-11-12 12:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 10 siblings, 0 replies; 12+ messages in thread From: dwsteele (@dwsteele) @ 2026-11-12 12:14 UTC (permalink / raw) To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com> Thank you! Closing since there is now a PR. ^ permalink raw [nested|flat] 12+ messages in thread
end of thread, other threads:[~2026-11-12 12:14 UTC | newest] Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-11-09 02:45 [pgbackrest/pgbackrest] issue #2913: Proposal: Checkpoint saves in resume feature override for S3 object lock "Jyrgal (@Jyrgal)" <noreply+Jyrgal@github.com> 2026-11-09 02:46 ` "Jyrgal (@Jyrgal)" <noreply+Jyrgal@github.com> 2026-11-09 18:53 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-09 18:53 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-09 19:11 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-12 05:03 ` "Jyrgal (@Jyrgal)" <noreply+Jyrgal@github.com> 2026-11-12 12:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-12 12:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-12 12:12 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-12 12:13 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-12 12:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com> 2026-11-12 12:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox