Skip to content
Permalink
Browse files
Merge 10.3 into 10.4
  • Loading branch information
dr-m committed Mar 11, 2019
2 parents 038ffd2 + 814205f commit 58f3ff7
Show file tree
Hide file tree
Showing 32 changed files with 434 additions and 213 deletions.
@@ -222,6 +222,14 @@ IF (WITH_TSAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=thread" DEBUG RELWITHDEBINFO)
ENDIF()

OPTION(WITH_UBSAN "Enable undefined behavior sanitizer" OFF)
IF (WITH_UBSAN)
IF(SECURITY_HARDENED)
MESSAGE(FATAL_ERROR "WITH_UBSAN and SECURITY_HARDENED are mutually exclusive")
ENDIF()
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=undefined" DEBUG RELWITHDEBINFO)
ENDIF()

IF(NOT WITH_TSAN)
# enable security hardening features, like most distributions do
# in our benchmarks that costs about ~1% of performance, depending on the load
@@ -34,8 +34,8 @@ ENDFOREACH()

# Ensure we have clean build for shared libraries
# without unresolved symbols
# Not supported with AddressSanitizer and ThreadSanitizer
IF(NOT WITH_ASAN AND NOT WITH_TSAN)
# Not supported with the clang sanitizers
IF(NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN)
SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
ENDIF()

@@ -1,5 +1,5 @@
# Copyright (c) 2009, 2018, Oracle and/or its affiliates.
# Copyright (c) 2011, 2018, MariaDB Corporation
# Copyright (c) 2011, 2019, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -209,7 +209,7 @@ MACRO(MYSQL_ADD_PLUGIN)
ELSEIF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
TARGET_LINK_LIBRARIES (${target} mysqld)
ENDIF()
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT WITH_ASAN AND NOT WITH_TSAN)
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN)
TARGET_LINK_LIBRARIES (${target} "-Wl,--no-undefined")
ENDIF()

@@ -32,9 +32,10 @@ galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_
galera_concurrent_ctas : MDEV-18180 Galera test failure on galera.galera_concurrent_ctas
galera_encrypt_tmp_files : Get error failed to enable encryption of temporary files
galera_flush : MariaDB does not have global.thread_statistics
galera_gcache_recover_manytrx : MDEV-18834 Galera test failure
galera_gcs_fc_limit : MDEV-17061 Timeout in wait_condition.inc for PROCESSLIST
galera_ist_mariabackup : Leaves port open
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
galera_ist_mariabackup : MDEV-18829 test leaves port open
galera_ist_progress: MDEV-15236 fails when trying to read transfer status
galera_kill_applier : race condition at the start of the test
galera_kill_ddl : MDEV-17108 Test failure on galera.galera_kill_ddl
galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges
@@ -1,5 +1,10 @@
connection node_2;
connection node_1;
connection node_1;
TRUNCATE TABLE mysql.general_log;
connection node_2;
TRUNCATE TABLE mysql.general_log;
connection node_1;
SELECT Argument FROM mysql.general_log;
Argument
SET GLOBAL general_log='ON';
@@ -12,8 +17,10 @@ SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument
argument
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
SELECT Argument FROM mysql.general_log;
Argument
DROP TABLE t1;
SET GLOBAL general_log='OFF';
connection node_1;
SET GLOBAL general_log='OFF';
@@ -1,4 +1,6 @@
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
@@ -3,34 +3,36 @@ connection node_1;
connection node_1;
connection node_2;
connection node_1;
connection node_2;
connection node_1;
SET SESSION innodb_lock_wait_timeout=600;
SET SESSION lock_wait_timeout=600;
CREATE TABLE ten (f1 INTEGER);
CREATE TABLE ten (f1 INTEGER) engine=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
connection node_2;
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_sync_wait = 15;
SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';
SELECT COUNT(*) = 100000 FROM t1;
COUNT(*) = 100000
1
SELECT COUNT(*) FROM t1;
COUNT(*)
100000
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
connection node_1;
SELECT COUNT(*) = 200000 FROM t1;
COUNT(*) = 200000
1
SELECT COUNT(*) FROM t1;
COUNT(*)
200000
UPDATE t1 SET f2 = 1;
connection node_2;
SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1;
COUNT(*) = 200000
1
SELECT COUNT(*) FROM t1 WHERE f2 = 1;
COUNT(*)
200000
connection node_1;
START TRANSACTION;
SELECT COUNT(*) = 200000 FROM t1;
COUNT(*) = 200000
1
SELECT COUNT(*) FROM t1;
COUNT(*)
200000
UPDATE t1 SET f2 = 3;
connection node_2;
START TRANSACTION;
@@ -1,3 +1,4 @@
connection node_1;
SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership;
COUNT(DISTINCT uuid) = 2
1
@@ -5,7 +5,6 @@

