Repository navigation
Description
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
fix(backup): start a Backup only once
fix(backup): start a Backup only once (#11617)
fix(backup): start a Backup only once (cloudnative-pg#11617)
fix(backup): start a Backup only once (#11617)