From 36f35bee263f1d87440a4204d018dda45d19d98e Mon Sep 17 00:00:00 2001 From: Marc Gariepy Date: Thu, 11 Jun 2020 13:37:36 -0400 Subject: [PATCH] Use more reliable option to get cluster ready state and remove ansible_python_interpreter This is a merge of two previous patches [1,2] which require each other in order to merge in particular due to unpredictable behaviour of MariaDB 10.4 during cluster status reporting which is addressed through [2]. [1] https://review.opendev.org/735204 [2] https://review.opendev.org/735079 Co-Authored-By: Dmitriy Rabotyagov Co-Authored-By: Marc Gariepy Change-Id: Id04fa994f527e2a15a87ba91d56d10eaadf8f58f --- tests/host_vars/localhost.yml | 2 -- tests/test-galera-server-functional.yml | 43 ++++++++++++++++++------- zuul.d/project.yaml | 4 +++ 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/tests/host_vars/localhost.yml b/tests/host_vars/localhost.yml index 65ddeaa0..6c26f31a 100644 --- a/tests/host_vars/localhost.yml +++ b/tests/host_vars/localhost.yml @@ -15,5 +15,3 @@ bridges: - "br-mgmt" - -ansible_python_interpreter: "/usr/bin/python2" diff --git a/tests/test-galera-server-functional.yml b/tests/test-galera-server-functional.yml index a4861e2e..cec9344a 100644 --- a/tests/test-galera-server-functional.yml +++ b/tests/test-galera-server-functional.yml @@ -18,18 +18,37 @@ user: root gather_facts: true tasks: - - name: Wait for cluster ready state - command: | - mysql -h {{ ansible_host }} \ - -p"{{ galera_root_password }}" \ - -e "show status like 'wsrep_incoming_addresses';" \ - --silent \ - --skip-column-names - register: mysql_instance_ready - retries: 20 - delay: 5 - changed_when: false - until: mysql_instance_ready is success + - name: Wait for cluster to be ready + block: + - name: Wait for cluster ready state + command: | + mysql -h {{ ansible_host }} \ + -p"{{ galera_root_password }}" \ + -e "show status like 'wsrep_incoming_addresses';" \ + --silent \ + --skip-column-names + register: mysql_instance_ready + retries: 20 + delay: 5 + changed_when: false + until: mysql_instance_ready is success and mysql_instance_ready.stdout.split()[-1].split(',') | length == groups['galera_all'] | length + rescue: + - name: Restarting weird maria instance + service: + name: mariadb + state: restarted + - name: Wait for cluster ready state + command: | + mysql -h {{ ansible_host }} \ + -p"{{ galera_root_password }}" \ + -e "show status like 'wsrep_incoming_addresses';" \ + --silent \ + --skip-column-names + register: mysql_instance_ready + retries: 20 + delay: 5 + changed_when: false + until: mysql_instance_ready is success and mysql_instance_ready.stdout.split()[-1].split(',') | length == groups['galera_all'] | length - name: Check cluster incoming addresses command: | mysql -h {{ ansible_host }} \ diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 1618fd57..cad83548 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -27,6 +27,8 @@ - openstack-ansible-functional-opensuse-15-ssl: voting: false - openstack-ansible-functional-ubuntu-bionic-ssl + - openstack-ansible-upgrade-aio_metal-ubuntu-bionic: + voting: false experimental: jobs: - openstack-ansible-integrated-deploy-aio @@ -34,3 +36,5 @@ jobs: - openstack-ansible-functional-centos-7-ssl - openstack-ansible-functional-ubuntu-bionic-ssl + - openstack-ansible-upgrade-aio_metal-ubuntu-bionic: + voting: false