Not able to create PerconaXtraDBClusterRestore resource on kubernetes

Hi all,

Using the following restore.yaml to create PerconaXtraDBClusterRestore

apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
  name: restore
  namespace: dkube-infra
spec:
  pxcCluster: mysql-db-pxc-db
  backupSource:
    destination: s3://dkube/backup/mysql-pxc-cluster/manual/
    s3:
      region: us-east-1
      credentialsSecret: mysql-pxc-backup-secret
      endpointUrl: http://dkube-minio-server:9000

It fails with the following error.

status:
  comments: 'run restore: s3: create job: Job.batch "restore-job-restore-mysql-db-pxc-db-mysql-db-pxc-db"
    is invalid: [spec.template.metadata.labels[controller-uid]: Invalid value: map[string]string{"controller-uid":"2bc05a56-6491-4598-8295-040d55d6f62c",
    "job-name":"restore-job-restore-mysql-db-pxc-db-mysql-db-pxc-db"}: must be ''3c7aca1d-f905-406b-9bd7-702bf5592dcd'',
    spec.template.metadata.labels: Invalid value: map[string]string{"controller-uid":"2bc05a56-6491-4598-8295-040d55d6f62c",
    "job-name":"restore-job-restore-mysql-db-pxc-db-mysql-db-pxc-db"}: selector
    does not match template labels]'
  state: Failed

Any idea why is the coming?
The 1st time when I restore, it works fine.
But the 2nd time when I try to restore it gives this error.

Hello @Sai_Shashank_Bandela ,

can you please share both restore CRs that you create? I assume they have different names, but anything else is different?

Also which version of the operator is it?

Hi @Sergey_Pronin ,

We use the same name as, at the end of each restore, we delete the restore Resource.

kind: PerconaXtraDBClusterRestore
metadata:
  name: restore-mysql-db-pxc-db
  namespace: dkube-infra
spec:
  PXCCluster: mysql-db-pxc-db
  backupSource:
    destination: s3://dkube/backup/mysql-pxc-cluster/manual/mysql-db-pxc-db-2023-03-13-11:27:35-full
    s3:
      credentialsSecret: mysql-pxc-backup-secret
      endpointUrl: http://dkube-minio-server:9000
      region: us-east-1

The operator version we use is 1.8.0

So the steps to reproduce are:

  1. Deploy the cluster using operator 1.8.0
  2. Backup
  3. Restore
  4. Delete restore object
  5. Restore again using the same backup and restore manifest

Is it correct?

BTW, why 1.8.0? It is extremely old.

Yes, those steps are correct.

Yeah… 1.8.0 I’m guessing is because that was the latest available version when this functionality was added our product.

I’m planning to try out with the latest operator 1.12.0.

Hi Team,

This issue is now fixed with upgrading the PXC Operator to 1.12.0

Thanks!