mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-07-09 19:22:21 +02:00
Compare commits
3 Commits
fe3b6feb3a
...
f89710d1ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f89710d1ef | ||
|
|
e30154b938 | ||
|
|
eefb45ca5a |
@ -15,6 +15,7 @@ DigitalOcean
|
|||||||
Docusaurus
|
Docusaurus
|
||||||
EDB
|
EDB
|
||||||
EKS
|
EKS
|
||||||
|
EnterpriseDB
|
||||||
Enum
|
Enum
|
||||||
EnvVar
|
EnvVar
|
||||||
GCP
|
GCP
|
||||||
@ -76,6 +77,7 @@ backends
|
|||||||
barmanObjectName
|
barmanObjectName
|
||||||
barmanObjectStore
|
barmanObjectStore
|
||||||
barmancloud
|
barmancloud
|
||||||
|
benchmarked
|
||||||
boto
|
boto
|
||||||
bzip
|
bzip
|
||||||
cd
|
cd
|
||||||
|
|||||||
@ -144,10 +144,11 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
Compress a backup file (a tar file per tablespace) while streaming it
|
Compress a backup file (a tar file per tablespace) while streaming it
|
||||||
to the object store. Available options are empty string (no
|
to the object store. Available options are empty string (no
|
||||||
compression, default), `gzip`, `bzip2`, and `snappy`.
|
compression, default), `gzip`, `bzip2`, `lz4`, and `snappy`.
|
||||||
enum:
|
enum:
|
||||||
- bzip2
|
- bzip2
|
||||||
- gzip
|
- gzip
|
||||||
|
- lz4
|
||||||
- snappy
|
- snappy
|
||||||
type: string
|
type: string
|
||||||
encryption:
|
encryption:
|
||||||
|
|||||||
2
go.mod
2
go.mod
@ -7,7 +7,7 @@ toolchain go1.26.2
|
|||||||
require (
|
require (
|
||||||
github.com/cert-manager/cert-manager v1.20.2
|
github.com/cert-manager/cert-manager v1.20.2
|
||||||
github.com/cloudnative-pg/api v1.29.0
|
github.com/cloudnative-pg/api v1.29.0
|
||||||
github.com/cloudnative-pg/barman-cloud v0.5.0
|
github.com/cloudnative-pg/barman-cloud v0.5.1
|
||||||
github.com/cloudnative-pg/cloudnative-pg v1.29.0
|
github.com/cloudnative-pg/cloudnative-pg v1.29.0
|
||||||
github.com/cloudnative-pg/cnpg-i v0.5.0
|
github.com/cloudnative-pg/cnpg-i v0.5.0
|
||||||
github.com/cloudnative-pg/cnpg-i-machinery v0.4.2
|
github.com/cloudnative-pg/cnpg-i-machinery v0.4.2
|
||||||
|
|||||||
4
go.sum
4
go.sum
@ -20,8 +20,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
|
|||||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||||
github.com/cloudnative-pg/api v1.29.0 h1:mNx6yJ5qi+Xrjs0NYrUy6V4MlXBkVJxGKwvTJZIuTX4=
|
github.com/cloudnative-pg/api v1.29.0 h1:mNx6yJ5qi+Xrjs0NYrUy6V4MlXBkVJxGKwvTJZIuTX4=
|
||||||
github.com/cloudnative-pg/api v1.29.0/go.mod h1:bF3HI8UVVcllZ7M8CfBufnb+Us8FyQArhD+4qtX0qhM=
|
github.com/cloudnative-pg/api v1.29.0/go.mod h1:bF3HI8UVVcllZ7M8CfBufnb+Us8FyQArhD+4qtX0qhM=
|
||||||
github.com/cloudnative-pg/barman-cloud v0.5.0 h1:DykSaX4o7ee2vyu5FQoG1RJsntHd+EIttIKZbJPlB1Q=
|
github.com/cloudnative-pg/barman-cloud v0.5.1 h1:vjkXrrxo2DQXHT9u9usqhtaHiPZ/lTfDVs/pIWYTepQ=
|
||||||
github.com/cloudnative-pg/barman-cloud v0.5.0/go.mod h1:SO2HzLa+GWlSIpGyxnISoJAFPIcaa/qDa33Bb3jefac=
|
github.com/cloudnative-pg/barman-cloud v0.5.1/go.mod h1:XPc5IUFP1y4cZX1sg+Pd8j9V4tmUEVnv3BGCpfQOOg8=
|
||||||
github.com/cloudnative-pg/cloudnative-pg v1.29.0 h1:49Dm8+y4va7RODspJjeaK8uMWP3OGAD0gMsxhjm16Mo=
|
github.com/cloudnative-pg/cloudnative-pg v1.29.0 h1:49Dm8+y4va7RODspJjeaK8uMWP3OGAD0gMsxhjm16Mo=
|
||||||
github.com/cloudnative-pg/cloudnative-pg v1.29.0/go.mod h1:0Sgb/50VyaCnQm3IbWqgnhQG8Kb6mgqo8Jo1J+KtkSI=
|
github.com/cloudnative-pg/cloudnative-pg v1.29.0/go.mod h1:0Sgb/50VyaCnQm3IbWqgnhQG8Kb6mgqo8Jo1J+KtkSI=
|
||||||
github.com/cloudnative-pg/cnpg-i v0.5.0 h1:/TOzpNT6cwNgrpftTtrnLKdoHgMwd+88vZgXjlVgXeE=
|
github.com/cloudnative-pg/cnpg-i v0.5.0 h1:/TOzpNT6cwNgrpftTtrnLKdoHgMwd+88vZgXjlVgXeE=
|
||||||
|
|||||||
@ -33,7 +33,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// updateRecoveryWindow updates the recovery window inside the object
|
// updateRecoveryWindow updates the recovery window inside the object
|
||||||
// store status subresource
|
// store status subresource. It uses retry logic to handle concurrent
|
||||||
|
// updates from backup completion and retention policy enforcement.
|
||||||
func updateRecoveryWindow(
|
func updateRecoveryWindow(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
c client.Client,
|
c client.Client,
|
||||||
@ -41,6 +42,14 @@ func updateRecoveryWindow(
|
|||||||
objectStore *barmancloudv1.ObjectStore,
|
objectStore *barmancloudv1.ObjectStore,
|
||||||
serverName string,
|
serverName string,
|
||||||
) error {
|
) error {
|
||||||
|
objectStoreKey := client.ObjectKeyFromObject(objectStore)
|
||||||
|
|
||||||
|
return retry.RetryOnConflict(retry.DefaultBackoff, func() error {
|
||||||
|
var freshObjectStore barmancloudv1.ObjectStore
|
||||||
|
if err := c.Get(ctx, objectStoreKey, &freshObjectStore); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Set the recovery window inside the barman object store object
|
// Set the recovery window inside the barman object store object
|
||||||
convertTime := func(t *time.Time) *metav1.Time {
|
convertTime := func(t *time.Time) *metav1.Time {
|
||||||
if t == nil {
|
if t == nil {
|
||||||
@ -49,16 +58,17 @@ func updateRecoveryWindow(
|
|||||||
return ptr.To(metav1.NewTime(*t))
|
return ptr.To(metav1.NewTime(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
recoveryWindow := objectStore.Status.ServerRecoveryWindow[serverName]
|
recoveryWindow := freshObjectStore.Status.ServerRecoveryWindow[serverName]
|
||||||
recoveryWindow.FirstRecoverabilityPoint = convertTime(backupList.GetFirstRecoverabilityPoint())
|
recoveryWindow.FirstRecoverabilityPoint = convertTime(backupList.GetFirstRecoverabilityPoint())
|
||||||
recoveryWindow.LastSuccessfulBackupTime = convertTime(backupList.GetLastSuccessfulBackupTime())
|
recoveryWindow.LastSuccessfulBackupTime = convertTime(backupList.GetLastSuccessfulBackupTime())
|
||||||
|
|
||||||
if objectStore.Status.ServerRecoveryWindow == nil {
|
if freshObjectStore.Status.ServerRecoveryWindow == nil {
|
||||||
objectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
freshObjectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
||||||
}
|
}
|
||||||
objectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
freshObjectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
||||||
|
|
||||||
return c.Status().Update(ctx, objectStore)
|
return c.Status().Update(ctx, &freshObjectStore)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// setLastFailedBackupTime sets the last failed backup time in the
|
// setLastFailedBackupTime sets the last failed backup time in the
|
||||||
|
|||||||
@ -143,10 +143,11 @@ spec:
|
|||||||
description: |-
|
description: |-
|
||||||
Compress a backup file (a tar file per tablespace) while streaming it
|
Compress a backup file (a tar file per tablespace) while streaming it
|
||||||
to the object store. Available options are empty string (no
|
to the object store. Available options are empty string (no
|
||||||
compression, default), `gzip`, `bzip2`, and `snappy`.
|
compression, default), `gzip`, `bzip2`, `lz4`, and `snappy`.
|
||||||
enum:
|
enum:
|
||||||
- bzip2
|
- bzip2
|
||||||
- gzip
|
- gzip
|
||||||
|
- lz4
|
||||||
- snappy
|
- snappy
|
||||||
type: string
|
type: string
|
||||||
encryption:
|
encryption:
|
||||||
|
|||||||
@ -15,7 +15,7 @@ for space, speed, or a balance of both.
|
|||||||
|
|
||||||
- `bzip2`
|
- `bzip2`
|
||||||
- `gzip`
|
- `gzip`
|
||||||
- `lz4` (WAL only)
|
- `lz4`
|
||||||
- `snappy`
|
- `snappy`
|
||||||
- `xz` (WAL only)
|
- `xz` (WAL only)
|
||||||
- `zstd` (WAL only)
|
- `zstd` (WAL only)
|
||||||
@ -41,3 +41,5 @@ network throughput.
|
|||||||
| bzip2 | 25,404 | 13,886 | 395 | 67 | 5.9:1 |
|
| bzip2 | 25,404 | 13,886 | 395 | 67 | 5.9:1 |
|
||||||
| gzip | 116,281 | 3,077 | 395 | 91 | 4.3:1 |
|
| gzip | 116,281 | 3,077 | 395 | 91 | 4.3:1 |
|
||||||
| snappy | 8,134 | 8,341 | 395 | 166 | 2.4:1 |
|
| snappy | 8,134 | 8,341 | 395 | 166 | 2.4:1 |
|
||||||
|
|
||||||
|
Numbers come from a 2021 Barman proof of concept ([EnterpriseDB/barman#344](https://github.com/EnterpriseDB/barman/issues/344#issuecomment-992547396)), which predates `lz4` support for base backups. `lz4` is not yet benchmarked.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user