Merge "Use the running MariaDB server image for backups"

This commit is contained in:
Zuul 2024-06-18 11:11:42 +00:00 committed by Gerrit Code Review
commit a7311034d2
3 changed files with 28 additions and 5 deletions

View File

@ -120,10 +120,6 @@ mariadb_wsrep_extra_provider_options: []
####################
# Backups
####################
mariabackup_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/mariadb-server"
mariabackup_tag: "{{ mariadb_tag }}"
mariabackup_image_full: "{{ mariabackup_image }}:{{ mariabackup_tag }}"
mariadb_backup_host: "{{ groups[mariadb_shard_group][0] }}"
mariadb_backup_database_schema: "PERCONA_SCHEMA"
mariadb_backup_database_user: "{% if mariadb_loadbalancer == 'haproxy' %}backup{% else %}{{ mariadb_shard_backup_user_prefix }}{{ mariadb_shard_id | string }}{% endif %}"

View File

@ -1,4 +1,13 @@
---
- name: Get MariaDB container facts
become: true
kolla_container_facts:
container_engine: "{{ kolla_container_engine }}"
name:
- "{{ mariadb_services.mariadb.container_name }}"
check_mode: false
register: container_facts
- name: Taking {{ mariadb_backup_type }} database backup via Mariabackup
become: true
kolla_container:
@ -6,7 +15,10 @@
command: "bash -c 'sudo -E kolla_set_configs && /usr/local/bin/kolla_mariadb_backup.sh'"
common_options: "{{ docker_common_options }}"
detach: False
image: "{{ mariabackup_image_full }}"
# NOTE(mgoddard): Try to use the same image as the MariaDB server container
# to avoid compatibility issues. See
# https://bugs.launchpad.net/kolla-ansible/+bug/2058644.
image: "{{ container_facts.mariadb.Image | default(mariadb_services.mariadb.image) }}"
name: "mariabackup"
restart_policy: oneshot
remove_on_exit: True

View File

@ -0,0 +1,15 @@
---
upgrade:
- |
MariaDB backup now uses the same image as the running MariaDB server. The
following variables relating to MariaDB backups are no longer used and have
been removed:
* ``mariabackup_image``
* ``mariabackup_tag``
* ``mariabackup_image_full``
fixes:
- |
Modifies the MariaDB procedure to use the same container image as the
running MariaDB server container. This should prevent compatibility issues
that may cause the backup to fail.