diff --git a/ansible/roles/mariadb/defaults/main.yml b/ansible/roles/mariadb/defaults/main.yml index eaa318963b..8adb3e7403 100644 --- a/ansible/roles/mariadb/defaults/main.yml +++ b/ansible/roles/mariadb/defaults/main.yml @@ -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 %}" diff --git a/ansible/roles/mariadb/tasks/backup.yml b/ansible/roles/mariadb/tasks/backup.yml index ef78107eb6..300581bc60 100644 --- a/ansible/roles/mariadb/tasks/backup.yml +++ b/ansible/roles/mariadb/tasks/backup.yml @@ -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 diff --git a/releasenotes/notes/bug-2058644-1db8786303234787.yaml b/releasenotes/notes/bug-2058644-1db8786303234787.yaml new file mode 100644 index 0000000000..ec1286d322 --- /dev/null +++ b/releasenotes/notes/bug-2058644-1db8786303234787.yaml @@ -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.