diff options
| -rw-r--r-- | ansible/roles/mariadb/tasks/backup.yml | 4 | ||||
| -rw-r--r-- | ansible/roles/mariadb/templates/backup.my.cnf.j2 | 4 | ||||
| -rw-r--r-- | releasenotes/notes/mariadb-backup-connect-locally-9f4c2d1e7b3a0c65.yaml | 16 |
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. |
