mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge branch '10.0-galera' into 10.1
This commit is contained in:
@@ -41,4 +41,3 @@ SET(WSREP_PROC_INFO ${WITH_WSREP})
|
||||
IF(WITH_WSREP)
|
||||
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
|
||||
ENDIF()
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ wsrep-sync-wait=7
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-cluster-address=gcomm://
|
||||
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
|
||||
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;gcache.size=10M'
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||
|
||||
|
||||
22
mysql-test/suite/galera/r/MW-309.result
Normal file
22
mysql-test/suite/galera/r/MW-309.result
Normal file
@@ -0,0 +1,22 @@
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
SET GLOBAL wsrep_max_ws_rows = 2;
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 GROUP BY f1;
|
||||
f1
|
||||
1
|
||||
SELECT * FROM t1 GROUP BY f1;
|
||||
f1
|
||||
1
|
||||
SELECT * FROM t1 GROUP BY f1;
|
||||
f1
|
||||
1
|
||||
SHOW STATUS LIKE '%wsrep%';
|
||||
SET GLOBAL wsrep_max_ws_rows = 0;
|
||||
DROP TABLE t1;
|
||||
32
mysql-test/suite/galera/t/MW-309.test
Normal file
32
mysql-test/suite/galera/t/MW-309.test
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# MW-309 Regression: wsrep_max_ws_rows limit also applies to certain SELECT queries
|
||||
#
|
||||
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
|
||||
SET GLOBAL wsrep_max_ws_rows = 2;
|
||||
|
||||
SET AUTOCOMMIT=OFF;
|
||||
START TRANSACTION;
|
||||
SELECT * FROM t1 GROUP BY f1;
|
||||
SELECT * FROM t1 GROUP BY f1;
|
||||
|
||||
--error 0
|
||||
SELECT * FROM t1 GROUP BY f1;
|
||||
|
||||
--disable_result_log
|
||||
--error 0
|
||||
SHOW STATUS LIKE '%wsrep%';
|
||||
--enable_result_log
|
||||
|
||||
SET GLOBAL wsrep_max_ws_rows = 0;
|
||||
DROP TABLE t1;
|
||||
@@ -1,9 +1,8 @@
|
||||
!include ../galera_2nodes.cnf
|
||||
|
||||
[mysqld]
|
||||
#wsrep_sst_method=xtrabackup-v2
|
||||
#wsrep_sst_auth="root:"
|
||||
#wsrep_debug=ON
|
||||
wsrep_sst_method=xtrabackup-v2
|
||||
wsrep_sst_auth="root:"
|
||||
|
||||
[mysqld.1]
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Test that autoincrement works correctly while the cluster membership
|
||||
# is changing and IST takes place.
|
||||
# is changing and SST takes place.
|
||||
#
|
||||
|
||||
--source include/big_test.inc
|
||||
|
||||
@@ -19,10 +19,13 @@ SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
|
||||
LOCK TABLE t1 WRITE;
|
||||
|
||||
--connection node_1
|
||||
|
||||
--sleep 1
|
||||
INSERT INTO t1 VALUES (2);
|
||||
--sleep 1
|
||||
INSERT INTO t1 VALUES (3);
|
||||
--sleep 1
|
||||
INSERT INTO t1 VALUES (4);
|
||||
--sleep 1
|
||||
|
||||
# This query will hang because flow control will kick in
|
||||
--send
|
||||
|
||||
@@ -76,4 +76,3 @@ CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
||||
|
||||
|
||||
@@ -5,3 +5,4 @@ galera_slave_options_do :MDEV-8798
|
||||
galera_slave_options_ignore : MDEV-8798
|
||||
galera_pc_bootstrap : TODO: Investigate: Timeout in wait_condition.inc
|
||||
galera_pc_weight : Test times out
|
||||
galera_safe_to_bootstrap : I Really dont know :(
|
||||
|
||||
@@ -14,11 +14,10 @@ wsrep-causal-reads=ON
|
||||
wsrep-sync-wait=7
|
||||
|
||||
[mysqld.1]
|
||||
#galera_port=@OPT.port
|
||||
#ist_port=@OPT.port
|
||||
#sst_port=@OPT.port
|
||||
wsrep-cluster-address=gcomm://
|
||||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
|
||||
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_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
|
||||
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
|
||||
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
|
||||
|
||||
|
||||
@@ -12,11 +12,29 @@
|
||||
|
||||
--disable_query_log
|
||||
|
||||
eval SET @GALERA_VERSION=(SELECT CONCAT('$galera_version', '%'));
|
||||
# Required Version
|
||||
|
||||
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE
|
||||
VARIABLE_NAME LIKE 'wsrep_provider_version' AND
|
||||
VARIABLE_VALUE LIKE @GALERA_VERSION`)
|
||||
eval SET @GALERA_VERSION='$galera_version';
|
||||
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION;
|
||||
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @GALERA_MID_VERSION;
|
||||
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @GALERA_MINOR_VERSION;
|
||||
|
||||
# Actual
|
||||
SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version';
|
||||
|
||||
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MAJOR_VERSION;
|
||||
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @ACTUAL_GALERA_MID_VERSION;
|
||||
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION;
|
||||
|
||||
# For testing
|
||||
#SELECT @GALERA_MAJOR_VERSION, @GALERA_MID_VERSION, @GALERA_MINOR_VERSION;
|
||||
#SELECT @ACTUAL_GALERA_VERSION;
|
||||
#SELECT @ACTUAL_GALERA_MAJOR_VERSION, @ACTUAL_GALERA_MID_VERSION, @ACTUAL_GALERA_MINOR_VERSION;
|
||||
|
||||
if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION > @GALERA_MAJOR_VERSION) OR
|
||||
(@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MID_VERSION > @GALERA_MID_VERSION) OR
|
||||
(@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MID_VERSION = @GALERA_MID_VERSION AND @ACTUAL_GALERA_MINOR_VERSION >= @GALERA_MINOR_VERSION)
|
||||
`)
|
||||
{
|
||||
skip Test requires Galera library version $galera_version;
|
||||
}
|
||||
|
||||
@@ -5747,6 +5747,20 @@ static int binlog_log_row(TABLE* table,
|
||||
table->file->partition_ht()->db_type != DB_TYPE_INNODB) ||
|
||||
(thd->wsrep_ignore_table == true))
|
||||
return 0;
|
||||
|
||||
/* enforce wsrep_max_ws_rows */
|
||||
if (WSREP(thd) && table->s->tmp_table == NO_TMP_TABLE)
|
||||
{
|
||||
thd->wsrep_affected_rows++;
|
||||
if (wsrep_max_ws_rows &&
|
||||
thd->wsrep_exec_mode != REPL_RECV &&
|
||||
thd->wsrep_affected_rows > wsrep_max_ws_rows)
|
||||
{
|
||||
trans_rollback_stmt(thd) || trans_rollback(thd);
|
||||
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
|
||||
return ER_ERROR_DURING_COMMIT;
|
||||
}
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
if (check_table_binlog_row_based(thd, table))
|
||||
|
||||
@@ -7587,7 +7587,6 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi)
|
||||
consistent.
|
||||
*/
|
||||
#ifdef WITH_WSREP
|
||||
/*Set wsrep_affected_rows = 0 */
|
||||
thd->wsrep_affected_rows= 0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2016, MariaDB Corporation. All Rights Reserved.
|
||||
Copyright (c) 2015, 2017, 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 the Free Software
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2015, 2017, 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 the Free Software
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2015, 2016, MariaDB Corporation. All Rights Reserved.
|
||||
|
||||
Copyright (c) 2015, 2017, 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 the Free Software
|
||||
@@ -334,6 +333,24 @@ trx_print_low(
|
||||
/*!< in: mem_heap_get_size(trx->lock.lock_heap) */
|
||||
MY_ATTRIBUTE((nonnull));
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
/**********************************************************************//**
|
||||
Prints info about a transaction.
|
||||
Transaction information may be retrieved without having trx_sys->mutex acquired
|
||||
so it may not be completely accurate. The caller must own lock_sys->mutex
|
||||
and the trx must have some locks to make sure that it does not escape
|
||||
without locking lock_sys->mutex. */
|
||||
UNIV_INTERN
|
||||
void
|
||||
wsrep_trx_print_locking(
|
||||
/*==============*/
|
||||
FILE* f, /*!< in: output stream */
|
||||
const trx_t* trx, /*!< in: transaction */
|
||||
ulint max_query_len) /*!< in: max query length to print,
|
||||
or 0 to use the default max length */
|
||||
MY_ATTRIBUTE((nonnull));
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
/**********************************************************************//**
|
||||
Prints info about a transaction.
|
||||
The caller must hold lock_sys->mutex and trx_sys->mutex.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*****************************************************************************
|
||||
|
||||
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2015, 2017, 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 the Free Software
|
||||
@@ -2283,6 +2284,7 @@ state_ok:
|
||||
}
|
||||
}
|
||||
#endif /* WITH_WSREP */
|
||||
|
||||
/**********************************************************************//**
|
||||
Prints info about a transaction.
|
||||
Acquires and releases lock_sys->mutex and trx_sys->mutex. */
|
||||
@@ -2744,4 +2746,3 @@ trx_start_for_ddl_low(
|
||||
|
||||
ut_error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user