From 0e89e90f427fda9bc53cd17edc9a623b893a2a08 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Tue, 22 Jan 2019 13:28:03 +0100 Subject: [PATCH] MDEV-17835: Remove wsrep-sst-method=xtrabackup The second line of changes related to replacing xtrabackup with mariabackup: 1) All unnecessary references to xtrabackup are removed from the documentation, from some comments, from the control files that are used to prepare the packages. 2) Made corrections of the tests from the galera_3nodes suite that mentioned xtrabackup or the old (associated with xtrabackup) version of innobackupex. 3) Fixed flaws in the galera_3nodes mtr suite control scripts, because of which they could not work with mariabackup. 4) Fixed numerous bugs in the SST scripts and in the mtr test files (galera_3nodes mtr suite) that prevented the use of Galera with IPv6 addresses. 5) Fixed flaws in tests for rsync and mysqldump (for galera_3nodes mtr tests suite). These tests were not performed successfully without these fixes. https://jira.mariadb.org/browse/MDEV-17835 --- debian/mariadb-server-10.3.install | 3 +- man/CMakeLists.txt | 1 - man/wsrep_sst_xtrabackup-v2.1 | 18 -------- man/wsrep_sst_xtrabackup.1 | 18 -------- mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera_3nodes/disabled.def | 2 - .../suite/galera_3nodes/galera_2x3nodes.cnf | 12 ++--- .../suite/galera_3nodes/galera_3nodes.cnf | 6 +-- .../include/have_mariabackup.inc | 4 ++ .../r/galera_innobackupex_backup.result | 6 +++ ....result => galera_ipv6_mariabackup.result} | 4 ++ .../r/galera_ipv6_mysqldump.result | 21 ++++++--- .../galera_3nodes/r/galera_ipv6_rsync.result | 3 ++ mysql-test/suite/galera_3nodes/suite.pm | 44 ++++++++++++++++--- .../t/galera_innobackupex_backup.cnf | 4 ++ .../t/galera_innobackupex_backup.test | 28 ++++++++++-- ...kup-v2.cnf => galera_ipv6_mariabackup.cnf} | 5 ++- .../t/galera_ipv6_mariabackup.opt | 1 + ...p-v2.test => galera_ipv6_mariabackup.test} | 5 +-- .../galera_3nodes/t/galera_ipv6_mysqldump.cnf | 10 +++-- .../galera_3nodes/t/galera_ipv6_mysqldump.opt | 1 + .../t/galera_ipv6_mysqldump.test | 41 ++++++++++++++--- .../galera_3nodes/t/galera_ipv6_rsync.cnf | 10 +++-- .../galera_3nodes/t/galera_ipv6_rsync.opt | 1 + mysql-test/suite/wsrep/r/variables.result | 3 -- mysql-test/suite/wsrep/t/variables.test | 6 +-- scripts/wsrep_sst_common.sh | 6 ++- scripts/wsrep_sst_mariabackup.sh | 28 +++++++++--- scripts/wsrep_sst_rsync.sh | 17 ++++--- sql/mysqld.cc | 3 +- sql/sys_vars.cc | 3 +- sql/wsrep_mysqld.cc | 2 +- sql/wsrep_sst.cc | 5 --- sql/wsrep_utils.h | 3 +- storage/innobase/handler/ha_innodb.cc | 9 ---- support-files/policy/apparmor/usr.sbin.mysqld | 3 +- .../policy/selinux/mariadb-server.fc | 2 +- .../policy/selinux/mariadb-server.te | 4 +- 38 files changed, 216 insertions(+), 127 deletions(-) delete mode 100644 man/wsrep_sst_xtrabackup-v2.1 delete mode 100644 man/wsrep_sst_xtrabackup.1 create mode 100644 mysql-test/suite/galera_3nodes/include/have_mariabackup.inc rename mysql-test/suite/galera_3nodes/r/{galera_ipv6_xtrabackup-v2.result => galera_ipv6_mariabackup.result} (91%) create mode 100644 mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf rename mysql-test/suite/galera_3nodes/t/{galera_ipv6_xtrabackup-v2.cnf => galera_ipv6_mariabackup.cnf} (91%) create mode 100644 mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt rename mysql-test/suite/galera_3nodes/t/{galera_ipv6_xtrabackup-v2.test => galera_ipv6_mariabackup.test} (98%) create mode 100644 mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt create mode 100644 mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt diff --git a/debian/mariadb-server-10.3.install b/debian/mariadb-server-10.3.install index e3b9ac05c9c..9447446a6b5 100644 --- a/debian/mariadb-server-10.3.install +++ b/debian/mariadb-server-10.3.install @@ -88,8 +88,7 @@ usr/share/man/man1/resolveip.1 usr/share/man/man1/wsrep_sst_common.1 usr/share/man/man1/wsrep_sst_mysqldump.1 usr/share/man/man1/wsrep_sst_rsync.1 -usr/share/man/man1/wsrep_sst_xtrabackup-v2.1 -usr/share/man/man1/wsrep_sst_xtrabackup.1 +usr/share/man/man1/wsrep_sst_mariabackup.1 usr/share/mysql/errmsg-utf8.txt usr/share/mysql/fill_help_tables.sql usr/share/mysql/maria_add_gis_sp_bootstrap.sql diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 9c34ede59c7..1ac4931fdf1 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -25,7 +25,6 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1 resolveip.1 mariadb-service-convert.1 mysqld_safe_helper.1 tokuftdump.1 wsrep_sst_common.1 wsrep_sst_mysqldump.1 wsrep_sst_rsync.1 - wsrep_sst_xtrabackup-v2.1 wsrep_sst_xtrabackup.1 galera_recovery.1 galera_new_cluster.1 tokuft_logprint.1 mysql_ldb.1 wsrep_sst_mariabackup.1 mbstream.1 mariabackup.1 diff --git a/man/wsrep_sst_xtrabackup-v2.1 b/man/wsrep_sst_xtrabackup-v2.1 deleted file mode 100644 index c8dde2f0640..00000000000 --- a/man/wsrep_sst_xtrabackup-v2.1 +++ /dev/null @@ -1,18 +0,0 @@ -'\" t -.\" -.TH "\FBWSREP_SST_XTRABACKUP-V2\FR" "1" "9 May 2017" "MariaDB 10\&.3" "MariaDB Database System" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH NAME -wsrep_sst_xtrabackup-v2 \- xtrabackup\-based state snapshot transfer -.SH DESCRIPTION -Use: xtrabackup-based state snapshot transfer\. -.PP -Note that the xtrabackup-v2 method is deprecated after version 10\.1, with newer versions you should use mariabackup instead\. -.PP -For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ diff --git a/man/wsrep_sst_xtrabackup.1 b/man/wsrep_sst_xtrabackup.1 deleted file mode 100644 index 1fe5037d8b7..00000000000 --- a/man/wsrep_sst_xtrabackup.1 +++ /dev/null @@ -1,18 +0,0 @@ -'\" t -.\" -.TH "\FBWSREP_SST_XTRABACKUP\FR" "1" "9 May 2017" "MariaDB 10\&.3" "MariaDB Database System" -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.SH NAME -wsrep_sst_xtrabackup \- xtrabackup\-based state snapshot transfer -.SH DESCRIPTION -Use: xtrabackup-based state snapshot transfer\. -.PP -Note that the xtrabackup method is deprecated after version 10\.1, with newer versions you should use mariabackup instead\. -.PP -For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index d1d054b87ad..03ddda7aa76 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -34,7 +34,6 @@ galera_kill_applier : race condition at the start of the test galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status pxc-421: Lock timeout exceeded galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure -galera_sst_xtrabackup-v2-options : Failed to read uuid:seqno and wsrep_gtid_domain_id from joiner script galera_gcs_fc_limit : Timeouts pool_of_threads: WSREP has not yet prepared node for application use galera_var_innodb_disallow_writes : Timeout diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index e640baebf7d..1683485981b 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -1,4 +1,2 @@ galera_slave_options_do :MDEV-8798 galera_slave_options_ignore : MDEV-8798 -galera_innobackupex_backup : xtrabackup is deprecated -galera_ipv6_xtrabackup-v2 : xtrabackup is deprecated diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf index 3f39b82f7b7..df51920c13c 100644 --- a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf @@ -22,7 +22,7 @@ wsrep_node_address=127.0.0.1 #ist_port=@OPT.port #sst_port=@OPT.port wsrep-cluster-address='gcomm://' -wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port @@ -33,7 +33,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port @@ -44,7 +44,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port @@ -58,7 +58,7 @@ wsrep_cluster_name=cluster2 #sst_port=@OPT.port wsrep-cluster-address='gcomm://' -wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port @@ -70,7 +70,7 @@ wsrep_cluster_name=cluster2 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port' -wsrep_provider_options='base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port @@ -82,7 +82,7 @@ wsrep_cluster_name=cluster2 #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port' -wsrep_provider_options='base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S' wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf index 91aa53ad7b1..7b68d36c04a 100644 --- a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf +++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf @@ -18,7 +18,7 @@ wsrep-sync-wait=15 #ist_port=@OPT.port #sst_port=@OPT.port wsrep-cluster-address='gcomm://' -wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port @@ -29,7 +29,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port @@ -40,7 +40,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' #ist_port=@OPT.port #sst_port=@OPT.port wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' +wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S' wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port diff --git a/mysql-test/suite/galera_3nodes/include/have_mariabackup.inc b/mysql-test/suite/galera_3nodes/include/have_mariabackup.inc new file mode 100644 index 00000000000..0dd693f2c63 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/include/have_mariabackup.inc @@ -0,0 +1,4 @@ +# +# suite.pm will make sure that all tests including this file +# will be skipped as needed +# diff --git a/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result index 85000db8e77..6ed7587303d 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result +++ b/mysql-test/suite/galera_3nodes/r/galera_innobackupex_backup.result @@ -1,9 +1,15 @@ +connection node_1; +connection node_2; +connection node_3; +connection node_1; CREATE TABLE t1 (f1 INTEGER); INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +connection node_2; SELECT COUNT(*) = 10 FROM t1; COUNT(*) = 10 1 Killing server ... +connection node_1; INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); SELECT COUNT(*) = 20 FROM t1; COUNT(*) = 20 diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result similarity index 91% rename from mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result rename to mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result index 53e35939a79..5665ed5f46a 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_xtrabackup-v2.result +++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mariabackup.result @@ -4,14 +4,18 @@ VARIABLE_VALUE LIKE '%[::1]%' SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 3 1 +connection node_2; SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); +connection node_2; SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 DROP TABLE t1; +connection node_1; include/assert_grep.inc [Streaming the backup to joiner at \[::1\]] include/assert_grep.inc [async IST sender starting to serve tcp://\[::1\]:] include/assert_grep.inc [IST receiver addr using tcp://\[::1\]] diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result index f519654952b..3564dc8c5a1 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result +++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_mysqldump.result @@ -1,11 +1,21 @@ +call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to'"); +call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); +connection node_1; +connection node_2; +connection node_3; +connection node_1; +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; SET GLOBAL wsrep_sst_auth = 'sst:'; +connection node_2; SET GLOBAL wsrep_sst_method = 'mysqldump'; -Unloading wsrep provider ... -SET GLOBAL wsrep_provider = 'none'; +Shutting down server ... +connection node_1; +Cleaning var directory ... CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); -Loading wsrep provider ... +connection node_2; +Starting server ... SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 @@ -13,14 +23,15 @@ DROP TABLE t1; SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses'; VARIABLE_VALUE LIKE '%[::1]%' 1 +connection node_1; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); DROP USER sst; +connection node_2; CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); -CALL mtr.add_suppression("InnoDB: New log files created"); -CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables"); CALL mtr.add_suppression("Can't open and lock time zone table"); CALL mtr.add_suppression("Can't open and lock privilege tables"); CALL mtr.add_suppression("Info table is not ready to be used"); CALL mtr.add_suppression("Native table .* has the wrong structure"); +connection node_2; CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort"); diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result index a2bf5f4d98c..bcf74142144 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result +++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync.result @@ -4,9 +4,12 @@ VARIABLE_VALUE LIKE '%[::1]%' SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 3 1 +connection node_2; SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); +connection node_2; SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 diff --git a/mysql-test/suite/galera_3nodes/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm index 3a1237ecf75..0c098bfc9f9 100644 --- a/mysql-test/suite/galera_3nodes/suite.pm +++ b/mysql-test/suite/galera_3nodes/suite.pm @@ -21,14 +21,21 @@ $ENV{WSREP_PROVIDER} = $provider; my ($spath) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir; return "No SST scripts" unless $spath; +my ($cpath) = grep { -f "$_/mysql"; } "$::bindir/scripts", $::path_client_bindir; +return "No scritps" unless $cpath; + my ($epath) = grep { -f "$_/my_print_defaults"; } "$::bindir/extra", $::path_client_bindir; return "No my_print_defaults" unless $epath; +my ($bpath) = grep { -f "$_/mariabackup"; } "$::bindir/extra/mariabackup", $::path_client_bindir; + +sub which($) { return `sh -c "command -v $_[0]"` } + push @::global_suppressions, ( qr(WSREP: wsrep_sst_receive_address is set to '127.0.0.1), - qr(WSREP: Could not open saved state file for reading: ), - qr(WSREP: Could not open state file for reading: ), + qr(WSREP: Could not open saved state file for reading: .*), + qr(WSREP: Could not open state file for reading: .*), qr(WSREP: Gap in state sequence. Need state transfer.), qr(WSREP: Failed to prepare for incremental state transfer:), qr(WSREP:.*down context.*), @@ -42,16 +49,43 @@ push @::global_suppressions, qr|WSREP: discarding established \(time wait\) .*|, qr(WSREP: There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside. Will use that one.), qr(WSREP: evs::proto.*), - qr|WSREP: Ignoring possible split-brain (allowed by configuration) from view:.*|, + qr|WSREP: Ignoring possible split-brain \(allowed by configuration\) from view:.*|, qr(WSREP: Member .* requested state transfer from .* but it is impossible to select State Transfer donor: Resource temporarily unavailable), + qr(WSREP: .* sending install message failed: Transport endpoint is not connected), + qr(WSREP: .* sending install message failed: Resource temporarily unavailable), qr(WSREP: Could not find peer:), - qr(WSREP: Protocol violation. JOIN message sender .*), - qr(WSREP: JOIN message from member [0-9]* in non-primary configuration. Ignored.), + qr|WSREP: gcs_caused\(\) returned .*|, + qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(SYNCED\). Message ignored.|, + qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|, + qr(WSREP: Action message in non-primary configuration from member [0-9]*), + qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on), + qr(WSREP: JOIN message from member .* in non-primary configuration. Ignored.), ); $ENV{PATH}="$epath:$ENV{PATH}"; $ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath; +$ENV{PATH}="$cpath:$ENV{PATH}" unless $cpath eq $spath; +$ENV{PATH}="$bpath:$ENV{PATH}" unless $bpath eq $spath; + +if (which(socat)) { + $ENV{MTR_GALERA_TFMT}='socat'; +} elsif (which(nc)) { + $ENV{MTR_GALERA_TFMT}='nc'; +} + +sub skip_combinations { + my %skip = (); + $skip{'include/have_filekeymanagement.inc'} = 'needs file_key_management plugin' + unless $ENV{FILE_KEY_MANAGEMENT_SO}; + $skip{'include/have_mariabackup.inc'} = 'Need mariabackup' + unless which(mariabackup); + $skip{'include/have_mariabackup.inc'} = 'Need ss' + unless which(ss); + $skip{'include/have_mariabackup.inc'} = 'Need socat or nc' + unless $ENV{MTR_GALERA_TFMT}; + %skip; +} bless { }; diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf new file mode 100644 index 00000000000..35ecb8b5937 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.cnf @@ -0,0 +1,4 @@ +!include ../galera_3nodes.cnf + +[mysqld] +wsrep-causal-reads=OFF diff --git a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test index cc3f42c7290..8dfb4660f3e 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test +++ b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test @@ -4,6 +4,17 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_mariabackup.inc + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source ../galera/include/auto_increment_offset_save.inc --connection node_1 CREATE TABLE t1 (f1 INTEGER); @@ -13,8 +24,8 @@ INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); SELECT COUNT(*) = 10 FROM t1; --exec rm -rf $MYSQL_TMP_DIR/innobackupex_backup ---exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 $MYSQL_TMP_DIR/innobackupex_backup --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-backup.log ---exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 $MYSQL_TMP_DIR/innobackupex_backup --apply-log --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-apply.log +--exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-backup.log +--exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --apply-log --galera-info --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-apply.log --source ../galera/include/kill_galera.inc --sleep 1 @@ -23,7 +34,7 @@ SELECT COUNT(*) = 10 FROM t1; INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19),(20); --exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/* ---exec innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --copy-back $MYSQL_TMP_DIR/innobackupex_backup --port=$NODE_MYPORT_2 --host=127.0.0.1 > $MYSQL_TMP_DIR/innobackupex-restore.log +--exec mariabackup --innobackupex --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --copy-back --port=$NODE_MYPORT_2 --host=127.0.0.1 $MYSQL_TMP_DIR/innobackupex_backup &> $MYSQL_TMP_DIR/innobackupex-restore.log # # Convert the xtrabackup_galera_info into a grastate.dat file @@ -51,8 +62,19 @@ EOF --sleep 5 --source include/wait_until_connected_again.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + SELECT COUNT(*) = 20 FROM t1; DROP TABLE t1; --sleep 10 + +--let $galera_connection_name = node_2a +--let $galera_server_number = 2 +--source include/galera_connect.inc +--let $node_2=node_2a + +# Restore original auto_increment_offset values. +--source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf similarity index 91% rename from mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf rename to mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf index 8a80be0d2a9..5ac00fa056b 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.cnf @@ -1,8 +1,9 @@ !include ../galera_3nodes.cnf [mysqld] -wsrep_sst_method=xtrabackup-v2 +wsrep_sst_method=mariabackup wsrep_sst_auth="root:" +wsrep_node_address=::1 [mysqld.1] wsrep-cluster-address=gcomm:// @@ -23,4 +24,6 @@ wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.3.port' [SST] +transferfmt=@ENV.MTR_GALERA_TFMT +streamfmt=xbstream sockopt=",pf=ip6" diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt new file mode 100644 index 00000000000..c2bb4d156af --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.opt @@ -0,0 +1 @@ +--bind-address=:: diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test similarity index 98% rename from mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test rename to mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test index 84eee017700..fdf70989d5d 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_xtrabackup-v2.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mariabackup.test @@ -1,5 +1,6 @@ --source include/galera_cluster.inc --source include/have_ipv6.inc +--source include/have_mariabackup.inc # Confirm that initial handshake happened over ipv6 @@ -56,7 +57,3 @@ DROP TABLE t1; --let $assert_text = Prepared IST receiver, listening at: tcp://\[::1\] --let $assert_select = Prepared IST receiver, listening at: tcp://\[::1\] --source include/assert_grep.inc - - - - diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf index 3728e1ce005..80dd0c41cc3 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.cnf @@ -2,21 +2,25 @@ [mysqld] wsrep_sst_method=rsync +wsrep_node_address=::1 [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.1.port' [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.2.port' [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.3.port' + +[SST] +sockopt=",pf=ip6" diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt new file mode 100644 index 00000000000..c2bb4d156af --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.opt @@ -0,0 +1 @@ +--bind-address=:: diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test index 5b06e617eef..e0addcea7bc 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_mysqldump.test @@ -1,7 +1,21 @@ --source include/galera_cluster.inc --source include/have_ipv6.inc +call mtr.add_suppression("WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to'"); +call mtr.add_suppression("Failed to load slave replication state from table mysql.gtid_slave_pos"); + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--source ../galera/include/auto_increment_offset_save.inc + --connection node_1 +CREATE USER 'sst'; GRANT ALL PRIVILEGES ON *.* TO 'sst'; --let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth` @@ -17,25 +31,37 @@ SET GLOBAL wsrep_sst_auth = 'sst:'; --enable_query_log SET GLOBAL wsrep_sst_method = 'mysqldump'; - # # Force mysqldump SST # ---connection node_2 ---source suite/galera/include/galera_unload_provider.inc ---remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +#--connection node_2 +#--source suite/galera/include/galera_unload_provider.inc + +--echo Shutting down server ... +--source include/shutdown_mysqld.inc --connection node_1 --let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc +--echo Cleaning var directory ... +--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql +--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data + CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); - --connection node_2 ---source suite/galera/include/galera_load_provider.inc +--echo Starting server ... +--let $start_mysqld_params = --wsrep_sst_auth=sst: --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=[::1].1:$NODE_MYPORT_2 +--source include/start_mysqld.inc + +#--source suite/galera/include/galera_load_provider.inc --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' --source include/wait_condition.inc @@ -54,3 +80,6 @@ SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE --source suite/galera/include/galera_sst_restore.inc --connection node_2 CALL mtr.add_suppression("Unsupported protocol downgrade: incremental data collection disabled. Expect abort"); + +# Restore original auto_increment_offset values. +--source ../galera/include/auto_increment_offset_restore.inc diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf index 3728e1ce005..80dd0c41cc3 100644 --- a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.cnf @@ -2,21 +2,25 @@ [mysqld] wsrep_sst_method=rsync +wsrep_node_address=::1 [mysqld.1] wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' +wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port' wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.1.port' [mysqld.2] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' +wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port' wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.2.port' [mysqld.3] wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' +wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port' wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port' wsrep_node_incoming_address='[::1]:@mysqld.3.port' + +[SST] +sockopt=",pf=ip6" diff --git a/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt new file mode 100644 index 00000000000..c2bb4d156af --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_ipv6_rsync.opt @@ -0,0 +1 @@ +--bind-address=:: diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index cb371b33bfd..388fe7b8f4f 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -139,9 +139,6 @@ wsrep_local_state_comment # SHOW STATUS LIKE 'x'; Variable_name Value SET GLOBAL wsrep_provider=none; -# -# MDEV#6079: xtrabackup SST failing with maria-10.0-galera -# SHOW STATUS LIKE 'wsrep_local_state_uuid'; Variable_name Value diff --git a/mysql-test/suite/wsrep/t/variables.test b/mysql-test/suite/wsrep/t/variables.test index f74b26167b2..c13a8c5f281 100644 --- a/mysql-test/suite/wsrep/t/variables.test +++ b/mysql-test/suite/wsrep/t/variables.test @@ -49,15 +49,11 @@ SHOW STATUS LIKE 'x'; # Reset it back. SET GLOBAL wsrep_provider=none; ---echo # ---echo # MDEV#6079: xtrabackup SST failing with maria-10.0-galera ---echo # - --disable_query_log eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; --enable_query_log -# The following 2 variables are used in innobackupex during xtrabackup-based +# The following 2 variables are used by mariabackup # SST. --echo --replace_column 2 # diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 5683b166163..3e82d379a6d 100755 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh @@ -44,13 +44,15 @@ case "$1" in addr_no_bracket=${WSREP_SST_OPT_ADDR#\[} readonly WSREP_SST_OPT_HOST_UNESCAPED=${addr_no_bracket%%\]*} readonly WSREP_SST_OPT_HOST="[${WSREP_SST_OPT_HOST_UNESCAPED}]" + readonly WSREP_SST_OPT_HOST_ESCAPED="\\[${WSREP_SST_OPT_HOST_UNESCAPED}\\]" ;; *) readonly WSREP_SST_OPT_HOST=${WSREP_SST_OPT_ADDR%%[:/]*} readonly WSREP_SST_OPT_HOST_UNESCAPED=$WSREP_SST_OPT_HOST + readonly WSREP_SST_OPT_HOST_ESCAPED=$WSREP_SST_OPT_HOST ;; esac - remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST}} + remain=${WSREP_SST_OPT_ADDR#${WSREP_SST_OPT_HOST_ESCAPED}} remain=${remain#:} readonly WSREP_SST_OPT_ADDR_PORT=${remain%%/*} remain=${remain#*/} @@ -274,7 +276,7 @@ wsrep_check_programs() } # -# user can specify xtrabackup specific settings that will be used during sst +# user can specify mariabackup specific settings that will be used during sst # process like encryption, etc..... # parse such configuration option. (group for xb settings is [sst] in my.cnf # diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index bc875a0dc03..fd4248fb6e0 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -509,12 +509,24 @@ kill_xtrabackup() setup_ports() { if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then - SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') - REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') - lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') - sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }') + if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then + remain=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\][:/]' '{ print $2 }') + REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F '\\]:' '{ print $1 }')"]" + SST_PORT=$(echo $remain | awk -F '[:/]' '{ print $1 }') + lsn=$(echo $remain | awk -F '[:/]' '{ print $3 }') + sst_ver=$(echo $remain | awk -F '[:/]' '{ print $4 }') + else + SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') + REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') + lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') + sst_ver=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $5 }') + fi else - SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') + if [[ ${WSREP_SST_OPT_ADDR:0:1} == '[' ]];then + SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $2 }') + else + SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') + fi fi } @@ -892,7 +904,11 @@ then if [ -z "${SST_PORT}" ] then SST_PORT=4444 - ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" + if [[ ${ADDR:0:1} == '[' ]];then + ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F '\\]:' '{ print $1 }')]:${SST_PORT}" + else + ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" + fi fi wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} & diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 80a881ca5dc..a425d335868 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -1,4 +1,4 @@ -#!/bin/sh -ue +#!/bin/bash -ue # Copyright (C) 2010-2014 Codership Oy # @@ -88,7 +88,7 @@ check_pid_and_port() local is_listening_all="$(echo $port_info | \ grep "*:$rsync_port" 2>/dev/null)" local is_listening_addr="$(echo $port_info | \ - grep "$rsync_addr:$rsync_port" 2>/dev/null)" + grep -F "$rsync_addr:$rsync_port" 2>/dev/null)" if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then if [ -z "$is_rsync" ]; then @@ -119,7 +119,7 @@ is_local_ip() address="$address " fi - $get_addr_bin | grep "$address" > /dev/null + $get_addr_bin | grep -F "$address" > /dev/null } STUNNEL_CONF="$WSREP_SST_OPT_DATA/stunnel.conf" @@ -398,12 +398,17 @@ then rm -rf "$RSYNC_PID" ADDR=$WSREP_SST_OPT_ADDR - RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }') - RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }') + if [[ ${ADDR:0:1} == '[' ]]; then + RSYNC_PORT=$(echo $ADDR | awk -F '\\]:' '{ print $2 }') + RSYNC_ADDR=$(echo $ADDR | awk -F '\\]:' '{ print $1 }')"]" + else + RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }') + RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }') + fi if [ -z "$RSYNC_PORT" ] then RSYNC_PORT=4444 - ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT" + ADDR="$RSYNC_ADDR:$RSYNC_PORT" fi trap "exit 32" HUP PIPE diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6f0f517eade..981b76ec210 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5532,7 +5532,8 @@ static int init_server_components() initialized. This initialization was not possible before, as plugins (and thus some global system variables) are initialized after wsrep startup threads are created. - Note: This only needs to be done for rsync, xtrabackup based SST methods. + Note: This only needs to be done for rsync and mariabackup based SST + methods. */ if (wsrep_before_SE()) wsrep_plugins_post_init(); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 369c9a6222a..7be30c97d2f 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -5352,8 +5352,7 @@ static Sys_var_charptr sys_wsrep_sst_method( "wsrep_sst_method", "State snapshot transfer method", GLOBAL_VAR(wsrep_sst_method),CMD_LINE(REQUIRED_ARG), IN_SYSTEM_CHARSET, DEFAULT(WSREP_SST_DEFAULT), NO_MUTEX_GUARD, NOT_IN_BINLOG, - ON_CHECK(wsrep_sst_method_check), - ON_UPDATE(wsrep_sst_method_update)); + ON_CHECK(wsrep_sst_method_check)); static Sys_var_charptr Sys_wsrep_sst_receive_address( "wsrep_sst_receive_address", "Address where node is waiting for " diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index e60fa94ba2a..e0bb24266a4 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -825,7 +825,7 @@ void wsrep_init_startup (bool first) Pre-initialize global_system_variables.table_plugin with a dummy engine (placeholder) required during the initialization of wsrep threads (THDs). (see: plugin_thdvar_init()) - Note: This only needs to be done for rsync & xtrabackup based SST methods. + Note: This only needs to be done for rsync & mariabackup based SST methods. In case of mysqldump SST method, the wsrep threads are created after the server plugins & global system variables are initialized. */ diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 7a542ab88f1..902d78a2f33 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -60,11 +60,6 @@ bool wsrep_sst_method_check (sys_var *self, THD* thd, set_var* var) return 0; } -bool wsrep_sst_method_update (sys_var *self, THD* thd, enum_var_type type) -{ - return 0; -} - static const char* data_home_dir = NULL; void wsrep_set_data_home_dir(const char *data_dir) diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h index 277cea9dc31..0afca96ea41 100644 --- a/sql/wsrep_utils.h +++ b/sql/wsrep_utils.h @@ -108,7 +108,8 @@ private: /* Hostname with port (host:port) */ start= addr_in; end= colon; - parse_port(colon + 1); + if (parse_port(colon + 1)) + return; /* Error: invalid port */ break; default: /* IPv6 address */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d90088f2c5e..531d12491a4 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3732,15 +3732,6 @@ static int innodb_init_params() ib::info() << "For Galera, using innodb_lock_schedule_algorithm=fcfs"; innodb_lock_schedule_algorithm = INNODB_LOCK_SCHEDULE_ALGORITHM_FCFS; } - - /* Print deprecation info if xtrabackup is used for SST method */ - if (global_system_variables.wsrep_on - && wsrep_sst_method - && (!strcmp(wsrep_sst_method, "xtrabackup") - || !strcmp(wsrep_sst_method, "xtrabackup-v2"))) { - ib::info() << "Galera SST method xtrabackup is deprecated and the " - " support for it may be removed in future releases."; - } #endif /* WITH_WSREP */ #ifndef HAVE_LZ4 diff --git a/support-files/policy/apparmor/usr.sbin.mysqld b/support-files/policy/apparmor/usr.sbin.mysqld index 05ec77414d2..6555c614889 100644 --- a/support-files/policy/apparmor/usr.sbin.mysqld +++ b/support-files/policy/apparmor/usr.sbin.mysqld @@ -101,13 +101,12 @@ /usr/bin/cut rix, /usr/bin/dirname rix, /usr/bin/gawk rix, - /usr/bin/innobackupex rix, /usr/bin/mysql rix, /usr/bin/perl rix, /usr/bin/seq rix, /usr/bin/wsrep_sst* rix, /usr/bin/wsrep_sst_common r, - /usr/bin/xtrabackup* rix, + /usr/bin/mariabackup* rix, /var/lib/mysql/ r, /var/lib/mysql/** rw, /var/lib/mysql/*.log w, diff --git a/support-files/policy/selinux/mariadb-server.fc b/support-files/policy/selinux/mariadb-server.fc index 409f72923aa..e3f2b5015c7 100644 --- a/support-files/policy/selinux/mariadb-server.fc +++ b/support-files/policy/selinux/mariadb-server.fc @@ -6,5 +6,5 @@ /var/lib/mysql/.*\.err -- gen_context(system_u:object_r:mysqld_log_t,s0) /var/lib/mysql/.*\.pid -- gen_context(system_u:object_r:mysqld_var_run_t,s0) /var/lib/mysql/.*\.cnf -- gen_context(system_u:object_r:mysqld_etc_t,s0) -/usr/bin/xtrabackup.* -- gen_context(system_u:object_r:mysqld_exec_t,s0) +/usr/bin/mariabackup.* -- gen_context(system_u:object_r:mysqld_exec_t,s0) /usr/bin/wsrep.* -- gen_context(system_u:object_r:mysqld_safe_exec_t,s0) diff --git a/support-files/policy/selinux/mariadb-server.te b/support-files/policy/selinux/mariadb-server.te index 45ef40f4153..71924012283 100644 --- a/support-files/policy/selinux/mariadb-server.te +++ b/support-files/policy/selinux/mariadb-server.te @@ -78,7 +78,7 @@ allow mysqld_t user_tmp_t:file create; allow mysqld_t bin_t:lnk_file read; allow mysqld_t tmp_t:file { append create read write open getattr unlink setattr }; -# Allows too much leeway - the xtrabackup/wsrep rules in fc should fix it, but +# Allows too much leeway - the mariabackup/wsrep rules in fc should fix it, but # keep for the moment. allow mysqld_t shell_exec_t:file { execute_no_trans getattr read execute open }; allow mysqld_t bin_t:file { getattr read execute open execute_no_trans ioctl }; @@ -93,7 +93,7 @@ allow mysqld_t tram_port_t:tcp_socket name_bind; # This rule allows port udp/4567 (see README) allow mysqld_t mysqld_port_t:udp_socket name_bind; -# Rules related to XtraBackup +# Rules related to mariabackup allow mysqld_t self:netlink_tcpdiag_socket { create nlmsg_read }; allow mysqld_t sysctl_net_t:file { read getattr open };