-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-24903: mariabackup SST fails while adding --log-bin in startup c…
…ommand Mariabackup SST fails if "--log-bin" option is added with no value to command line parameters at server startup. This is because the SST scripts do not correctly interpret the "--- log-bin" option without a value. This patch adds correct handling of the "--log-bin" parameter without value to the general part of the parameter parsing (for SST scripts) and fixes the problem. Also added a test that checks the correct operation of the server after the fix.
- Loading branch information
Showing
7 changed files
with
137 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
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 | ||
mysqld-bin.000001 # Gtid # # GTID #-#-# | ||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB | ||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# | ||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) | ||
mysqld-bin.000001 # Table_map # # table_id: # (test.t1) | ||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F | ||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ | ||
mysqld-bin.000001 # Gtid # # GTID #-#-# | ||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB | ||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# | ||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) | ||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) | ||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F | ||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ | ||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# | ||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) | ||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) | ||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F | ||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ | ||
mysqld-bin.000001 # Gtid # # GTID #-#-# | ||
mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER | ||
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 | ||
mysqld-bin.000001 # Gtid # # GTID #-#-# | ||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB | ||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# | ||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1) | ||
mysqld-bin.000001 # Table_map # # table_id: # (test.t1) | ||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F | ||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ | ||
mysqld-bin.000001 # Gtid # # GTID #-#-# | ||
mysqld-bin.000001 # Query # # use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB | ||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# | ||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) | ||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) | ||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F | ||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ | ||
mysqld-bin.000001 # Gtid # # BEGIN GTID #-#-# | ||
mysqld-bin.000001 # Annotate_rows # # INSERT INTO t2 VALUES (1) | ||
mysqld-bin.000001 # Table_map # # table_id: # (test.t2) | ||
mysqld-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F | ||
mysqld-bin.000001 # Xid # # COMMIT /* XID */ | ||
mysqld-bin.000001 # Gtid # # GTID #-#-# | ||
mysqld-bin.000001 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER | ||
DROP TABLE t1; | ||
DROP TABLE t2; | ||
#cleanup | ||
connection node_1; | ||
RESET MASTER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--source include/galera_cluster.inc | ||
--source include/force_restart.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 | ||
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1 @@ | ||
--source include/galera_cluster.inc | ||
--source include/force_restart.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 | ||
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; | ||
|
||
--source galera_log_bin.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--log-slave-updates --log-bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
!include ../galera_2nodes.cnf | ||
|
||
[mysqld] | ||
wsrep_sst_method=mariabackup | ||
wsrep_sst_auth="root:" | ||
|
||
[mysqld.1] | ||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' | ||
|
||
[mysqld.2] | ||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' | ||
|
||
[sst] | ||
transferfmt=@ENV.MTR_GALERA_TFMT | ||
streamfmt=xbstream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--source include/have_mariabackup.inc | ||
--source galera_log_bin.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters