From 546c402b5cab0fce45eaaec8f3661ef178abb83d Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 28 Nov 2017 14:51:30 +0000 Subject: [PATCH] SUSE: Apply workaround for mariadb-10.2 The openSUSE repository bumped the mariadb package to 10.2. However, there is an upstream bug that prevents nodes from joining the cluster. The way to workaround it is to export WSREP_SST_OPT_PORT=4444 in the systemd service file. Moreover, we pull the mariadb-galera subpackage which contains some necessary tools for galera clusters. Finally, we drop the default configuration files which are being installed by the packages because they conflict with the ones installed by this role. [hwoarang: This also applies the linter fixes from https://review.openstack.org/#/c/523080/ in order to make the gates happy] Depends-On: Ia4856f36b2d106d987e3c774f31493e25a23d4b5 Link: https://jira.mariadb.org/browse/MDEV-14256 Change-Id: I97cf1585b2fed08f53f62a547547e422bc34fa53 --- tasks/galera_post_install.yml | 10 ++++++++++ templates/systemd.environment.conf.j2 | 5 +++++ tests/test-galera-server-functional.yml | 3 +++ vars/main.yml | 2 ++ vars/suse-42.yml | 7 ++++++- 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 templates/systemd.environment.conf.j2 diff --git a/tasks/galera_post_install.yml b/tasks/galera_post_install.yml index f24e9ec6..d86a0f03 100644 --- a/tasks/galera_post_install.yml +++ b/tasks/galera_post_install.yml @@ -55,6 +55,15 @@ mode: "02755" when: log_dir.rc == 1 +# NOTE: (hwoarang) mariadb packages may drop some default configuration files +# in {{ galera_etc_include_dir }} so make sure they are gone if necessary in +# case they cause some conflicts with the ones we provide. +- name: Remove existing mariadb configuration files + file: + state: absent + path: "{{ galera_etc_include_dir }}/{{ item }}" + with_items: "{{ mariadb_delete_etc_conf_files }}" + - name: Drop mariadb config(s) config_template: src: "{{ item.src }}" @@ -127,6 +136,7 @@ dest: "/etc/systemd/system/{{ galera_mariadb_service_name }}.service.d/{{ item.dest }}" mode: "0644" with_items: + - { src: "systemd.environment.conf.j2", dest: "environment.conf" } - { src: "systemd.limits.conf.j2", dest: "limits.conf" } - { src: "systemd.timeout.conf.j2", dest: "timeout.conf" } - { src: "systemd.restart.conf.j2", dest: "restart.conf" } diff --git a/templates/systemd.environment.conf.j2 b/templates/systemd.environment.conf.j2 new file mode 100644 index 00000000..add39fad --- /dev/null +++ b/templates/systemd.environment.conf.j2 @@ -0,0 +1,5 @@ +# {{ ansible_managed }} + +[Service] +# https://jira.mariadb.org/browse/MDEV-14256 +Environment="WSREP_SST_OPT_PORT=4444" diff --git a/tests/test-galera-server-functional.yml b/tests/test-galera-server-functional.yml index a94f6149..8eea4660 100644 --- a/tests/test-galera-server-functional.yml +++ b/tests/test-galera-server-functional.yml @@ -26,6 +26,7 @@ --silent \ --skip-column-names register: wsrep_incoming_addresses + changed_when: false - name: Check cluster local state command: | mysql -h {{ ansible_host }} \ @@ -34,6 +35,7 @@ --silent \ --skip-column-names register: wsrep_local_state_comment + changed_when: false - name: Check cluster evs state command: | mysql -h {{ ansible_host }} \ @@ -42,6 +44,7 @@ --silent \ --skip-column-names register: wsrep_evs_state + changed_when: false - name: Check contents assert: that: diff --git a/vars/main.yml b/vars/main.yml index a122ae33..7a152ae2 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -31,3 +31,5 @@ percona_packages_list: - packages: "{{ [qpress_package_path] }}" enabled: "{{ not use_percona_upstream }}" local_pkg: yes + +mariadb_delete_etc_conf_files: [] diff --git a/vars/suse-42.yml b/vars/suse-42.yml index 9c35ce3e..eb62f15f 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -42,8 +42,8 @@ galera_mariadb_service_name: "mysql" galera_server_mariadb_distro_packages: - which - "{{ galera_mariadb_server_package }}" + - mariadb-galera - percona-toolkit - - xtrabackup - rsync - socat @@ -55,3 +55,8 @@ _use_percona_upstream: yes # sense for SUSE distributions and as such we provide an empty list here since # we grab everything from the distro repositories. percona_packages_list: [] + +mariadb_delete_etc_conf_files: + - default_plugins.cnf + - galera.cnf + - error_log.cnf