Skip to content

Conversation

@FxKu
Copy link
Member

@FxKu FxKu commented Apr 15, 2024

In order to configure separate S3 lifecycle rules for basebackups and logical backups living in the same bucket, we have to make the logical backup prefix configurable. Unlike Spilo, this approach works in the logical backup script.

There's one more problem though: The operator only diffs logical backup jobs on their image and schedule. Thus, existing jobs will not be updated when changing the prefix. This problem has also been described in issue #768.

Therefore, I have extended the diff to also compare containers for which I have reused the comparison method of the statefulset pod template. It's not super clean - there's a check for lazy update which does not apply for the logical backup cronjob. The word statefulset must now be passed as part of the description to not produce confusing logs for cron job diffs.

Because the cronjob diff function now calls compareContainers - a cluster function - the function needs a cluster receiver, too. I moved it from k8sutil to cluster package and renamed it to align it with other diff functions.

With this PR I have also move the actual logical backup code outside of the docker folder, because it should exist on the same level as e.g. the ui (and future pooler folder). Adjusted the build scripts accordingly.

@FxKu FxKu added this to the 1.12.0 milestone Apr 15, 2024
Copy link
Member

@hughcapet hughcapet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it make sense to also update the e2e test ?

S3 bucket to store backup results. The bucket has to be present and
accessible by Postgres pods. Default: empty.

* **logical_backup_s3_bucket_prefix**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe mention that "/" is required? (from what I see in the implementation)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the tailing / to the logical backup script. Even if users leave the prefix blank // will be treated as /. So it's not needed to specify it.

@hughcapet
Copy link
Member

👍

1 similar comment
@FxKu
Copy link
Member Author

FxKu commented Apr 23, 2024

👍

@FxKu FxKu merged commit 83878fe into master Apr 23, 2024
@FxKu FxKu deleted the lb-bucket-prefix branch April 23, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants