Catalog maintenance deletes completed Backup objects after a short barman-cloud-backup-list result
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
调研方向
Read internal/cnpgi/instance/retention.go first, focusing on how GetBackupList results are used during catalog maintenance and how completed Backup objects are selected for deletion. Reproduce or test the short or empty listing case, then verify that transient catalog results no longer remove valid backups while intended retention cleanup still works.
由索引模型根据 Issue 内容生成。
描述
Versions: plugin-barman-cloud v0.13.0, CloudNativePG 1.30.0, Kubernetes 1.35, S3-compatible object storage (STACKIT).
What happened
On 2026-09-18 the plugin sidecar on the primary of two unrelated clusters logged Deleting backup not in the catalog for the two newest completed Backup objects (the base backups of the 17th and the 18th) and removed them:
{"level":"info","ts":"2026-09-18T09:50:05Z","msg":"Applying backup retention policy","logging_pod":"portal-postgres-2","retentionPolicy":"30d"}
{"level":"info","ts":"2026-09-18T09:50:07Z","msg":"Deleting backup not in the catalog","logging_pod":"portal-postgres-2","backup":"portal-postgres-daily-backup-20260917011500"}
{"level":"info","ts":"2026-09-18T09:50:07Z","msg":"Deleting backup not in the catalog","logging_pod":"portal-postgres-2","backup":"portal-postgres-daily-backup-20260918011500"}
The operator then logged terminal error: Backup.postgresql.cnpg.io "portal-postgres-daily-backup-20260917011500" not found for both objects. The same happened on a second cluster in another namespace at 13:05 UTC.
The bucket itself was intact: ObjectStore.status.serverRecoveryWindow kept its firstRecoverabilityPoint (2026-08-25) and lastSuccessfulBackupTime, WAL archiving never failed, and the next night's scheduled backup completed normally. The kube-apiserver showed a short 5xx spike in the same minute (about 16 errors/s for two five-minute windows, otherwise ~0.02/s), so the listing most likely came back short or empty.
Cause, as far as I can see
internal/cnpgi/instance/retention.go deletes every completed Backup object of the cluster whose status.backupID is not in the current GetBackupList result. There is no guard for the listing itself: an empty or partial catalog (transient object-store or API error, eventual consistency) deletes valid objects. On this side the effect was a false no backup in 26h alert; on a cluster that relies on Backup objects for restore selection it would hide two valid base backups.
Suggestions
- Skip the deletion pass when the listing is empty, or when it lists fewer backups than the
Backupobjects that are older than the newest catalog entry. - Only delete objects whose backup is older than the retention window, since that is the only case where the catalog is expected to have dropped them.
- Or require an ID to be missing in two consecutive listings before the object is removed.
Happy to provide more logs or test a fix.
- 主要语言
- Go
- 星标
- 200
- 派生
- 82
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 25
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudnative-pg/plugin-barman-cloud 的其他 Issue
-
docs: troubleshooting does not cover "cannot proceed with the backup as the cluster has no backup section"可能已有人在做 @fjvbn2003 于 4 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 85/100
cloudnative-pg/plugin-barman-cloud#1165 ·
维护者通常 1 天内回复
-
Wrong `ObjectStore` key logged when the backup object store can't be retrieved in the instance sidecar可能已有人在做 @BoxBoxJason 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
cloudnative-pg/plugin-barman-cloud#1142 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
cloudnative-pg/plugin-barman-cloud#1117 · 1 个 reaction ·
维护者通常 1 天内回复
-
data.compression rejects zstd although barman-cloud-backup supports it可能已有人在做 @dgsardina 于 15 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
cloudnative-pg/plugin-barman-cloud#1104 · 4 个 reaction ·
维护者通常 1 天内回复
-
Add RBAC aggregation labels to ObjectStore editor/viewer ClusterRoles可能已有人在做 @stefanpeknik 于 34 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
cloudnative-pg/plugin-barman-cloud#1102 ·
维护者通常 1 天内回复
查看 cloudnative-pg/plugin-barman-cloud 的全部 Issue
相似的 Issue
-
area/gateway kind/bug
难度 2/5 1-3 小时 新手友好度 74/100
vllm-project/aibrix#3226 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
gencrl: serial numbers that fail to parse are added to the CRL as 0 or a partial value可能已有人在做 @sebxt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
cloudflare/cfssl#1460 ·
维护者通常 2 天内回复
-
bug
难度 1/5 1 小时以内 新手友好度 75/100
ironcore-dev/cloud-hypervisor-provider#210 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
OpenTollGate/tollgate-module-basic-go#1027 ·
维护者通常 1 天内回复