Record the object store and server name of a backup in Backup.status.pluginMetadata
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start in internal/cnpgi/instance/types.go at newBackupResultMetadata, then trace how the plugin resolves the ObjectStore and serverName for a backup. Check the existing backup/plugin tests and add coverage for the proposed metadata keys, including the optional endpointURL. Done means Backup.status.pluginMetadata records the backup location and resolved server name without changing existing metadata.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
A Backup taken through the plugin doesn't record which ObjectStore and which serverName the backup was written to. When creating a recovery cluster, we have to find that out by other means and write it by hand in the externalClusters entry.
I'd like the plugin to add this information to the backup result metadata, so that it ends up in Backup.status.pluginMetadata.
This is related to #510 and cloudnative-pg/cloudnative-pg#7989 (recovery from a plugin Backup object), which I believe need this as a first step.
Our use case
Our clusters archive under a timestamped serverName (for example mydb-20261003T120000), set through the serverName plugin parameter, and a new one is generated for each new generation of a cluster.
The archive path has to be empty when a cluster starts archiving, and a fresh, dated serverName gives us that without deleting older archives.
Over time, the bucket holds one folder per generation.
To create a recovery cluster from a given backup, we need to know which of these folders holds it. The plugin's recovery default for serverName is the name of the new cluster (internal/cnpgi/operator/config/config.go), which never matches a timestamp, so we have to find the value by listing the bucket or
digging through old manifests.
The Backup object is the natural place to keep the link between a backup and its location, and it's where the in-tree integration kept it: Backup.status.serverName, destinationPath and endpointURL were all set. Since the in-tree integration is deprecated since 1.26, anyone migrating to the plugin loses that.
Environment
- CloudNativePG operator: main (the behaviour is the same on current releases)
- plugin-barman-cloud: v0.15.1
What a plugin backup records today
apiVersion: postgresql.cnpg.io/v1
kind: Backup
spec:
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
status:
backupId: ...
pluginMetadata:
clusterUID: ...
displayName: ...
name: ...
pluginName: ...
timeline: "1"
version: ...
Nothing in it says where the backup went. newBackupResultMetadata (internal/cnpgi/instance/types.go) is where these keys are built.
Proposal
Add the configuration the backup was taken with to the same map:
| Key | Value |
|---|---|
barmanObjectName |
name of the ObjectStore used for the backup |
serverName |
resolved server name (the serverName parameter, or the cluster name when unset) |
destinationPath |
ObjectStore.spec.configuration.destinationPath at backup time |
endpointURL |
ObjectStore.spec.configuration.endpointURL at backup time, when set |
This only adds keys and doesn't change any existing behaviour. destinationPath and endpointURL aren't strictly needed to locate the data, since they can be read from the ObjectStore, but they let a later restore detect that the ObjectStore has been changed to point somewhere else since the backup was taken.
Shipping this early matters even if nothing consumes it yet: backups taken before it lands will never carry the information.
Alternatives considered
- Dedicated fields in
Backup.status(serverName,destinationPath): they would need new fields in the CNPG-IBackupResultmessage for concepts that are specific to Barman, sopluginMetadatalooks like the right place. - Keep the status quo and document that
serverNamemust always be set in the recovery source.
This is what we do today, but with timestamped names the value has to be found outside the cluster. - Change the default recovery
serverName: no default can guess a timestamp, and changing it would break users who rely on the current one.
I used an AI assistant (Claude) to help draft this issue and to check the references against the plugin and operator sources, as the AI policy asks for disclosure.
- Ngôn ngữ chính
- Go
- Star
- 196
- Fork
- 76
- Merge trung bình
- 4 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 19
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudnative-pg/plugin-barman-cloud
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cloudnative-pg/plugin-barman-cloud#1142 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
cloudnative-pg/plugin-barman-cloud#1117 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
data.compression rejects zstd although barman-cloud-backup supports itCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
cloudnative-pg/plugin-barman-cloud#1104 · 4 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add RBAC aggregation labels to ObjectStore editor/viewer ClusterRolesCó thể đã có người làm @stefanpeknik đã nhận 19 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
cloudnative-pg/plugin-barman-cloud#1102 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Credentials embedded in `endpointURL` are written in clear text to the instance sidecar logsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
cloudnative-pg/plugin-barman-cloud#1143 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cloudnative-pg/plugin-barman-cloud
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
FootprintAI/Containarium#2338 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: core doesn't build standalone on dev since a17068054 (go-mp3 require dropped, go.sum pruned)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
SagerNet/sing-openvpn#11 ·
-
priority: P3 type: devops
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
jiegui2025/hwspec#57 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
columnar-tech/dbc#513 ·
Maintainer thường phản hồi trong vòng 1 ngày