From d93c604d7af03e8b096faea8acaaaef718df2cd5 Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 5 Apr 2019 19:37:54 +0100
Subject: [PATCH] Remove shutdown of MariaDB

Since we are now in the Train cycle, we can be sure that any running
MariaDB containers can be safely stopped, and we do not need to perform
an explicit shutdown prior to restarting them.

Change-Id: I5450690f1cbe0c995e8e4b01a76e90dac2574d61
Related-Bug: #1820325
---
 ansible/roles/mariadb/handlers/main.yml | 65 -------------------------
 1 file changed, 65 deletions(-)

diff --git a/ansible/roles/mariadb/handlers/main.yml b/ansible/roles/mariadb/handlers/main.yml
index d378839824..d033561815 100644
--- a/ansible/roles/mariadb/handlers/main.yml
+++ b/ansible/roles/mariadb/handlers/main.yml
@@ -42,39 +42,6 @@
     - bootstrap_host == inventory_hostname
   listen: Bootstrap MariaDB cluster
 
-# NOTE(mgoddard): In Rocky the MariaDB image had an issue where it would not
-# stop on demand, and would result in Docker forcibly killing the container.
-# This could lead to a failed upgrade if the new image is unable to recover
-# from the crash. See https://bugs.launchpad.net/kolla-ansible/+bug/1820325.
-# TODO(mgoddard): Remove this task in Train.
-- name: shutdown slave mariadb
-  vars:
-    service_name: "mariadb"
-    service: "{{ mariadb_services[service_name] }}"
-  become: true
-  kolla_docker:
-    action: "start_container"
-    command: >-
-      bash -c '
-      sudo -E kolla_set_configs &&
-      mysqladmin shutdown --host={{ api_interface_address }} --user=root --password={{ database_password }}
-      '
-    common_options: "{{ docker_common_options }}"
-    detach: False
-    name: "mariadb_shutdown"
-    image: "{{ service.image }}"
-    volumes: "{{ service.volumes }}"
-    dimensions: "{{ service.dimensions }}"
-    labels:
-      UPGRADE:
-    restart_policy: "never"
-  no_log: true
-  when:
-    - kolla_action != "config"
-    - has_cluster | bool
-    - inventory_hostname != master_host
-  listen: restart mariadb
-
 - name: restart slave mariadb
   vars:
     service_name: "mariadb"
@@ -138,38 +105,6 @@
     - inventory_hostname != master_host
   listen: restart mariadb
 
-# NOTE(mgoddard): In Rocky the MariaDB image had an issue where it would not
-# stop on demand, and would result in Docker forcibly killing the container.
-# This could lead to a failed upgrade if the new image is unable to recover
-# from the crash. See https://bugs.launchpad.net/kolla-ansible/+bug/1820325.
-# TODO(mgoddard): Remove this task in Train.
-- name: shutdown master mariadb
-  vars:
-    service_name: "mariadb"
-    service: "{{ mariadb_services[service_name] }}"
-  become: true
-  kolla_docker:
-    action: "start_container"
-    command: >-
-      bash -c '
-      sudo -E kolla_set_configs &&
-      mysqladmin shutdown --host={{ api_interface_address }} --user=root --password={{ database_password }}
-      '
-    common_options: "{{ docker_common_options }}"
-    detach: False
-    name: "mariadb_shutdown"
-    image: "{{ service.image }}"
-    volumes: "{{ service.volumes }}"
-    dimensions: "{{ service.dimensions }}"
-    labels:
-      UPGRADE:
-    restart_policy: "never"
-  no_log: true
-  when:
-    - kolla_action != "config"
-    - inventory_hostname == master_host
-  listen: restart mariadb
-
 - name: restart master mariadb
   vars:
     service_name: "mariadb"