summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2022-02-22 10:45:06 +0100
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2022-02-22 10:45:06 +0100
commit17e0f5224c8339ec08707a6ad0397bbf8c19bbd3 (patch)
tree90159c2bb04d45edc14565be33bafedf5694a60e /mysql-test/suite/galera
parent571eb9d7759a198e57f1efd03e50e0b15c627631 (diff)
downloadmariadb-git-17e0f5224c8339ec08707a6ad0397bbf8c19bbd3.tar.gz
MDEV-27524: Incorrect binlogs after Galera SST using rsync and mariabackup
This commit adds correct handling of binlogs for SST using rsync or mariabackup. Before this fix, binlogs were handled incorrectly - - only one (last) binary log file was transferred during SST, which then led to various failures (for example, when trying to list all events from the binary log). These bugs were long masked by flaws in the primitive binlogs handling code in the SST scripts, which causing binary logs files to be erased after transfer or not added to the binlog index on the joiner node. Now the correct transfer of all binary logs (not just the last of the binary log files) has been implemented both for the rsync (at the script level) and for the mariabackup (at the level of the main utility code). This commit also adds a new sst_max_binlogs=<n> parameter, which can be located in the [sst] section or in the [xtrabackup] section (historically, supported for mariabackup only, not for rsync), or in one of the server sections. This parameter specifies the number of binary log files to be sent to the joiner node during SST. This option is added for compatibility with old SST scripting behavior, which can be emulated by setting the sst_max_binlogs=1 (although in general this can cause problems for the reasons described above). In addition, setting the sst_max_binlogs=0 can be used to suppress the transmission of binary logs to the joiner nodes during SST (although sometimes a single file with the current binary log can still be transmitted to the joiner, even with sst_max_binlogs=0, because this sometimes necessary in modes that involve the use of GTIDs with Galera). Also, this commit ensures correct handling of paths to various innodb files and directories in the SST scripts, and fixes some problems with this that existed in mariabackup utility (which were associated with incorrect handling of the innodb_data_dir parameter in some scenarios). In addition, this commit contains the following enhancements: 1) Added tests for mtr, which check the correct work with binlogs after SST (using rsync and mariabackup); 2) Added correct handling of slashes at the end of all paths that the SST script receives as parameters; 3) Improved parsing code for --mysqld-args parameters. Now it correctly processes the sequence "--" after the name of the one-letter option; 4) Checking the secret signature during joiner authentication is made independent of presence of bash (as a unix shell) in the system and diff utility no longer needed to check certificates compliance; 5) All directories that are necessary for the correct placement of various logs are automatically created by SST scripts in advance (before running mariabackup on the joiner node); 6) Removal of old binary logs on joiner is done using the binlog index (if it exists) (not only by fixed pattern that based on the current binlog name, as before); 7) Paths for placing binary logs are correctly processed if they are set as relative paths (to the datadir); 8) SST scripts are made even more resistant to spaces in filenames (now for binlogs); 9) In case of failure, SST scripts now always end with an exit code other than zero; 10) SST script for rsync now correctly create a tar file with the binlogs, even if the paths to them (in the binlog index file) are specified as a mix of absolute and relative paths, and even if they do not match with the datadir path specified in the current configuration settings.
Diffstat (limited to 'mysql-test/suite/galera')
-rw-r--r--mysql-test/suite/galera/include/galera_wsrep_recover.inc7
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin_ext.result9
-rw-r--r--mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result82
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff19
-rw-r--r--mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result2
-rw-r--r--mysql-test/suite/galera/r/galera_wan_restart_sst.result11
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_ext.cnf3
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_ext.test2
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.cnf19
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.test2
-rw-r--r--mysql-test/suite/galera/t/galera_log_bin_sst.inc84
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync.test1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_wan_restart_sst.test19
17 files changed, 258 insertions, 15 deletions
diff --git a/mysql-test/suite/galera/include/galera_wsrep_recover.inc b/mysql-test/suite/galera/include/galera_wsrep_recover.inc
index d2956ea99e6..aa2f0e2e777 100644
--- a/mysql-test/suite/galera/include/galera_wsrep_recover.inc
+++ b/mysql-test/suite/galera/include/galera_wsrep_recover.inc
@@ -1,5 +1,12 @@
--echo Performing --wsrep-recover ...
+if ($wsrep_recover_additional)
+{
+--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover $wsrep_recover_additional > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
+}
+if (!$wsrep_recover_additional)
+{
--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1
+}
--perl
use strict;
diff --git a/mysql-test/suite/galera/r/galera_log_bin_ext.result b/mysql-test/suite/galera/r/galera_log_bin_ext.result
index f5276b7d1ac..c5ff66d17b3 100644
--- a/mysql-test/suite/galera/r/galera_log_bin_ext.result
+++ b/mysql-test/suite/galera/r/galera_log_bin_ext.result
@@ -1,4 +1,6 @@
connection node_1;
+connection node_2;
+connection node_1;
reset master;
connection node_2;
reset master;
@@ -40,6 +42,12 @@ hostname1-bin.000001 # Xid # # COMMIT /* XID */
hostname1-bin.000001 # Gtid # # GTID #-#-#
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
+Shutting down server ...
+connection node_1;
+Cleaning var directory ...
+connection node_2;
+Starting server ...
+connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
@@ -66,6 +74,7 @@ hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
hostname1-bin.000001 # Xid # # COMMIT /* XID */
hostname1-bin.000001 # Gtid # # GTID #-#-#
hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
+hostname1-bin.000001 # Rotate # # hostname1-bin.000002;pos=4
DROP TABLE t1;
DROP TABLE t2;
#cleanup
diff --git a/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result b/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result
new file mode 100644
index 00000000000..c5ff66d17b3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result
@@ -0,0 +1,82 @@
+connection node_1;
+connection node_2;
+connection node_1;
+reset master;
+connection node_2;
+reset master;
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (1);
+connection node_2;
+SELECT COUNT(*) = 1 FROM t1;
+COUNT(*) = 1
+1
+SELECT COUNT(*) = 2 FROM t2;
+COUNT(*) = 2
+1
+connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+hostname1-bin.000001 # Gtid # # GTID #-#-#
+hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
+hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
+hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
+hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
+hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+hostname1-bin.000001 # Xid # # COMMIT /* XID */
+hostname1-bin.000001 # Gtid # # GTID #-#-#
+hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
+hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
+hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
+hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
+hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+hostname1-bin.000001 # Xid # # COMMIT /* XID */
+hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
+hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
+hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
+hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+hostname1-bin.000001 # Xid # # COMMIT /* XID */
+hostname1-bin.000001 # Gtid # # GTID #-#-#
+hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
+connection node_2;
+Shutting down server ...
+connection node_1;
+Cleaning var directory ...
+connection node_2;
+Starting server ...
+connection node_2;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+hostname1-bin.000001 # Gtid # # GTID #-#-#
+hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB
+hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
+hostname1-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
+hostname1-bin.000001 # Table_map # # table_id: # (test.t1)
+hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+hostname1-bin.000001 # Xid # # COMMIT /* XID */
+hostname1-bin.000001 # Gtid # # GTID #-#-#
+hostname1-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB
+hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
+hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
+hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
+hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+hostname1-bin.000001 # Xid # # COMMIT /* XID */
+hostname1-bin.000001 # Gtid # # BEGIN GTID #-#-#
+hostname1-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1)
+hostname1-bin.000001 # Table_map # # table_id: # (test.t2)
+hostname1-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
+hostname1-bin.000001 # Xid # # COMMIT /* XID */
+hostname1-bin.000001 # Gtid # # GTID #-#-#
+hostname1-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
+hostname1-bin.000001 # Rotate # # hostname1-bin.000002;pos=4
+DROP TABLE t1;
+DROP TABLE t2;
+#cleanup
+connection node_1;
+RESET MASTER;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff
index 94dd8c2e502..7b10cd23b60 100644
--- a/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_rsync,debug.rdiff
@@ -1,6 +1,6 @@
--- galera_sst_rsync.result
-+++ galera_sst_rsync,debug.reject
-@@ -284,3 +284,111 @@
++++ galera_sst_rsync.reject
+@@ -286,3 +286,111 @@
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
index 525156d88da..23ed9862ea4 100644
--- a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
@@ -1,5 +1,5 @@
---- suite/galera/r/galera_sst_rsync2.result 2018-09-12 13:09:35.352229478 +0200
-+++ suite/galera/r/galera_sst_rsync2,debug.reject 2018-09-12 17:00:51.601974979 +0200
+--- suite/galera/r/galera_sst_rsync2.result
++++ suite/galera/r/galera_sst_rsync2.reject
@@ -286,3 +286,111 @@
DROP TABLE t1;
COMMIT;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
index 8b091eb370a..412f8996f15 100644
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2,debug.rdiff
@@ -1,5 +1,5 @@
---- galera_sst_mariabackup.result
-+++ galera_sst_mariabackup,debug.reject
+--- galera_sst_xtrabackup-v2.result
++++ galera_sst_xtrabackup-v2.reject
@@ -286,5 +286,113 @@
DROP TABLE t1;
COMMIT;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
index ac232020037..1cb0725177b 100644
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir,debug.rdiff
@@ -1,11 +1,12 @@
---- r/galera_sst_xtrabackup-v2_data_dir.result 2018-11-19 12:27:24.795221479 +0200
-+++ r/galera_sst_xtrabackup-v2_data_dir.reject 2018-11-19 19:15:38.774008404 +0200
-@@ -260,3 +260,100 @@
+--- galera_sst_xtrabackup-v2_data_dir.result
++++ galera_sst_xtrabackup-v2_data_dir.reject
+@@ -286,5 +286,113 @@
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
++connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
@@ -14,6 +15,7 @@
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
++connection node_2;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
@@ -22,9 +24,12 @@
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
++connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
++connection node_2;
+SET wsrep_sync_wait = 0;
+Killing server ...
++connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
@@ -39,6 +44,7 @@
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
++connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
@@ -46,7 +52,9 @@
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
++connection node_2;
+Performing --wsrep-recover ...
++connection node_2;
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
@@ -57,6 +65,7 @@
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
++connection node_1;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
@@ -71,6 +80,7 @@
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
++connection node_1a_galera_st_kill_slave_ddl;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
@@ -88,6 +98,7 @@
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
++connection node_1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
@@ -101,3 +112,5 @@
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
+ disconnect node_2;
+ disconnect node_1;
diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result
index ff85a7d6c0f..fdb5883b590 100644
--- a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2_data_dir.result
@@ -286,3 +286,5 @@ COUNT(*) = 0
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
+disconnect node_2;
+disconnect node_1;
diff --git a/mysql-test/suite/galera/r/galera_wan_restart_sst.result b/mysql-test/suite/galera/r/galera_wan_restart_sst.result
index 1adcbfd1d50..2744c91a06b 100644
--- a/mysql-test/suite/galera/r/galera_wan_restart_sst.result
+++ b/mysql-test/suite/galera/r/galera_wan_restart_sst.result
@@ -1,3 +1,9 @@
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
+connection node_1;
+connection node_2;
+connection node_3;
+connection node_4;
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
EXPECT_4
4
@@ -6,10 +12,8 @@ CREATE TABLE t1 (f1 INTEGER);
INSERT INTO t1 VALUES (1);
connection node_2;
INSERT INTO t1 VALUES (2);
-connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
connection node_3;
INSERT INTO t1 VALUES (3);
-connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
connection node_4;
INSERT INTO t1 VALUES (4);
connection node_3;
@@ -81,3 +85,6 @@ CALL mtr.add_suppression("There are no nodes in the same segment that will ever
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
connection node_4;
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+connection node_1;
+disconnect node_3;
+disconnect node_4;
diff --git a/mysql-test/suite/galera/t/galera_log_bin_ext.cnf b/mysql-test/suite/galera/t/galera_log_bin_ext.cnf
index 012209610ea..ae47de90bb8 100644
--- a/mysql-test/suite/galera/t/galera_log_bin_ext.cnf
+++ b/mysql-test/suite/galera/t/galera_log_bin_ext.cnf
@@ -9,3 +9,6 @@ log-slave-updates
log-bin = hostname2-bin
log-bin-index = hostname2.bdx
log-slave-updates
+
+[sst]
+sst_max_binlogs=
diff --git a/mysql-test/suite/galera/t/galera_log_bin_ext.test b/mysql-test/suite/galera/t/galera_log_bin_ext.test
index 923bd623a8a..752073aecdb 100644
--- a/mysql-test/suite/galera/t/galera_log_bin_ext.test
+++ b/mysql-test/suite/galera/t/galera_log_bin_ext.test
@@ -1 +1 @@
---source galera_log_bin.inc
+--source galera_log_bin_sst.inc
diff --git a/mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.cnf b/mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.cnf
new file mode 100644
index 00000000000..c988136b8fb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.cnf
@@ -0,0 +1,19 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+wsrep_sst_method=mariabackup
+wsrep_sst_auth="root:"
+
+[mysqld.1]
+log-bin=@ENV.MYSQLTEST_VARDIR/mysqld.1/data/hostname1-bin
+log-bin-index = hostname1.bdx
+log-slave-updates
+
+[mysqld.2]
+log-bin=@ENV.MYSQLTEST_VARDIR/mysqld.2/data/hostname2-bin
+log-bin-index = hostname2.bdx
+log-slave-updates
+
+[sst]
+transferfmt=@ENV.MTR_GALERA_TFMT
+sst_max_binlogs=
diff --git a/mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.test b/mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.test
new file mode 100644
index 00000000000..47df45b4c71
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin_ext_mariabackup.test
@@ -0,0 +1,2 @@
+--source include/have_mariabackup.inc
+--source galera_log_bin_sst.inc
diff --git a/mysql-test/suite/galera/t/galera_log_bin_sst.inc b/mysql-test/suite/galera/t/galera_log_bin_sst.inc
new file mode 100644
index 00000000000..5d543f6f8b6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin_sst.inc
@@ -0,0 +1,84 @@
+--source include/galera_cluster.inc
+--source include/force_restart.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_1
+reset master;
+--connection node_2
+reset master;
+
+#
+# Test Galera with --log-bin --log-slave-updates .
+# This way the actual MySQL binary log is used,
+# rather than Galera's own implementation
+#
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+--connection node_2
+SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) = 2 FROM t2;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+--let $MASTER_MYPORT=$NODE_MYPORT_1
+--source include/show_binlog_events.inc
+
+--connection node_2
+
+#--connection node_2
+#--source suite/galera/include/galera_stop_replication.inc
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+#
+# Force SST
+#
+--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
+
+--connection node_2
+
+--echo Starting server ...
+let $restart_noprint=2;
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+
+--connection node_2
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+--let $MASTER_MYPORT=$NODE_MYPORT_2
+--source include/show_binlog_events.inc
+
+DROP TABLE t1;
+DROP TABLE t2;
+
+--echo #cleanup
+--connection node_1
+RESET MASTER;
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.test b/mysql-test/suite/galera/t/galera_sst_rsync.test
index 5c08707e870..c944c8d84b7 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync.test
+++ b/mysql-test/suite/galera/t/galera_sst_rsync.test
@@ -10,4 +10,5 @@
--source suite/galera/include/galera_st_kill_slave.inc
--source suite/galera/include/galera_st_kill_slave_ddl.inc
+
--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
index 4f25af7cd8b..3913ab6660f 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_rsync_logbasename.cnf
@@ -12,4 +12,3 @@ log_bin
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
log_basename=server2
log_bin
-
diff --git a/mysql-test/suite/galera/t/galera_wan_restart_sst.test b/mysql-test/suite/galera/t/galera_wan_restart_sst.test
index 16e073e7164..2048977b4ef 100644
--- a/mysql-test/suite/galera/t/galera_wan_restart_sst.test
+++ b/mysql-test/suite/galera/t/galera_wan_restart_sst.test
@@ -12,6 +12,16 @@
--source include/galera_cluster.inc
--source include/force_restart.inc
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--let $node_4=node_4
+--source include/auto_increment_offset_save.inc
+
--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
SELECT VARIABLE_VALUE AS EXPECT_4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
@@ -23,11 +33,9 @@ INSERT INTO t1 VALUES (1);
--connection node_2
INSERT INTO t1 VALUES (2);
---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
INSERT INTO t1 VALUES (3);
---connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
--connection node_4
INSERT INTO t1 VALUES (4);
@@ -156,3 +164,10 @@ CALL mtr.add_suppression("Action message in non-primary configuration from membe
--connection node_4
CALL mtr.add_suppression("Action message in non-primary configuration from member 0");
+
+# Restore original auto_increment_offset values.
+--source include/auto_increment_offset_restore.inc
+
+--connection node_1
+--disconnect node_3
+--disconnect node_4