Bug #119942 Cannot re-create InnoDBCluster with existing PVCs
Submitted: 25 Feb 14:47
Reporter: Tamas Kelemen Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Operator Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[25 Feb 14:47] Tamas Kelemen
Description:
When deleting InnoDBCluster from kubernetes, PVCs are left on the cluster, because this is the default behavior of StatefulSet.

But when creating the cluster again, with the same specs, but with initDB part deleted, the cluster cannot start.

I guess this is because generated secrets are not kept and they were rotated during 2nd cluster install:
mysql-test-backup
mysql-test-privsecrets
mysql-test-router

How to repeat:
1. Create cluster from scratch with/without initDB parameter set -
2. Save old cluster password: kubectl get secret mysql-test-privsecrets -o yaml
3. Delete cluster - list PVCs and secrets
4. Create cluster - with initDB parameter removed from definition
5. Check cluster password: kubectl get secret mysql-test-privsecrets -o yaml

Suggested fix:
Either keep generated secrets during delete, or add option to use pre-defined passwords from InnoDBCluster.spec.secretName

I'm not sure what is the graceful way to pause group replication during pod restart/recreate