From 4bf7f940b13f95ee331b638b8070a03d4d9c014d Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Wed, 20 Oct 2021 15:49:52 +0200 Subject: [PATCH] Remove mariadb-server packages from the host During updates/upgrades, installing mariadb-server on the host may impact the behaviour of containerized mysql. During a FFU if mariadb-server is upgraded, it may happen that the rpm scriptlets fail to start mariadb server and leave a crash log behind (tc.log). This prevents the regular online upgrade from happening. During an upgrade, mariadb-server used to be force-upgraded in the mysql service for historical reasons. It's not necessary since mysql is containerized and can trigger the same crash as explained above. During a minor update, the same reasoning can apply if RHEL channel ships a new mariadb-server rpm as scriptlets will probably leave a crash behind as well. Make sure mariadb-server is never installed, while keeping mariadb CLI if already present on the host, to avoid operational impacts. Change-Id: Ib669bb4a5fcbb493d6d5edb5999bd1d87418558b Closes-Bug: #1946742 (cherry picked from commit d33865cded7766eb8d35ce56d5eb206c2dda1ad9) --- deployment/database/mysql-pacemaker-puppet.yaml | 11 +++++------ .../tripleo-packages-baremetal-puppet.yaml | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deployment/database/mysql-pacemaker-puppet.yaml b/deployment/database/mysql-pacemaker-puppet.yaml index 5c2dcaee8c..cff9646e7a 100644 --- a/deployment/database/mysql-pacemaker-puppet.yaml +++ b/deployment/database/mysql-pacemaker-puppet.yaml @@ -382,6 +382,11 @@ outputs: container_image_latest: "{{galera_image_latest}}" when: - old_galera_image_id.stdout != new_galera_image_id.stdout + - name: Ensure mariadb-server is not installed on the host + when: step|int == 2 + yum: + name: 'mariadb-server*' + state: absent post_update_tasks: - name: Mysql bundle post update @@ -592,12 +597,6 @@ outputs: # So do not exercise the upgrade if mysql is already running. when: step|int == 3 block: - # mariadb package changes ownership of /var/lib/mysql on package - # update, so update here rather than in tripleo-package, to - # guarantee that ownership is fixed at the end of step 3 - - name: Update host mariadb packages - when: step|int == 3 - package: name=mariadb-server-galera state=latest - name: Mysql upgrade script set_fact: mysql_upgrade_script: diff --git a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml index 5f5aae184d..dc2ffeec84 100644 --- a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml +++ b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml @@ -186,7 +186,8 @@ outputs: block: - name: remove all OpenStack packages shell: | - yum -y remove *el7ost* -- \ + yum -y remove *el7ost* \ + mariadb-server* -- \ -*openvswitch* \ -python2-babel \ -python2-dateutil \