Update MariaDB version to 10.6.7

We also modify workaround applied for 10.6 upgrade wrt to bug [1]
as it has been added extra tools to help with checking state of upgrade.

New flag --check-if-upgrade-is-needed is checking if any upgrade is
already running and waits until it's finished.
It exits with rc 0 if upgrade is required and 1 if not.

If upgrade is required, we fall into rescue and perform upgrade.

[1] https://jira.mariadb.org/browse/MDEV-27068

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/835091
Change-Id: I8f32eb32388c23284b7e0272f6a0fbb7235c443d
This commit is contained in:
Dmitriy Rabotyagov 2022-03-15 12:37:11 +01:00 committed by Jonathan Rosser
parent 81615669c6
commit 515daa62f0
2 changed files with 17 additions and 17 deletions

View File

@ -43,7 +43,7 @@ galera_mariadb_server_package: "{{ _galera_mariadb_server_package }}"
# The major version used to select the repo URL path
galera_major_version: 10.6
galera_minor_version: 5
galera_minor_version: 7
# Set the URL for the MariaDB repository
galera_repo_host: "downloads.mariadb.com"

View File

@ -13,22 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Run MySQL Upgrade
command: /usr/bin/mariadb-upgrade --version-check
register: galera_mysql_upgrade
changed_when:
- not galera_mysql_upgrade.stdout is search("already upgraded")
until: galera_mysql_upgrade is success
when: ansible_facts['os_family'] | lower == 'redhat'
retries: 3
delay: 10
# NOTE(noonedeadpunk): debian-start runs mariadb-upgrade with systemd unit so we
# need to wait for it to finish to avoid race conditions
- name: Wait for MySQL Upgrade to finish
wait_for:
path: "{{ galera_data_dir }}/mysql_upgrade_info"
search_regex: "^{{ galera_major_version }}.{{ galera_minor_version }}"
- name: Run mysql_upgrade
block:
- name: Fail if upgrade is needed
command: /usr/bin/mariadb-upgrade --check-if-upgrade-is-needed
register: galera_upgrade_check
failed_when: galera_upgrade_check.rc == 0
changed_when: False
rescue:
- name: Run MySQL Upgrade
command: /usr/bin/mariadb-upgrade
register: galera_mysql_upgrade
changed_when:
- not galera_mysql_upgrade.stdout is search("already upgraded")
until: galera_mysql_upgrade is success
retries: 3
delay: 10
# NOTE(noonedeadpunk): We don't need to verify hostname when connectig to socket
- name: Create galera users