aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/roles/mariadb/tasks/recover_cluster.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/ansible/roles/mariadb/tasks/recover_cluster.yml b/ansible/roles/mariadb/tasks/recover_cluster.yml
index 16f0d05fc..0592cb390 100644
--- a/ansible/roles/mariadb/tasks/recover_cluster.yml
+++ b/ansible/roles/mariadb/tasks/recover_cluster.yml
@@ -215,6 +215,30 @@
- bootstrap_host is defined
- bootstrap_host != inventory_hostname
+# The master restart below is a Galera cluster membership change. If it
+# happens while a slave is still receiving its IST, the joiner aborts with
+# "IST didn't contain all write sets ... node restart required" and stays
+# permanently disconnected, so wait for every slave to finish syncing first.
+- name: Wait for slave MariaDB to sync WSREP
+ become: true
+ kolla_toolbox:
+ container_engine: "{{ kolla_container_engine }}"
+ module_name: mysql_query
+ module_args:
+ login_db: "mysql"
+ login_host: "{{ api_interface_address }}"
+ login_port: "{{ mariadb_port }}"
+ login_user: "{{ database_user }}"
+ login_password: "{{ database_password }}"
+ query: 'SHOW STATUS LIKE "wsrep_local_state_comment"'
+ register: result
+ until: result.query_result is defined and result.query_result[0][0]['Value'] == "Synced"
+ retries: 30
+ delay: 10
+ when:
+ - bootstrap_host is defined
+ - bootstrap_host != inventory_hostname
+
- name: Unset pc.bootstrap for primary MariaDB galera.cnf for next restart
vars:
service_name: "mariadb"