Skip to content

Commit

Permalink
Merge branch '10.0-galera' into bb-10.1-serg
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirbhay Choubey committed Aug 25, 2016
2 parents dfa3046 + b506d95 commit 90266e8
Show file tree
Hide file tree
Showing 113 changed files with 1,771 additions and 364 deletions.
2 changes: 1 addition & 1 deletion cmake/wsrep.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})

# Set the patch version
SET(WSREP_PATCH_VERSION "13")
SET(WSREP_PATCH_VERSION "16")

# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/galera/disabled.def
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ galera_flush : mysql-wsrep/issues/229
galera_transaction_read_only : mysql-wsrep/issues/229
galera_gcs_fragment : Incorrect arguments to SET
galera_flush_local : Fails sporadically
galera_binlog_stmt_autoinc : TODO: investigate
4 changes: 2 additions & 2 deletions mysql-test/suite/galera/galera_2nodes.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ wsrep-sync-wait=7
#[email protected]
#[email protected]
wsrep-cluster-address=gcomm://
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M'
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'

Expand All @@ -25,7 +25,7 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#[email protected]
#[email protected]
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M'
wsrep_provider_options='repl.causal_read_timeout=PT90S;[email protected].#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'

Expand Down
35 changes: 35 additions & 0 deletions mysql-test/suite/galera/include/auto_increment_offset_restore.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See auto_increment_offset_restore.inc for details.

if (!$node_1)
{
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc
}

if (!$node_2)
{
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc
}

if (!$auto_increment_offset_node_1)
{
--die ERROR IN TEST: $auto_increment_offset_node_1 must be set before sourcing auto_increment_offset_save.inc
}

if (!$auto_increment_offset_node_2)
{
--die ERROR IN TEST: $auto_increment_offset_node_2 must be set before sourcing auto_increment_offset_save.inc
}

# Restore original auto_increment_offset values.
--disable_query_log
--connection $node_1
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
--connection $node_2
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;

if ($node_3)
{
--connection $node_3
--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3;
}
--enable_query_log
37 changes: 37 additions & 0 deletions mysql-test/suite/galera/include/auto_increment_offset_save.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This file can be used to save the @@global.auto_increment_offset value at
# the beginning of any test that intends to restart any of the participating
# nodes. This is required as the node may get auto-assigned a different
# auto_increment_offset value on restart, which could cause MTR's internal
# post-check to fail. auto_increment_offset_restore.inc can be used at the
# end of the test to restore these saved values.

# Parameters
# ----------
# $node_1
# Connection handle for 1st node
# $node_2
# Connection handle for 2nd node
# $node_3 (optional)
# Connection handle for 3rd node

if (!$node_1)
{
--die ERROR IN TEST: $node_1 must be set before sourcing auto_increment_offset_save.inc
}

if (!$node_2)
{
--die ERROR IN TEST: $node_2 must be set before sourcing auto_increment_offset_save.inc
}

--connection $node_1
let $auto_increment_offset_node_1 = `SELECT @@global.auto_increment_offset`;
--connection $node_2
let $auto_increment_offset_node_2 = `SELECT @@global.auto_increment_offset`;

