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
This commit is contained in:
Damien Ciabrini 2021-10-20 15:49:52 +02:00 committed by Jose Luis Franco Arza
parent 7e1ea5ddf0
commit d33865cded
2 changed files with 7 additions and 7 deletions

View File

@ -382,6 +382,11 @@ outputs:
container_image_latest: "{{galera_image_latest}}" container_image_latest: "{{galera_image_latest}}"
when: when:
- old_galera_image_id.stdout != new_galera_image_id.stdout - 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: post_update_tasks:
- name: Mysql bundle post update - name: Mysql bundle post update
@ -582,12 +587,6 @@ outputs:
# So do not exercise the upgrade if mysql is already running. # So do not exercise the upgrade if mysql is already running.
when: step|int == 3 when: step|int == 3
block: 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 - name: Mysql upgrade script
set_fact: set_fact:
mysql_upgrade_script: mysql_upgrade_script:

View File

@ -186,7 +186,8 @@ outputs:
block: block:
- name: remove all OpenStack packages - name: remove all OpenStack packages
shell: | shell: |
yum -y remove *el7ost* -- \ yum -y remove *el7ost* \
mariadb-server* -- \
-*openvswitch* \ -*openvswitch* \
-python2-babel \ -python2-babel \
-python2-dateutil \ -python2-dateutil \