This repository was archived by the owner on Sep 21, 2022. It is now read-only.

Description
The drain script currently does not check whether the cluster is healthy before stopping a node:
|
#!/bin/bash -e |
|
|
|
/var/vcap/packages/mariadb/support-files/mysql.server stop --pid-file=/var/vcap/sys/run/mysql/mysql.pid > /dev/null |
|
return_code=$? |
|
echo 0 |
|
exit ${return_code} |
We think it would be safer to check if all cluster nodes are online and in sync before asking the local node to shutdown.