canonical / mysql-router-k8s-operator

Mysql router operator charm for kubernetes
https://charmhub.io/mysql-router-k8s
Apache License 2.0
2 stars 7 forks source link

[DPE-5711] Add warnings to destructive actions #336

Open sinclert-canonical opened 6 days ago

sinclert-canonical commented 6 days ago

This PR adds warning level messages when a destructive action is performed. The definition of destructive seems to be associated with data loss, which I think it can only happen, from user action, whenever they force a primary failover without checking considering the health of such instance.

Additional info

sinclert-canonical commented 4 days ago

Can you please explain the benefits of merging this? Warning for force action?

I think that the upgrade action will not execute the upgrade if the unit is considered unhealthy (whatever that means). This action could be forced by using the --force flag, which, may lead to data-loss.

Can we warn it globally in a moment of setting force=True?

We could put it in the charm's _on_resume_upgrade_action method (only one that calls the Upgrade.reconcile_upgrade method with an event), but we would be raising warnings even if the upgrade is not actually executed. Do we want that?

sinclert-canonical commented 3 days ago

Added info messages to Workload._diable_router method.