Commit f42e08f9 authored by Sergei Golubchik's avatar Sergei Golubchik

Merge branch '10.0-galera' into 10.1

parents 8c35f105 0e3170e3
...@@ -41,4 +41,3 @@ SET(WSREP_PROC_INFO ${WITH_WSREP}) ...@@ -41,4 +41,3 @@ SET(WSREP_PROC_INFO ${WITH_WSREP})
IF(WITH_WSREP) IF(WITH_WSREP)
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}") SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
ENDIF() ENDIF()
...@@ -16,7 +16,7 @@ wsrep-sync-wait=7 ...@@ -16,7 +16,7 @@ wsrep-sync-wait=7
#ist_port=@OPT.port #ist_port=@OPT.port
#sst_port=@OPT.port #sst_port=@OPT.port
wsrep-cluster-address=gcomm:// 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_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
......
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;
#
# 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;
!include ../galera_2nodes.cnf !include ../galera_2nodes.cnf
[mysqld] [mysqld]
#wsrep_sst_method=xtrabackup-v2 wsrep_sst_method=xtrabackup-v2
#wsrep_sst_auth="root:" wsrep_sst_auth="root:"
#wsrep_debug=ON
[mysqld.1] [mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
......
# #
# Test that autoincrement works correctly while the cluster membership # 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 --source include/big_test.inc
......
...@@ -19,10 +19,13 @@ SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; ...@@ -19,10 +19,13 @@ SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
LOCK TABLE t1 WRITE; LOCK TABLE t1 WRITE;
--connection node_1 --connection node_1
--sleep 1
INSERT INTO t1 VALUES (2); INSERT INTO t1 VALUES (2);
--sleep 1
INSERT INTO t1 VALUES (3); INSERT INTO t1 VALUES (3);
--sleep 1
INSERT INTO t1 VALUES (4); INSERT INTO t1 VALUES (4);
--sleep 1
# This query will hang because flow control will kick in # This query will hang because flow control will kick in
--send --send
......
...@@ -76,4 +76,3 @@ CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7 ...@@ -76,4 +76,3 @@ CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7
--source include/galera_end.inc --source include/galera_end.inc
--echo # End of test --echo # End of test
...@@ -5,3 +5,4 @@ galera_slave_options_do :MDEV-8798 ...@@ -5,3 +5,4 @@ galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798 galera_slave_options_ignore : MDEV-8798
galera_pc_bootstrap : TODO: Investigate: Timeout in wait_condition.inc galera_pc_bootstrap : TODO: Investigate: Timeout in wait_condition.inc
galera_pc_weight : Test times out galera_pc_weight : Test times out
galera_safe_to_bootstrap : I Really dont know :(
...@@ -14,11 +14,10 @@ wsrep-causal-reads=ON ...@@ -14,11 +14,10 @@ wsrep-causal-reads=ON
wsrep-sync-wait=7 wsrep-sync-wait=7
[mysqld.1] [mysqld.1]
#galera_port=@OPT.port wsrep-cluster-address='gcomm://'
#ist_port=@OPT.port wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
#sst_port=@OPT.port
wsrep-cluster-address=gcomm:// wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
......
...@@ -12,11 +12,29 @@ ...@@ -12,11 +12,29 @@
--disable_query_log --disable_query_log
eval SET @GALERA_VERSION=(SELECT CONCAT('$galera_version', '%')); # Required Version
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE eval SET @GALERA_VERSION='$galera_version';
VARIABLE_NAME LIKE 'wsrep_provider_version' AND SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION;
VARIABLE_VALUE LIKE @GALERA_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; skip Test requires Galera library version $galera_version;
} }
......
...@@ -5747,6 +5747,20 @@ static int binlog_log_row(TABLE* table, ...@@ -5747,6 +5747,20 @@ static int binlog_log_row(TABLE* table,
table->file->partition_ht()->db_type != DB_TYPE_INNODB) || table->file->partition_ht()->db_type != DB_TYPE_INNODB) ||
(thd->wsrep_ignore_table == true)) (thd->wsrep_ignore_table == true))
return 0; 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 */ #endif /* WITH_WSREP */
if (check_table_binlog_row_based(thd, table)) if (check_table_binlog_row_based(thd, table))
......
...@@ -7587,7 +7587,6 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi) ...@@ -7587,7 +7587,6 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi)
consistent. consistent.
*/ */
#ifdef WITH_WSREP #ifdef WITH_WSREP
/*Set wsrep_affected_rows = 0 */
thd->wsrep_affected_rows= 0; thd->wsrep_affected_rows= 0;
#endif #endif
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -334,6 +333,24 @@ trx_print_low( ...@@ -334,6 +333,24 @@ trx_print_low(
/*!< in: mem_heap_get_size(trx->lock.lock_heap) */ /*!< in: mem_heap_get_size(trx->lock.lock_heap) */
MY_ATTRIBUTE((nonnull)); 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. Prints info about a transaction.
The caller must hold lock_sys->mutex and trx_sys->mutex. The caller must hold lock_sys->mutex and trx_sys->mutex.
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -2283,6 +2284,7 @@ wsrep_trx_print_locking( ...@@ -2283,6 +2284,7 @@ wsrep_trx_print_locking(
} }
} }
#endif /* WITH_WSREP */ #endif /* WITH_WSREP */
/**********************************************************************//** /**********************************************************************//**
Prints info about a transaction. Prints info about a transaction.
Acquires and releases lock_sys->mutex and trx_sys->mutex. */ Acquires and releases lock_sys->mutex and trx_sys->mutex. */
...@@ -2744,4 +2746,3 @@ trx_start_for_ddl_low( ...@@ -2744,4 +2746,3 @@ trx_start_for_ddl_low(
ut_error; ut_error;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment