From 6e12d225082ab0ff2273d61febbdd8fb2bfa6e22 Mon Sep 17 00:00:00 2001 From: Bartosz Bezak Date: Tue, 25 Aug 2026 10:24:42 +0200 Subject: mariadb: Back up from the local database instance Mariabackup copies the data directory of mariadb_backup_host but connected through the load balancer, so backup_replica.sh could redirect it to another Galera member. The backup lock then applied to the wrong node, leaving the copied files unquiesced. Connect to api_interface_address and mariadb_port instead, and always use the local backup script. MariaDB 10.11.19 and 11.4.13 no longer tolerate the mismatch. mariadb_backup_target now has no effect, and full backups are named mysqlbackup-.qp.xbc.xbs.gz, as the restore docs describe. Closes-Bug: #2165011 Related-Bug: #2125124 Change-Id: I33ebd36c728ff50df8ebf13fc5af9882a0e71d23 Signed-off-by: Bartosz Bezak (cherry picked from commit f1f2702bbe812e285f0766a5787159ba92fdce8b) --- ansible/roles/mariadb/tasks/backup.yml | 4 +--- ansible/roles/mariadb/templates/backup.my.cnf.j2 | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'ansible') diff --git a/ansible/roles/mariadb/tasks/backup.yml b/ansible/roles/mariadb/tasks/backup.yml index 55a7fcf51..665fc5a1e 100644 --- a/ansible/roles/mariadb/tasks/backup.yml +++ b/ansible/roles/mariadb/tasks/backup.yml @@ -10,12 +10,10 @@ register: container_facts - name: Taking database backup via Mariabackup - backup type {{ mariadb_backup_type }} - vars: - cmd: "{{ 'kolla_mariadb_backup.sh' if mariadb_backup_target == 'active' else 'kolla_mariadb_backup_replica.sh' }}" become: true kolla_container: action: "start_container" - command: "bash -c 'sudo -E kolla_set_configs && /usr/local/bin/{{ cmd }}'" + command: "bash -c 'sudo -E kolla_set_configs && /usr/local/bin/kolla_mariadb_backup.sh'" common_options: "{{ docker_common_options }}" detach: false # NOTE(mgoddard): Try to use the same image as the MariaDB server container diff --git a/ansible/roles/mariadb/templates/backup.my.cnf.j2 b/ansible/roles/mariadb/templates/backup.my.cnf.j2 index 0620e046a..8d1ae2593 100644 --- a/ansible/roles/mariadb/templates/backup.my.cnf.j2 +++ b/ansible/roles/mariadb/templates/backup.my.cnf.j2 @@ -2,5 +2,5 @@ default-character-set=utf8 user={{ mariadb_backup_database_user }} password={{ mariadb_backup_database_password }} -host={{ database_address }} -port={{ database_port }} +host={{ api_interface_address }} +port={{ mariadb_port }} -- cgit v1.2.3