dalibo / dalibo/cnpg-plugin-pgbackrest

Backup fails without `target: primary` - "unable to find primary cluster"

Open
#54 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
36
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hello,

I have created a cluster with 2 instances and the plugin and executed the following backup:

---
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
  name: pg16-pgbackrest-daily-backup
  namespace: postgres
spec:
  schedule: "0 3 * * *"
  backupOwnerReference: self
  cluster:
    name: pg16-pgbackrest
  method: plugin
#  target: primary
  pluginConfiguration:
    name: pgbackrest.dalibo.com

When I don't use target: primary I have the following error: unable to find primary cluster.
Using it fixes the backup.

  • CNPG: 1.27.0
  • Plugin: latest
  • kind v0.30.0 go1.24.6 linux/amd64

Robin,

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied ScheduledBackup manifest with and without target: primary on CNPG 1.27.0, using the reported plugin configuration. Trace where the plugin selects the primary cluster and confirm that the backup succeeds without the explicit target; the issue is done when the failing configuration works reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
databases, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.