Repository navigation
Conversation
Since 3.19.0, barman-cloud-backup uploads backup.info with status STARTED when the backup starts, and overwrites it with the final status (DONE or FAILED) when the backup ends. Object stores that refuse to overwrite an existing object reject that second upload, so every backup ends as FAILED even though all of its data was uploaded. Examples are a Google Cloud Storage bucket with a retention policy and a Cloudflare R2 bucket with a bucket lock rule. Neither versions objects, unlike S3 Object Lock, so the overwrite is refused rather than stored as a new version. The new --no-started-backup-info option skips the STARTED upload, so backup.info is uploaded only once, when the backup ends, as in 3.18. The default is unchanged. The option applies to both object store and snapshot backups. It does not apply when barman-cloud-backup runs as a hook script, which never uploads a STARTED backup.info. References: EnterpriseDB#1195. Assisted-by: Claude Opus 5.5 Signed-off-by: Eyal Mizrachi <eyal@casthook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1195.
Since 3.19.0 (BAR-1235),
barman-cloud-backupuploadsbackup.infowith statusSTARTEDwhen the backup starts, and overwrites it with the final status when the backup ends. Object stores that refuse to overwrite an existing object reject that second upload, so every backup ends as FAILED even though all of its data was uploaded. Two examples: a Google Cloud Storage bucket with a retention policy (#1195), and a Cloudflare R2 bucket with a bucket lock rule. Neither versions objects, unlike S3 Object Lock, so the overwrite is refused rather than stored as a new version.This adds an opt-in
--no-started-backup-infoflag that skips theSTARTEDupload, sobackup.infois uploaded only once, when the backup ends, as in 3.18. The default is unchanged.STARTEDbackup.info, so it is unaffected.barman-cloud-backupcommand reference describes the option and its trade-off: a running backup isn't listed in the catalog until it ends.CloudBackupUploaderandCloudBackupSnapshotin both default and opt-out cases. A newcoordinate_backuptest runs against an in-memory store that refuses overwrites and asserts exactly onebackup.infoupload, withDONEon success andFAILEDon failure.tests/test_barman_cloud_backup.pyandtests/test_cloud.pypass (489 tests), and the full suite passed on the 3.20.1 tag.We run this patch in production on CloudNativePG clusters that back up to an R2 bucket with a lock rule. With unpatched 3.20.1, every base backup to that bucket failed on the final
backup.infoupload. With the patch, a base backup to the same bucket completes, and WAL archiving is unaffected either way.AI assistance disclosure (per
AI_POLICY.md): this change was drafted with Claude (Anthropic) and is marked with anAssisted-bytrailer. I reviewed the code, tests and docs, and I understand and stand behind the change.