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

Optional enable_drain_healthcheck, removed status code 000 check #214

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jobs/mysql/spec
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ properties:
description: 'Maximum total number of database connections for the node'
default: 1500
cf_mysql.mysql.enable_drain_healthcheck:
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.'
description: 'When this is enabled, the --skip-drain flag is required in order to delete a deployment and scaling down of instances. Drain healthcheck cannot be enabled when using the arbitrator. Enabling this ensures mysql nodes will verify the health of all other nodes before draining.'
default: false
cf_mysql.mysql.tls.ca_certificate:
description: 'CA Certificate which signed the server certificate'
Expand Down
2 changes: 1 addition & 1 deletion jobs/mysql/templates/drain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for NODE in "${CLUSTER_NODES[@]}"; do
set +e
status_code=$(curl -s -o "/dev/null" -w "%{http_code}" "$NODE:$GALERA_HEALTHCHECK_PORT")
set -e
if [[ $status_code -eq 000 || $status_code -eq 200 ]]; then
if [ $status_code -eq 200 ]; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ $status_code -eq 200 ]; then
if [[ $status_code -eq 200 ]]; then

Double square brackets are to be kept, in order to ensure that we can safely skip quoting around the $status_code variable.

continue
else
echo "$(date): galera heathcheck returned $status_code; drain failed on node ${NODE}" >> "${LOG_DIR}/drain.err.log"
Expand Down