--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_mariabackup.inc

--let $node_1=node_1
@@ -33,11 +32,11 @@ END|
DELIMITER ;|

--send CALL p1();
--sleep 2
--sleep 1

--connection node_2
--send CALL p1();
--sleep 2
--sleep 1

# Kill and restart node #2

@@ -46,11 +45,7 @@ DELIMITER ;|
--source include/kill_galera.inc

--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat

--sleep 10
--source include/start_mysqld.inc
--sleep 25
--source include/wait_until_connected_again.inc

INSERT INTO t1 VALUES (DEFAULT);

@@ -73,8 +68,6 @@ INSERT INTO t1 VALUES (DEFAULT);
--error 2013,2006
--reap

--sleep 10

# Confirm that the count is correct and that the cluster is intact

--connection node_1a
@@ -3,7 +3,11 @@
#

--source include/galera_cluster.inc
--source include/have_innodb.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
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
@@ -29,4 +33,7 @@ SET SESSION wsrep_sync_wait = DEFAULT;
SELECT COUNT(*) = 1 FROM t1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';

--let $node_2=node_2a
--source include/auto_increment_offset_restore.inc

DROP TABLE t1;
@@ -1,10 +1,5 @@
!include ../galera_2nodes.cnf

[mysqld.1]
[mysqld]
innodb-status-output=ON
innodb-status-output-locks=ON

[mysqld.2]
innodb-status-output=ON
innodb-status-output-locks=ON

@@ -1,7 +1,5 @@

--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc

# Save original auto_increment_offset values.
--let $node_1=node_1
@@ -12,7 +10,7 @@
SET SESSION innodb_lock_wait_timeout=600;
SET SESSION lock_wait_timeout=600;

CREATE TABLE ten (f1 INTEGER);
CREATE TABLE ten (f1 INTEGER) engine=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB;
@@ -25,19 +23,19 @@ SET SESSION wsrep_sync_wait = 15;

SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H';

SELECT COUNT(*) = 100000 FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;

--connection node_1
SELECT COUNT(*) = 200000 FROM t1;
SELECT COUNT(*) FROM t1;
UPDATE t1 SET f2 = 1;

--connection node_2
SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1;
SELECT COUNT(*) FROM t1 WHERE f2 = 1;

--connection node_1
START TRANSACTION;
SELECT COUNT(*) = 200000 FROM t1;
SELECT COUNT(*) FROM t1;
UPDATE t1 SET f2 = 3;

--connection node_2
@@ -55,7 +53,7 @@ COMMIT;
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2';
--enable_query_log

--source include/auto_increment_offset_restore.inc

DROP TABLE t1;
DROP TABLE ten;

--source include/auto_increment_offset_restore.inc
@@ -0,0 +1,24 @@
connection node_2;
connection node_1;
SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
VARIABLE_VALUE LIKE '%[::1]%'
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\]]
include/assert_grep.inc [Prepared IST receiver for 3-6, listening at: tcp://\[::1\]]
@@ -0,0 +1,19 @@
connection node_2;
connection node_1;
SELECT VARIABLE_VALUE LIKE '%[::1]%' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_incoming_addresses';
VARIABLE_VALUE LIKE '%[::1]%'
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;
@@ -0,0 +1,39 @@
!include ../galera_3nodes.cnf

# decoy value - should not be read by mysqld or sst scripts
[mysqld]
innodb-data-home-dir=/tmp

[galera]
innodb-data-home-dir=
wsrep_sst_method=mariabackup
wsrep_sst_auth="root:"
wsrep_node_address=::1

[galera.1]
wsrep-cluster-address=gcomm://
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'
wsrep_node_name=node_1

[galera.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_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'
wsrep_node_name=node_2
wsrep_sst_donor=node_1

[galera.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_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'
wsrep_node_name=node_3
wsrep_sst_donor=node_1

[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
streamfmt=xbstream
sockopt=",pf=ip6"
@@ -0,0 +1 @@
--bind-address=::

0 comments on commit 58f3ff7

Please sign in to comment.