Bug #111999 MySQL Operator - backup jobs are not clear
Submitted: 8 Aug 2023 14:50 Modified: 8 Aug 2023 19:46
Reporter: Carlos Abrantes Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Operator Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[8 Aug 2023 14:50] Carlos Abrantes
Description:
Hi MySQL,

Can you please confirm if this is something i missed or something that was forgotten to be implemented?

When you use scheduled backup a cronjob is created.

kubectl -n mysql get cronjob
NAME                       SCHEDULE     SUSPEND   ACTIVE   LAST SCHEDULE   AGE
mysql-backup-schedule-cb   47 * * * *   False     0        50m             18d

but the jobs from this cronjob only create a MySQLBackup object and after the Operator seems to create another job to run the backup itself.

While the job that is created by the cronjob only has saved 3 instances (default history of a cronjob), seems that no one is taking care of the house keeping of the jobs created by the operator.

kubectl -n mysql get pods | grep "mysql-backup-schedule-cb" |wc -l
3
kubectl -n mysql get pods | grep "mysql-backup-schedule230" |wc -l
28

Version:
community-operator:8.0.33-2.0.10
community-server:8.0.33
community-router:8.0.33

apiVersion: v2
appVersion: 8.0.33
description: MySQL InnoDB Cluster Helm Chart for deploying MySQL InnoDB Cluster in Kubernetes
icon: https://labs.mysql.com/common/themes/sakila/favicon.ico
name: mysql-innodbcluster
type: application
version: 2.0.10

How to repeat:

Deploy backup in values:
backupProfiles:
- name: backup-profile-pvc
  dumpInstance:
    storage:
      persistentVolumeClaim:
        claimName: backup-volume-claim-1

backupSchedules:
- name: backup-schedule
  schedule: "1 3 * * *"
  deleteBackupData: false
  backupProfileName: backup-profile-pvc
  enabled: true

Thanks

Suggested fix:

Since its the MySQL Operator that creates this second job, it makes sense that also Operator deal with the house keeping having a default which should be possible to overwrite via a values file.
[8 Aug 2023 15:20] MySQL Verification Team
Hi Mr. Abrantes,

Thank you for your bug report.

However, it seems to us that you are not reporting a bug, but instead you would like that Operator gets some new features.

If that is your intention, please just list a detailed description of the features that you would like to see in our product and change Severity to S4.

We are waiting on your feedback.
[8 Aug 2023 19:46] MySQL Verification Team
Thanks for the report. Verified as described, looks like no housekeeping was done (or was not done properly).