openark / orchestrator

MySQL replication topology management and HA
Apache License 2.0
5.64k stars 933 forks source link

Implement an API call to disable recovery for a single cluster #1216

Open pythian-ciciliani opened 4 years ago

pythian-ciciliani commented 4 years ago

On scenarios where an Orchestrator cluster is managing hundredths of MySQL pods, and you need to be able to disable recovery for a specific one, you need to either keep a list of all pods in RecoverMasterClusterFilters and add/remove items (with the corresponding reload of all orchestrator processes) or downtime each pod member individually.

It would be nice to be able to disable recovery for a single pod through the API

$ orchestrator-client -c disable-cluster-recovery -a mycluster1

$ orchestrator-client -c enable-cluster-recovery -a mycluster1

As discussed with @shlomi-noach, it would also be interesting to include a visual aid on the GUI and in the ascii topology output to remind users that recovery for that cluster is disabled

shlomi-noach commented 4 years ago

Things to consider:

yangeagle commented 4 years ago

If we set the master of a mysql cluster begin-downtime, can this achieve the goal?

shlomi-noach commented 4 years ago

yes, a being-downtime disables recoveries; however, notice that begin-downtime applies to a single host. So you'l need to make sure to always apply it on the master of the topology (if the master changes then apply it to the new master), or just apply it onto all cluster instances.