Skip to content

[Bug]: Backup controller can start the same Backup twice #11616

Closed

Description

@mnencia

Is there an existing issue already for this bug?

  • I have searched for an existing issue, and could not find anything. I believe this is a new bug.

I have read the troubleshooting guide

  • I have read the troubleshooting guide and I think this is a new bug.

I am running a supported version of CloudNativePG

  • I have read the troubleshooting guide and I think this is a new bug.

Contact Details

No response

Version

trunk (main)

What version of Kubernetes are you using?

1.36

What is your Kubernetes environment?

Cloud: Google GKE

How did you install the operator?

YAML manifest

What happened?

The backup controller can start the same Backup twice. Two reconciliations of one Backup both reach the point where the instance manager is asked to run it, about 0.5 seconds apart. Two barman-cloud-backup processes then run at once on the same instance, with different backup names.

We saw it twice in one night in our e2e, once with method: barmanObjectStore and once with method: plugin. The first failed a tablespaces spec with barman exit status 4, the second failed a check that expected one data.tar.gz and found two. The Backup got a single Starting event with a count of 2.

The guard in isValidBackupRunning decides from Status.Phase and Status.InstanceID read through the cache. If the second reconciliation runs before the cache has the status written by the first, it sees an unstarted backup. I reproduced this in a unit test by making the Backup read lag behind the start patch: the second reconciliation starts the backup again. With a fresh cache it starts once.

We expect a Backup to be started once.

Cluster resource

No response

Relevant log output

{"level":"info","ts":"...55.505","msg":"Starting backup","reconcileID":"52613f9c-...","pod":"cluster1-1"}
{"level":"info","ts":"...55.998","msg":"Starting backup","reconcileID":"e8f1f55c-...","pod":"cluster1-1"}
{"level":"info","ts":"...57.101","msg":"Backup is already running on","reconcileID":"3390db2f-...","pod":"cluster1-1"}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    bug 🐛
    triage
    on Oct 6, 2026
  2. added a commit that references this issue on Oct 13, 2026
    4055287
  3. added a commit that references this issue on Oct 14, 2026
    8449904
  4. added a commit that references this issue on Oct 14, 2026
    88137ac
  5. added a commit that references this issue on Oct 14, 2026
    1210bad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions