aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Bezak <bartosz@stackhpc.com>2026-08-25 10:24:42 +0200
committerBartosz Bezak <bartosz@stackhpc.com>2026-08-25 12:27:03 +0000
commit6e12d225082ab0ff2273d61febbdd8fb2bfa6e22 (patch)
tree4ec4d79341409a4be314bb94a1fe8ae6a45df169
parente3aa050a57e53c17d15aad0273fae397f4a690b8 (diff)
downloadkolla-ansible-6e12d225082ab0ff2273d61febbdd8fb2bfa6e22.tar.gz
kolla-ansible-6e12d225082ab0ff2273d61febbdd8fb2bfa6e22.zip
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-<date>.qp.xbc.xbs.gz, as the restore docs describe. Closes-Bug: #2165011 Related-Bug: #2125124 Change-Id: I33ebd36c728ff50df8ebf13fc5af9882a0e71d23 Signed-off-by: Bartosz Bezak <bartosz@stackhpc.com> (cherry picked from commit f1f2702bbe812e285f0766a5787159ba92fdce8b)
-rw-r--r--ansible/roles/mariadb/tasks/backup.yml4
-rw-r--r--ansible/roles/mariadb/templates/backup.my.cnf.j24
-rw-r--r--releasenotes/notes/mariadb-backup-connect-locally-9f4c2d1e7b3a0c65.yaml16
3 files changed, 19 insertions, 5 deletions
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 }}
diff --git a/releasenotes/notes/mariadb-backup-connect-locally-9f4c2d1e7b3a0c65.yaml b/releasenotes/notes/mariadb-backup-connect-locally-9f4c2d1e7b3a0c65.yaml
new file mode 100644
index 000000000..6b54520d4
--- /dev/null
+++ b/releasenotes/notes/mariadb-backup-connect-locally-9f4c2d1e7b3a0c65.yaml
@@ -0,0 +1,16 @@
+---
+fixes:
+ - |
+ Fixes MariaDB backups failing since MariaDB 10.11.19 and 11.4.13.
+ Mariabackup copied the data directory of ``mariadb_backup_host`` but
+ connected through the load balancer, which could route it to a different
+ Galera member. The backup lock then applied to the wrong node. It now
+ connects to the MariaDB instance on the host it backs up.
+upgrade:
+ - |
+ ``mariadb_backup_target`` no longer has any effect. Backups are always
+ taken from ``mariadb_backup_host``.
+ - |
+ Full backups are now named ``mysqlbackup-<date>.qp.xbc.xbs.gz`` and
+ incrementals ``incremental-<date>-mysqlbackup-<date>.qp.xbc.xbs.gz``,
+ matching the restore documentation. Existing backups remain restorable.