if ($node_3)
{
--connection $node_3
let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`;
}

6 changes: 6 additions & 0 deletions mysql-test/suite/galera/r/GAL-382.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb;
insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3);
create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb;
replace into t2 (i, j, k) select /*!99997 */ i, k, j from t1;
DROP TABLE t1;
DROP TABLE t2;
7 changes: 7 additions & 0 deletions mysql-test/suite/galera/r/MW-252.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
FLUSH TABLES WITH READ LOCK;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
UNLOCK TABLES;
DROP TABLE t1;
34 changes: 34 additions & 0 deletions mysql-test/suite/galera/r/MW-258.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
CREATE TABLE t1 (f1 INTEGER);
LOCK TABLE t1 WRITE;
value prior to RSU:
SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SHOW VARIABLES LIKE 'wsrep_desync';
Variable_name Value
wsrep_desync OFF
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_osu_method = RSU;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_osu_method = RSU;
ALTER TABLE t1 ADD COLUMN f3 INTEGER;;
value during RSU:
SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 2
SHOW VARIABLES LIKE 'wsrep_desync';
Variable_name Value
wsrep_desync OFF
UNLOCK TABLES;
value after RSU:
SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SHOW VARIABLES LIKE 'wsrep_desync';
Variable_name Value
wsrep_desync OFF
SET GLOBAL wsrep_desync=0;
Warnings:
Warning 1231 'wsrep_desync' is already OFF.
DROP TABLE t1;
12 changes: 12 additions & 0 deletions mysql-test/suite/galera/r/MW-259.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET GLOBAL wsrep_desync=0;
Warnings:
Warning 1231 'wsrep_desync' is already OFF.
SET wsrep_OSU_method=RSU;
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
SET GLOBAL wsrep_desync=1;;
SET DEBUG_SYNC= 'now SIGNAL continue';
DROP TABLE t1;
SET GLOBAL wsrep_desync=0;
SET DEBUG_SYNC= 'RESET';
1 change: 1 addition & 0 deletions mysql-test/suite/galera/r/MW-284.result
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ DROP TABLE t1;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
19 changes: 19 additions & 0 deletions mysql-test/suite/galera/r/MW-285.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent1_id INT,
parent2_id INT,
FOREIGN KEY (parent1_id) REFERENCES parent1(id),
FOREIGN KEY (parent1_id) REFERENCES parent2(id)
) ENGINE=InnoDB;
INSERT INTO parent1 VALUES (1);
INSERT INTO parent2 VALUES (1);
INSERT INTO child VALUES (1,1,1);
INSERT INTO child VALUES (2,1,1);
SET foreign_key_checks=OFF;
DROP TABLE parent1;
UPDATE child SET parent1_id=2 WHERE id=1;
DROP TABLE child;
DROP TABLE parent2;
SET foreign_key_checks=ON;
13 changes: 13 additions & 0 deletions mysql-test/suite/galera/r/MW-286.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
SET GLOBAL wsrep_desync = TRUE;
SET wsrep_on = FALSE;
ALTER TABLE t1 ADD PRIMARY KEY (f1);
ERROR 70100: Query execution was interrupted
SET wsrep_on = TRUE;
SET GLOBAL wsrep_desync = FALSE;
DROP TABLE t1;
DROP TABLE ten;
30 changes: 30 additions & 0 deletions mysql-test/suite/galera/r/MW-292.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
CREATE TABLE rand_table (f1 FLOAT);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (2, 'a');
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
f1 f2
2 a
SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
COMMIT;;
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
TIMEDIFF(SYSDATE(), NOW()) < 2
1
INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
COUNT(DISTINCT f1) = 10
1
wsrep_local_replays
1
DROP TABLE t1;
DROP TABLE rand_table;
14 changes: 14 additions & 0 deletions mysql-test/suite/galera/r/MW-44.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
TRUNCATE TABLE mysql.general_log;
TRUNCATE TABLE mysql.general_log;
SET SESSION wsrep_osu_method=TOI;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_osu_method=RSU;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SET SESSION wsrep_osu_method=TOI;
SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%';
COUNT(*) = 2
1
SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%';
COUNT(*) = 0
1
DROP TABLE t1;
5 changes: 5 additions & 0 deletions mysql-test/suite/galera/r/galera#414.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_on = OFF;
SET SESSION wsrep_on = ON;
CALL mtr.add_suppression("Failed to set packet size");
CALL mtr.add_suppression("Failed to set packet size");
1 change: 1 addition & 0 deletions mysql-test/suite/galera/r/galera_as_master.result
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ SET SQL_LOG_BIN=OFF;
DROP TABLE t2, t3;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work');
82 changes: 82 additions & 0 deletions mysql-test/suite/galera/r/galera_as_slave_autoinc.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
START SLAVE;
SET SESSION binlog_format='STATEMENT';
CREATE TABLE t1 (
i int(11) NOT NULL AUTO_INCREMENT,
c char(32) DEFAULT 'dummy_text',
PRIMARY KEY (i)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
insert into t1(i) values(null);
select * from t1;
i c
1 dummy_text
insert into t1(i) values(null), (null), (null);
select * from t1;
i c
1 dummy_text
2 dummy_text
3 dummy_text
4 dummy_text
SET SESSION auto_increment_increment=7;
insert into t1(i) values(null), (null), (null);
SET SESSION auto_increment_offset=5;
insert into t1(i) values(null), (null), (null);
select * from t1;
i c
1 dummy_text
2 dummy_text
3 dummy_text
4 dummy_text
8 dummy_text
15 dummy_text
22 dummy_text
33 dummy_text
40 dummy_text
47 dummy_text
show variables like 'binlog_format';
Variable_name Value
binlog_format STATEMENT
show variables like '%auto_increment%';
Variable_name Value
auto_increment_increment 7
auto_increment_offset 5
wsrep_auto_increment_control ON
select * from t1;
i c
1 dummy_text
2 dummy_text
3 dummy_text
4 dummy_text
8 dummy_text
15 dummy_text
22 dummy_text
33 dummy_text
40 dummy_text
47 dummy_text
show variables like 'binlog_format';
Variable_name Value
binlog_format ROW
show variables like 'auto_increment_increment';
Variable_name Value
auto_increment_increment 2
select * from t1;
i c
1 dummy_text
2 dummy_text
3 dummy_text
4 dummy_text
8 dummy_text
15 dummy_text
22 dummy_text
33 dummy_text
40 dummy_text
47 dummy_text
show variables like 'binlog_format';
Variable_name Value
binlog_format ROW
show variables like 'auto_increment_increment';
Variable_name Value
auto_increment_increment 2
DROP TABLE t1;
STOP SLAVE;
RESET SLAVE ALL;
RESET MASTER;
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/galera_as_slave_nonprim.result
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression("Slave SQL: Error 'Unknown command' on query");
CALL mtr.add_suppression("Slave: Unknown command Error_code: 1047");
CALL mtr.add_suppression("Send action {\\(nil\\), 328, TORDERED} returned -107 \\(Transport endpoint is not connected\\)");
CALL mtr.add_suppression("Transport endpoint is not connected");
CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed, 'Deadlock found when trying to get lock; try restarting transaction', Error_code: 1213");
CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
RESET MASTER;
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ SET SESSION wsrep_sync_wait = 0;
UNLOCK TABLES;
COMMIT;
SET AUTOCOMMIT=ON;
SELECT * FROM t1;
f1
2
SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
wsrep_local_aborts_increment
1
DROP TABLE t1;
Loading

0 comments on commit 90266e8

Please sign in to comment.