make bucket prefix for logical backup configurable#2609
Merged
Conversation
FxKu
requested review from
Jan-M,
hughcapet,
idanovinda,
jopadi,
macedigital and
sdudoladov
as code owners
April 15, 2024 10:57
hughcapet
reviewed
Apr 22, 2024
| S3 bucket to store backup results. The bucket has to be present and | ||
| accessible by Postgres pods. Default: empty. | ||
|
|
||
| * **logical_backup_s3_bucket_prefix** |
Contributor
There was a problem hiding this comment.
maybe mention that "/" is required? (from what I see in the implementation)
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
|
👍 |
1 similar comment
Contributor
Author
|
👍 |
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.
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
statefulsetmust 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- aclusterfunction - 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
dockerfolder, because it should exist on the same level as e.g. theui(and futurepoolerfolder). Adjusted the build scripts accordingly.