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

Commit 4c657b3

Browse files
APShirleyCaroline Taymor
authored andcommitted
Add optional enable_drain_healthcheck feature
Notes: This feature cannot be used with the arbitrator. If it is enabled and the deployment uses the arbitrator, then drain will always fail. When enabled, this feature will prevent deleting deployments, unless the --force flag is used. [#157656403] Signed-off-by: Caroline Taymor <[email protected]>
1 parent 04cdb48 commit 4c657b3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

jobs/mysql/spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ properties:
8383
cf_mysql.mysql.max_connections:
8484
description: 'Maximum total number of database connections for the node'
8585
default: 1500
86+
cf_mysql.mysql.enable_drain_healthcheck:
87+
description: 'When this is enabled, the --skip-drain flag is required in order to delete a deployment. Drain healthcheck cannot be enabled when using the arbitrator. Enabling this ensures mysql nodes will verify the health of all other nodes before draining.'
88+
default: false
8689
cf_mysql.mysql.tls.ca_certificate:
8790
description: 'CA Certificate which signed the server certificate'
8891
cf_mysql.mysql.tls.server_certificate:

jobs/mysql/templates/drain.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<% if p('cf_mysql_enabled') == true %>
44
set -e -o pipefail
5-
5+
<% if p('cf_mysql.mysql.enable_drain_healthcheck') == true %>
66
<%
77
cluster_ips = link('mysql').instances.map(&:address)
88
if_link('arbitrator') do
@@ -36,7 +36,7 @@ for NODE in "${CLUSTER_NODES[@]}"; do
3636
exit -1
3737
fi
3838
done
39-
39+
<% end %>
4040
# Actually drain with a kill_and_wait on the mysql pid
4141
PIDFILE=/var/vcap/sys/run/mariadb_ctl/mariadb_ctl.pid
4242
source /var/vcap/packages/cf-mysql-common/pid_utils.sh

0 commit comments

Comments
 (0)