Delete leader node first
This commit is contained in:
parent
a2631e89f6
commit
dcb30a8489
10
net/gce.sh
10
net/gce.sh
|
@ -187,13 +187,19 @@ case $command in
|
||||||
delete)
|
delete)
|
||||||
$metricsWriteDatapoint "testnet-deploy net-delete-begin=1"
|
$metricsWriteDatapoint "testnet-deploy net-delete-begin=1"
|
||||||
|
|
||||||
gcloud_FindInstances "name~^$prefix-"
|
# Delete the leader node first to prevent unusual metrics on the dashboard
|
||||||
|
# during shutdown.
|
||||||
|
# TODO: It would be better to fully cut-off metrics reporting before any
|
||||||
|
# instances are deleted.
|
||||||
|
for filter in "^$prefix-leader" "^$prefix-"; do
|
||||||
|
gcloud_FindInstances "name~$filter"
|
||||||
|
|
||||||
if [[ ${#instances[@]} -eq 0 ]]; then
|
if [[ ${#instances[@]} -eq 0 ]]; then
|
||||||
echo "No instances found matching '^$prefix-'"
|
echo "No instances found matching '$filter'"
|
||||||
else
|
else
|
||||||
gcloud_DeleteInstances "$yes"
|
gcloud_DeleteInstances "$yes"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
rm -f "$configFile"
|
rm -f "$configFile"
|
||||||
|
|
||||||
$metricsWriteDatapoint "testnet-deploy net-delete-complete=1"
|
$metricsWriteDatapoint "testnet-deploy net-delete-complete=1"
|
||||||
|
|
Loading…
Reference in New Issue