Bootstrap from the backup and set backup in same time
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- kubernetes, postgresql
- Lĩnh vực
- databases, infrastructure
Hướng nghiên cứu
Tái hiện quá trình khôi phục bằng hai manifest và kiểm tra các điểm vào restore đã được báo cáo trong internal/cmd/manager/instance/restore/restore.go và cmd.go. So sánh quá trình khôi phục khi có và không có trường plugins, sau đó xác minh rằng bootstrap hoàn tất và các bản backup có thể tiếp tục được ghi vào cùng ObjectStore mà không cần chỉnh sửa thủ công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi!
I started using the CNPG Barman Cloud Plugin and I faced an issue related to bootstrap a cluster from backup and immediately set the backup to same place.
I have a working CNPG database that is extended with back up to S3.
---
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: garage-store
namespace: harbor
spec:
configuration:
destinationPath: s3://cluster-services-cnpg/harbor/pg-harbor
endpointURL: http://172.31.255.255:3900
s3Credentials:
accessKeyId:
name: cnpg-s3-credentials
key: key_id
secretAccessKey:
name: cnpg-s3-credentials
key: secret_key
region:
name: cnpg-s3-credentials
key: region
data:
compression: "bzip2"
jobs: 5
wal:
compression: bzip2
retentionPolicy: "2d"
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: pg-harbor
namespace: harbor
spec:
instances: 3
bootstrap:
initdb:
database: harbor
owner: harbor
secret:
name: pg-harbor-creds
storage:
storageClass: database
size: 5Gi
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: garage-store
Works well. After bootstrap DB starts and making the backups when shceduled
---
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: backup-pg
namespace: harbor
spec:
schedule: "0 0 */3 * * *"
backupOwnerReference: self
cluster:
name: pg-harbor
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
My problem occurs when I bootstrap the cluster from the backup. As I have previous backup, I'd like to bootstram the cluster from this and continue operation, continue backups to the same location. My previous manifest modified a little.
---
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: garage-store
namespace: harbor
spec:
configuration:
destinationPath: s3://cluster-services-cnpg/harbor/pg-harbor
endpointURL: http://172.31.255.255:3900
s3Credentials:
accessKeyId:
name: cnpg-s3-credentials
key: key_id
secretAccessKey:
name: cnpg-s3-credentials
key: secret_key
region:
name: cnpg-s3-credentials
key: region
data:
compression: "bzip2"
jobs: 5
wal:
compression: bzip2
retentionPolicy: "2d"
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: pg-harbor
namespace: harbor
spec:
instances: 3
bootstrap:
recovery:
source: source
externalClusters:
- name: source
plugin:
name: barman-cloud.cloudnative-pg.io
parameters:
barmanObjectName: garage-store
serverName: pg-harbor
storage:
storageClass: database
size: 5Gi
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: garage-store
When I check the pod status I got this:
☸ admin@services (harbor) k get pod --watch pg-harbor-1-full-recovery-jkhd7
NAME READY STATUS RESTARTS AGE
pg-harbor-1-full-recovery-jkhd7 0/2 Init:0/2 0 4s
pg-harbor-1-full-recovery-jkhd7 0/2 Init:1/2 0 14s
pg-harbor-1-full-recovery-jkhd7 0/2 Init:1/2 0 15s
pg-harbor-1-full-recovery-jkhd7 0/2 PodInitializing 0 24s
pg-harbor-1-full-recovery-jkhd7 1/2 PodInitializing 0 24s
pg-harbor-1-full-recovery-jkhd7 2/2 Running 0 25s
pg-harbor-1-full-recovery-jkhd7 1/2 Error 0 26s
pg-harbor-1-full-recovery-jkhd7 0/2 Error 0 27s
pg-harbor-1-full-recovery-jkhd7 0/2 Error 0 29s
pg-harbor-1-full-recovery-jkhd7 0/2 Error 0 30s
^C
➜ took 29s ☸ admin@services (harbor)
And when I inspect the logs
☸ admin@services (harbor) k logs pg-harbor-1-full-recovery-jkhd7
Defaulted container "full-recovery" out of: full-recovery, bootstrap-controller (init), plugin-barman-cloud (init)
{"level":"info","ts":"2025-12-21T13:58:47.851283563Z","msg":"Starting webserver","logging_pod":"pg-harbor-1-full-recovery","address":"localhost:8010","hasTLS":false}
{"level":"info","ts":"2025-12-21T13:58:47.952621901Z","msg":"Restore through plugin detected, proceeding...","logging_pod":"pg-harbor-1-full-recovery"}
{"level":"error","ts":"2025-12-21T13:58:49.333358679Z","msg":"Error while restoring a backup","logging_pod":"pg-harbor-1-full-recovery","error":"rpc error: code = Unknown desc = unexpected failure invoking barman-cloud-wal-archive: exit status 1","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\tpkg/mod/github.com/cloudnative-pg/[email protected]/pkg/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/restore.restoreSubCommand\n\tinternal/cmd/manager/instance/restore/restore.go:79\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/restore.(*restoreRunnable).Start\n\tinternal/cmd/manager/instance/restore/restore.go:62\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\tpkg/mod/sigs.k8s.io/[email protected]/pkg/manager/runnable_group.go:260"}
{"level":"info","ts":"2025-12-21T13:58:49.333465791Z","msg":"Stopping and waiting for non leader election runnables"}
{"level":"info","ts":"2025-12-21T13:58:49.333486512Z","msg":"Stopping and waiting for leader election runnables"}
{"level":"info","ts":"2025-12-21T13:58:49.333500334Z","msg":"Stopping and waiting for warmup runnables"}
{"level":"info","ts":"2025-12-21T13:58:49.333550259Z","msg":"Webserver exited","logging_pod":"pg-harbor-1-full-recovery","address":"localhost:8010"}
{"level":"info","ts":"2025-12-21T13:58:49.333564299Z","msg":"Stopping and waiting for caches"}
{"level":"info","ts":"2025-12-21T13:58:49.333623698Z","msg":"Stopping and waiting for webhooks"}
{"level":"info","ts":"2025-12-21T13:58:49.333658061Z","msg":"Stopping and waiting for HTTP servers"}
{"level":"info","ts":"2025-12-21T13:58:49.333687895Z","msg":"Wait completed, proceeding to shutdown the manager"}
{"level":"error","ts":"2025-12-21T13:58:49.333710044Z","msg":"restore error","logging_pod":"pg-harbor-1-full-recovery","error":"while restoring cluster: rpc error: code = Unknown desc = unexpected failure invoking barman-cloud-wal-archive: exit status 1","stacktrace":"github.com/cloudnative-pg/machinery/pkg/log.(*logger).Error\n\tpkg/mod/github.com/cloudnative-pg/[email protected]/pkg/log/log.go:125\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/restore.NewCmd.func1\n\tinternal/cmd/manager/instance/restore/cmd.go:101\ngithub.com/spf13/cobra.(*Command).execute\n\tpkg/mod/github.com/spf13/[email protected]/command.go:1015\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tpkg/mod/github.com/spf13/[email protected]/command.go:1148\ngithub.com/spf13/cobra.(*Command).Execute\n\tpkg/mod/github.com/spf13/[email protected]/command.go:1071\nmain.main\n\tcmd/manager/main.go:71\nruntime.main\n\t/opt/hostedtoolcache/go/1.25.3/x64/src/runtime/proc.go:285"}
☸ admin@services (harbor)
If I remove the plugin from the spec field and bootstrap only from the backup and edit it later it works well.
I'd like to ask is this possible to bootstrap from the backup and immediately continue the work? I need this to use with FluxCD GitOps so if it work manual work will not be needed in case of a reinstall or any issue.
- Ngôn ngữ chính
- Go
- Star
- 198
- Fork
- 81
- Merge trung bình
- 2 ngày 6 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
-
Wrong `ObjectStore` key logged when the backup object store can't be retrieved in the instance sidecarCó thể đã có người làm @SamarthSRao đã nhận 3 ngày trước. Đang mở
Độ 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 · 1 bình luận ·
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 @dgsardina đã nhận 5 ngày trước. Đ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 24 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
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 18/100
cloudnative-pg/plugin-barman-cloud#1151 ·
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ự
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FairwindsOps/nova#484 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated-analysis code-quality cookie
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
github/gh-aw#67517 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[otelcol] print-config help text still requires the removed otelcol.printInitialConfig feature gateCó thể đã có người làm @girishkvs đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
open-telemetry/opentelemetry-collector#16143 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue load-balancing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ktrubilo9/edge-proxy#53 ·