Commit f740d23c authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.1 into 10.2

parents e21c15a7 97e0c260
......@@ -15,12 +15,25 @@
# Symbols with information about the CPU.
FIND_PROGRAM(GETCONF getconf)
MARK_AS_ADVANCED(GETCONF)
IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
FIND_PROGRAM(SYSCTL sysctl)
MARK_AS_ADVANCED(SYSCTL)
IF(GETCONF)
EXECUTE_PROCESS(
COMMAND ${GETCONF} LEVEL1_DCACHE_LINESIZE
OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE
)
IF(SYSCTL)
EXECUTE_PROCESS(
COMMAND ${SYSCTL} -n hw.cachelinesize
OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE
)
ENDIF()
ELSE()
FIND_PROGRAM(GETCONF getconf)
MARK_AS_ADVANCED(GETCONF)
IF(GETCONF)
EXECUTE_PROCESS(
COMMAND ${GETCONF} LEVEL1_DCACHE_LINESIZE
OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE
)
ENDIF()
ENDIF()
......@@ -188,7 +188,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# binaries properly)
ADD_CUSTOM_COMMAND(TARGET ${TARGET} POST_BUILD
COMMAND rm ${TARGET_LOCATION}
COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}
COMMAND libtool -static -o ${TARGET_LOCATION}
${STATIC_LIBS}
)
ELSE()
......
......@@ -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 "16")
SET(WSREP_PATCH_VERSION "19")
# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION
......
......@@ -26,7 +26,7 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
mysqld_safe_helper.1 tokuftdump.1 wsrep_sst_common.1
wsrep_sst_mysqldump.1 wsrep_sst_rsync.1
wsrep_sst_xtrabackup-v2.1 wsrep_sst_xtrabackup.1
galera_recovery.1 galera_new_cluster.1)
galera_recovery.1 galera_new_cluster.1 tokuft_logdump.1)
SET(MAN8_SERVER mysqld.8)
SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1
......@@ -34,7 +34,7 @@ SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysql_plugin.1)
SET(MAN1_DEVEL mysql_config.1)
SET(MAN1_TEST mysql-stress-test.pl.1 mysql-test-run.pl.1 mysql_client_test.1
mysqltest_embedded.1 mysql_client_test_embedded.1)
mysqltest_embedded.1 mysql_client_test_embedded.1 my_safe_process.1)
INSTALL(FILES ${MAN1_SERVER} DESTINATION ${INSTALL_MANDIR}/man1 COMPONENT ManPagesServer)
INSTALL(FILES ${MAN8_SERVER} DESTINATION ${INSTALL_MANDIR}/man8 COMPONENT ManPagesServer)
......
'\" t
.\"
.TH "\FBMY_SAFE_PROCESS\FR" "1" "29 March 2017" "MariaDB 10\&.1" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
my_safe_process \- Utility program that encapsulates process creation, monitoring and bulletproof process cleanup
.SH DESCRIPTION
Use: safe_process [options to safe_process] -- progname arg1 \.\.\. argn\.
.PP
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
'\" t
.\"
.TH "\FBTOKUFT_LOGPRINT\FR" "1" "27 March 2017" "MariaDB 10\&.1" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH NAME
tokuft_logprint \- Dump the log from stdin to stdout
.SH DESCRIPTION
Use: Dump the log from stdin to stdout\.
.PP
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
# ==== Purpose ====
#
# Grep a file for a pattern, produce a single string out of the
# matching lines, and assert that the string matches a given regular
# expression.
#
# ==== Usage ====
#
# --let $assert_text= TEXT
# --let $assert_file= FILE
# --let $assert_select= REGEX
# [--let $assert_match= REGEX | --let $assert_count= NUMBER]
# [--let $assert_only_after= REGEX]
# --source include/assert_grep.inc
#
# Parameters:
#
# $assert_text
# Text that describes what is being checked. This text is written to
# the query log so it should not contain non-deterministic elements.
#
# $assert_file
# File to search.
#
# $assert_select
# All lines matching this text will be checked.
#
# $assert_match
# The script will find all lines that match $assert_select,
# concatenate them to a long string, and assert that it matches
# $assert_match.
#
# $assert_count
# Instead of asserting that the selected lines match
# $assert_match, assert that there were exactly $assert_count
# matching lines.
#
# $assert_only_after
# Reset all the lines matched and the counter when finding this pattern.
# It is useful for searching things in the mysqld.err log file just
# after the last server restart for example (discarding the log content
# of previous server executions).
if (!$assert_text)
{
--die !!!ERROR IN TEST: you must set $assert_text
}
if (!$assert_file)
{
--die !!!ERROR IN TEST: you must set $assert_file
}
if (!$assert_select)
{
--die !!!ERROR IN TEST: you must set $assert_select
}
if ($assert_match == '')
{
if ($assert_count == '')
{
--die !!!ERROR IN TEST: you must set either $assert_match or $assert_count
}
}
if ($assert_match != '')
{
if ($assert_count != '')
{
--echo assert_text='$assert_text' assert_count='$assert_count'
--die !!!ERROR IN TEST: you must set only one of $assert_match or $assert_count
}
}
--let $include_filename= assert_grep.inc [$assert_text]
--source include/begin_include_file.inc
--let _AG_ASSERT_TEXT= $assert_text
--let _AG_ASSERT_FILE= $assert_file
--let _AG_ASSERT_SELECT= $assert_select
--let _AG_ASSERT_MATCH= $assert_match
--let _AG_ASSERT_COUNT= $assert_count
--let _AG_OUT= `SELECT CONCAT('$MYSQLTEST_VARDIR/tmp/_ag_', UUID())`
--let _AG_ASSERT_ONLY_AFTER= $assert_only_after
--perl
use strict;
use warnings;
my $file= $ENV{'_AG_ASSERT_FILE'};
my $assert_select= $ENV{'_AG_ASSERT_SELECT'};
my $assert_match= $ENV{'_AG_ASSERT_MATCH'};
my $assert_count= $ENV{'_AG_ASSERT_COUNT'};
my $assert_only_after= $ENV{'_AG_ASSERT_ONLY_AFTER'};
my $out= $ENV{'_AG_OUT'};
my $result= '';
my $count= 0;
open(FILE, "$file") or die("Error $? opening $file: $!\n");
while (<FILE>) {
my $line = $_;
if ($assert_only_after && $line =~ /$assert_only_after/) {
$result = "";
$count = 0;
}
if ($line =~ /$assert_select/) {
if ($assert_count ne '') {
$count++;
}
else {
$result .= $line;
}
}
}
close(FILE) or die("Error $? closing $file: $!");
open OUT, "> $out" or die("Error $? opening $out: $!");
if ($assert_count ne '' && ($count != $assert_count)) {
print OUT ($count) or die("Error $? writing $out: $!");
}
elsif ($assert_count eq '' && $result !~ /$assert_match/) {
print OUT ($result) or die("Error $? writing $out: $!");
}
else {
print OUT ("assert_grep.inc ok");
}
close OUT or die("Error $? closing $out: $!");
EOF
--let $_ag_outcome= `SELECT LOAD_FILE('$_AG_OUT')`
if ($_ag_outcome != 'assert_grep.inc ok')
{
--source include/show_rpl_debug_info.inc
--echo include/assert_grep.inc failed!
--echo assert_text: '$assert_text'
--echo assert_file: '$assert_file'
--echo assert_select: '$assert_select'
--echo assert_match: '$assert_match'
--echo assert_count: '$assert_count'
--echo assert_only_after: '$assert_only_after'
if ($assert_match != '')
{
--echo matching lines: '$_ag_outcome'
}
if ($assert_count != '')
{
--echo number of matching lines: $_ag_outcome
}
--die assert_grep.inc failed.
}
--let $include_filename= include/assert_grep.inc [$assert_text]
--source include/end_include_file.inc
# ==== Purpose ====
#
# Check that two or more servers have identical databases; fail if not.
#
# ==== Usage ====
#
# --let $diff_servers= 1 2
# [--let $databases= db1 db2 ...]
# [--let $rpl_debug= 1]
# --source include/diff_servers.inc
# pretty-print header
--let $_ds_info= servers=$diff_servers
if ($databases != '')
{
--let $_ds_info= $_ds_info databases=$databases
}
--let $include_filename= diff_servers.inc [$_ds_info]
--source include/begin_include_file.inc
# get databases
--let $_ds_databases= $diff_database
if ($_ds_databases == '')
{
--let $_ds_databases= `SELECT GROUP_CONCAT(SCHEMA_NAME SEPARATOR ' ') FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('information_schema', 'mtr', 'mysql', 'performance_schema')`
}
# generate command line
--let $_ds_arg= --defaults-group-suffix=.
--let $_ds_number_pos= `SELECT LOCATE('$_ds_arg', '$MYSQL_DUMP') + LENGTH('$_ds_arg')`
--let $_ds_pre_command= `SELECT SUBSTR('$MYSQL_DUMP', 1, $_ds_number_pos - 1)`
--let $_ds_post_command= `SELECT SUBSTR('$MYSQL_DUMP', $_ds_number_pos + 1)`
--let $_ds_post_command= $_ds_post_command --compact --order-by-primary --skip-extended-insert --no-create-info --databases $_ds_databases
--let $_ds_prev_outfile=
# iterate over servers
--let $_ds_servers= $diff_servers
while ($_ds_servers != '')
{
--let $_ds_server_number= `SELECT SUBSTRING_INDEX('$_ds_servers', ' ', 1)`
--let $_ds_servers= `SELECT TRIM(SUBSTRING('$_ds_servers', 1 + LENGTH('_$ds_server_number')))`
--let $_ds_outfile= $MYSQLTEST_VARDIR/tmp/diff_servers_$_ds_server_number
if ($rpl_debug)
{
--echo generating dump from server '$_ds_server_number' using command '$_ds_pre_command$_ds_server_number $_ds_post_command > $_ds_outfile'
--echo remaining servers: '$_ds_servers'
}
--exec $_ds_pre_command$_ds_server_number $_ds_post_command > $_ds_outfile
if ($_ds_prev_outfile != '')
{
if ($rpl_debug)
{
--echo diffing files '$_ds_prev_outfile' and '$_ds_outfile'
}
--diff_files $_ds_prev_outfile $_ds_outfile
--remove_file $_ds_prev_outfile
}
--let $_ds_prev_outfile= $_ds_outfile
}
--remove_file $_ds_prev_outfile
--let $include_filename= diff_servers.inc [servers=$_ds_info]
--source include/end_include_file.inc
let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON';
--source include/wait_condition.inc
......@@ -109,7 +109,7 @@ DROP DATABASE hotcopy_save;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--error 1
--error 1,9,11,110,2304,255
--exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
--exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save
......
......@@ -36,3 +36,25 @@ galera_sst_xtrabackup-v2 : MDEV-11208
galera_sst_xtrabackup-v2_encrypt_with_key : MDEV-11208
mysql-wsrep#33 : TODO: investigate
galera_var_innodb_disallow_writes : MDEV-10949
MW-258 : MDEV-11229
galera_as_master : MDEV-11229
MW-44 : MDEV-11229
galera_gcs_fc_limit : MDEV-11229
galera_roles : MDEV-11229
galera_lock_table : MDEV-11229
GAL-480 : Investigate
galera_fk_no_pk :Investigate
galera_account_management : Investigate
galera.galera_var_retry_autocommit : MDEV-12319 #Sparodic Faliure
galera.galera_gcs_fc_limit : MDEV-12319 #Sparodic Faliure
galera.galera_toi_ddl_nonconflicting : MDEV-12319 #Sparodic Faliure
galera.mysql-wsrep#198 : MDEV-12319 #Sparodic Faliure
galera.galera_pc_ignore_sb : MDEV-12319 #Sparodic Faliure
galera.MW-329 : MDEV-12319 #Sparodic Faliure
galera.galera_ist_recv_bind : MDEV-12319 #Failed to start mysqld
galera.galera_ist_restart_joiner : MDEV-12319 #Failed to start mysqld
galera.galera_ssl_compression : MDEV-12319 #Failed to start mysqld
galera.galera_wan : MDEV-12319 #Failed to start mysqld
galera.rpl_row_annotate : MDEV-12319 #Failed to start mysqld
galera_restart_on_unknown_option : Solve
galera_kill_applier : Investigate; problem introduced in merge from 10.1
......@@ -25,7 +25,14 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
......
#
# Let's understand the topology.
# * Independent Master with server-id = 1
# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3
# node#1 act as slave to Independent Master with server-id = 1
# * Independent Slave with server-id = 4 replicating from galera node#2
#
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
log-slave-updates
log-bin=mysqld-bin
binlog-format=row
gtid-mode=on
enforce-gtid-consistency=true
[mysqld.1]
server-id=1
[mysqld.2]
server-id=2
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.3]
server-id=3
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.4]
server-id=4
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_MYPORT_4= @mysqld.4.port
NODE_MYSOCK_4= @mysqld.4.socket
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
#
# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave
#
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld]
default-storage-engine=InnoDB
[mysqld.1]
server-id=1
binlog-format=row
log-bin=mysqld-bin
log_slave_updates
gtid-mode=on
enforce-gtid-consistency=true
event-scheduler=1
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
wsrep_provider_options='base_port=@mysqld.1.#galera_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.2]
server-id=2
binlog-format=row
log-bin=mysqld-bin
log_slave_updates
gtid-mode=on
enforce-gtid-consistency=true
event-scheduler=1
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 7
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
# Required for Galera
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=2
[mysqld.3]
server-id=3
replicate-ignore-db=test
replicate-wild-ignore-table=test.%
log-bin=mysqld-bin
log_slave_updates
gtid-mode=on
enforce-gtid-consistency=true
event-scheduler=1
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
connection node_2;
SET @@global.wsrep_desync = 1;
SET SESSION wsrep_dirty_reads=1;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
connection node_2;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SET @@global.wsrep_desync = 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(1) DEFAULT NULL,
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
SET SESSION wsrep_sync_wait = 0;
Killing server ...
SET SESSION wsrep_sync_wait = 0;
Killing server ...
CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB;
FLUSH TABLE t1 FOR EXPORT;
UNLOCK TABLES;
ALTER TABLE t1 DROP COLUMN f1;
SET SESSION wsrep_osu_method='RSU';
ALTER TABLE t1 ADD COLUMN f1 CHAR(10);
ALTER TABLE t1 DROP COLUMN f1;
ALTER TABLE t1 ADD COLUMN f2 CHAR(10);
ALTER TABLE t1 DROP COLUMN f2;
ALTER TABLE t1 ADD COLUMN f3 CHAR(10);
ALTER TABLE t1 DROP COLUMN f3;
ALTER TABLE t1 ADD COLUMN f4 CHAR(10);
ALTER TABLE t1 DROP COLUMN f4;
ALTER TABLE t1 ADD COLUMN f5 CHAR(10);
ALTER TABLE t1 DROP COLUMN f5;
ALTER TABLE t1 ADD COLUMN f6 CHAR(10);
ALTER TABLE t1 DROP COLUMN f6;
ALTER TABLE t1 ADD COLUMN f7 CHAR(10);
ALTER TABLE t1 DROP COLUMN f7;
ALTER TABLE t1 ADD COLUMN f8 CHAR(10);
ALTER TABLE t1 DROP COLUMN f8;
ALTER TABLE t1 ADD COLUMN f9 CHAR(10);
ALTER TABLE t1 DROP COLUMN f9;
ALTER TABLE t1 ADD COLUMN f10 CHAR(10);
ALTER TABLE t1 DROP COLUMN f10;
ALTER TABLE t1 ADD COLUMN f11 CHAR(10);
ALTER TABLE t1 DROP COLUMN f11;
ALTER TABLE t1 ADD COLUMN f12 CHAR(10);
ALTER TABLE t1 DROP COLUMN f12;
ALTER TABLE t1 ADD COLUMN f13 CHAR(10);
ALTER TABLE t1 DROP COLUMN f13;
ALTER TABLE t1 ADD COLUMN f14 CHAR(10);
ALTER TABLE t1 DROP COLUMN f14;
ALTER TABLE t1 ADD COLUMN f15 CHAR(10);
ALTER TABLE t1 DROP COLUMN f15;
ALTER TABLE t1 ADD COLUMN f16 CHAR(10);
ALTER TABLE t1 DROP COLUMN f16;
SET SESSION wsrep_osu_method='TOI';
DROP TABLE t1;
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%';
INSERT INTO t1 SELECT * FROM t1;
ERROR HY000: wsrep_max_ws_rows exceeded
START TRANSACTION;
INSERT INTO t1 (f1) VALUES (1);
INSERT INTO t1 (f1) VALUES (2),(3),(4);
ERROR HY000: wsrep_max_ws_rows exceeded
ROLLBACK;
START TRANSACTION;
DELETE FROM t1;
ERROR HY000: wsrep_max_ws_rows exceeded
DROP TABLE t1;
SET GLOBAL wsrep_max_ws_rows = 0;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 0;
have_successes
1
have_deadlocks
1
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 0;
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 10000;
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE t2 (i INT) ENGINE = InnoDB;
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
i
1
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;;
connection node_1;
DELETE FROM t1 WHERE i = 1;
COMMIT;
connection node_1a;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1, t2;
create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
insert into t1 values (1,0);
insert into t2 values (2,0);
set autocommit=off;
start transaction;
update t1 set j=1 where i=1;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
set autocommit=off;
start transaction;
begin;
update t2 set j=1 where i=2;
connection node_1;
insert into t1 select * from t2;;
connection node_1a;
insert into t2 select * from t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
DROP TABLE t1, t2;
CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1),(65535);
FLUSH STATUS;
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
VARIABLE_VALUE = 0
1
CREATE PROCEDURE proc_insert ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 ));
END WHILE;
END|
CALL proc_insert();;
SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
VARIABLE_VALUE > 0
1
DROP PROCEDURE proc_insert;
DROP TABLE t1;
connection node_1;
SAVEPOINT in a stored function should be forbidden
CREATE FUNCTION f1 () RETURNS INT BEGIN
SAVEPOINT s;
RETURN 1;
END|
SELECT f1();
f1()
1
DROP FUNCTION f1;
ROLLBACK TO SAVEPOINT in a stored function should be forbidden
CREATE FUNCTION f2 () RETURNS INT BEGIN
ROLLBACK TO SAVEPOINT s;
RETURN 1;
END|
BEGIN;
SAVEPOINT s;
SELECT f2();
ERROR 42000: SAVEPOINT s does not exist
COMMIT;
DROP FUNCTION f2;
BEGIN;
SAVEPOINT S;
ROLLBACK TO SAVEPOINT S;
COMMIT;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 values (110), (111), (112), (113), (114);
Direct SAVEPOINT in a trigger should be forbidden
connection node_2;
CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
connection node_1;
INSERT INTO t1 VALUES (1);
DROP TRIGGER i1_t1;
CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
INSERT INTO t1 VALUES (2);
DROP TRIGGER i2_t1;
INSERT INTO t1 VALUES (3);
CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
UPDATE t1 SET a=4 WHERE a=3;
DROP TRIGGER u1_t1;
CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
UPDATE t1 SET a=4 WHERE a=3;
DROP TRIGGER u2_t1;
CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
DELETE FROM t1;
DROP TRIGGER d1_t1;
CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
DELETE FROM t1;
DROP TRIGGER d1_t1;
SAVEPOINT in a compound statement in a trigger should be forbidden
CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
SAVEPOINT s;
END|
INSERT INTO t1 VALUES (5);
DROP TRIGGER i3_t1;
SAVEPOINT in a PS call in a trigger should be forbidden
CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
PREPARE set_savepoint FROM "SAVEPOINT s";
EXECUTE set_savepoint;
DEALLOCATE PREPARE set_savepoint;
END|
ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
connection node_2;
SAVEPOINT in SP called from a trigger should be forbidden
CREATE PROCEDURE p1() BEGIN
SAVEPOINT s;
END|
connection node_1;
CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
INSERT INTO t1 VALUES (6);
DROP TRIGGER i5_t1;
SAVEPOINT in a SP called from a PS called from a trigger be forbidden
PREPARE call_p1 FROM "CALL p1";
CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
SAVEPOINT in a function called from a trigger should be forbidden
CREATE FUNCTION f1 () RETURNS INT BEGIN
SAVEPOINT s;
RETURN 1;
END|
CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
INSERT INTO t1 VALUES (7);
DROP TRIGGER i7_t1;
SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
CREATE PROCEDURE p2() BEGIN
CALL p1();
END|
CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
INSERT INTO t1 VALUES (8);
DROP TRIGGER i8_t1;
SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
CREATE PROCEDURE p3() BEGIN
INSERT INTO t1 VALUES (9);
END|
CALL p3();
DROP TRIGGER i9_t1;
ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
BEGIN;
SAVEPOINT s;
INSERT INTO t1 VALUES (5);
ERROR 42000: SAVEPOINT s does not exist
COMMIT;
DROP TRIGGER i4_t1;
ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
CREATE PROCEDURE p4() BEGIN
ROLLBACK TO SAVEPOINT s;
END|
CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
BEGIN;
SAVEPOINT s;
INSERT INTO t1 VALUES (6);
ERROR 42000: SAVEPOINT s does not exist
COMMIT;
DROP TRIGGER i5_t1;
SAVEPOINT in a SP next to a trigger should work
CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
CREATE PROCEDURE p5() BEGIN
SAVEPOINT s;
INSERT INTO t1 VALUES (10);
ROLLBACK TO SAVEPOINT s;
END|
BEGIN;
CALL p5();
COMMIT;
DROP TRIGGER i6_t1;
connection node_2;
create trigger t1 before insert on t1 for each row
begin
insert into t2 values (NULL);
end|
connection node_1;
INSERT INTO t1 VALUES (201), (202), (203);
connection node_1;
SELECT * FROM t1;
a
5
6
7
8
9
201
202
203
SELECT COUNT(*) FROM t2;
COUNT(*)
3
connection node_2;
SELECT * FROM t1;
a
5
6
7
8
9
201
202
203
SELECT COUNT(*) FROM t2;
COUNT(*)
3
connection node_1;
DEALLOCATE PREPARE call_p1;
connection node_2;
DROP TABLE t1, t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
DROP PROCEDURE p4;
DROP PROCEDURE p5;
DROP FUNCTION f1;
......@@ -5,6 +5,15 @@ SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
COUNT(*) = 2
1
connection node_1;
ALTER USER user1 PASSWORD EXPIRE;
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
password_expired = 'Y'
1
connection node_2;
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
password_expired = 'Y'
1
connection node_1;
RENAME USER user2 TO user3;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
......
DROP TABLE IF EXISTS t1, t2;
DROP TABLE IF EXISTS x1, x2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
connection node_2;
# ANALYZE test
connection node_2;
connection node_1;
ANALYZE TABLE t1, t2;
Table Op Msg_type Msg_text
test.t1 analyze status OK
test.t2 analyze status OK
connection node_2;
# OPTIMIZE test
connection node_2;
connection node_1;
OPTIMIZE TABLE t1, t2;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
test.t2 optimize status OK
connection node_2;
# REPAIR test
connection node_2;
connection node_1;
REPAIR TABLE x1, x2;
Table Op Msg_type Msg_text
test.x1 repair status OK
test.x2 repair status OK
connection node_2;
connection node_2;
SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10 FROM x1;
COUNT(*) = 10
1
SELECT COUNT(*) = 10000 FROM t2;
COUNT(*) = 10000
1
SELECT COUNT(*) = 10 FROM x2;
COUNT(*) = 10
1
connection node_1;
DROP TABLE t1, t2;
DROP TABLE x1, x2;
SET GLOBAL wsrep_replicate_myisam = FALSE;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (1,'node_2');
INSERT INTO t1 VALUES (1,'node_1');
INSERT INTO t1 VALUES (2, 'node_2');
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
......
......@@ -50,7 +50,7 @@ WSREP_SST_DONOR
WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync
WSREP_SYNC_WAIT 7
<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992;
<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <RECV_Q_HARD_LIMIT>;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; socket.recv_buf_size = 212992;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
......
connection node_1;
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
SET GLOBAL wsrep_desync = 1;
show status like 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 1
SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
connection node_1a;
SET GLOBAL wsrep_desync = 1;
Warnings:
Warning 1231 'wsrep_desync' is already ON.
show status like 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 1
SET DEBUG_SYNC='now WAIT_FOR alter1';
SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
connection node_1;
connection node_1a;
connection node_1;
SET DEBUG_SYNC='RESET';
SET GLOBAL wsrep_desync = 0;
show status like 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SET GLOBAL wsrep_desync = 0;
Warnings:
Warning 1231 'wsrep_desync' is already OFF.
show status like 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
show status like 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SET GLOBAL wsrep_desync = 0;
Warnings:
Warning 1231 'wsrep_desync' is already OFF.
SELECT COUNT(*) FROM t1;
COUNT(*)
1000
SELECT COUNT(*) FROM t2;
COUNT(*)
1000
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE ten;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
INSERT INTO t1 VALUES (2);
Killing server ...
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
INSERT INTO t1 VALUES (3);
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
include/diff_servers.inc [servers=1 2]
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve]
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
DROP TABLE t1;
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
Killing server ...
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
include/diff_servers.inc [servers=1 2]
DROP TABLE t1;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [IST first seqno 2 not found from cache, falling back to SST]
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE PROCEDURE insert_simple ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef');
END WHILE;
END|
CREATE PROCEDURE insert_multi ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
END WHILE;
END|
CREATE PROCEDURE insert_transaction ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
SET AUTOCOMMIT = OFF;
WHILE 1 DO
START TRANSACTION;
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
COMMIT;
END WHILE;
END|
CREATE PROCEDURE update_simple ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = CONCAT(f2,f2);
END WHILE;
END|
CREATE PROCEDURE insert_1k ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024));
END WHILE;
END|
CREATE PROCEDURE insert_1m ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024));
END WHILE;
END|
CREATE PROCEDURE insert_10m ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
END WHILE;
END|
CALL insert_simple();;
CALL insert_multi();;
CALL insert_transaction ();;
CALL update_simple ();;
CALL insert_1k ();;
CALL insert_1m ();;
CALL insert_10m ();;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
Killing server ...
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
ERROR HY000: Lost connection to MySQL server during query
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
include/diff_servers.inc [servers=1 2]
DROP TABLE t1;
DROP TABLE ten;
DROP PROCEDURE insert_simple;
DROP PROCEDURE insert_multi;
DROP PROCEDURE insert_transaction;
DROP PROCEDURE update_simple;
DROP PROCEDURE insert_1k;
DROP PROCEDURE insert_1m;
CALL mtr.add_suppression("conflict state 7 after post commit");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve]
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
connection node_1;
connection node_2;
SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
COUNT(*) = 900
SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
COUNT(*) = 100
1
connection node_1;
SET AUTOCOMMIT=OFF;
......@@ -9,8 +9,8 @@ START TRANSACTION;
COMMIT;
connection node_2;
CREATE TABLE sum_table (f1 INTEGER);
SELECT SUM(f1) = 900 FROM sum_table;
SUM(f1) = 900
SELECT SUM(f1) = 100 FROM sum_table;
SUM(f1) = 100
1
connection node_1;
SET AUTOCOMMIT=OFF;
......@@ -18,11 +18,12 @@ START TRANSACTION;
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t900 SET f1 = 3;
UPDATE t100 SET f1 = 3;
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
include/diff_servers.inc [servers=1 2]
DROP SCHEMA test;
CREATE SCHEMA test;
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
SELECT * FROM t1;
f1 f2
1 a
2 a
3 a
Shutting down server ...
UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
SELECT * FROM t1;
f1 f2
1 a
2 b
3 c
Starting server ...
Starting server ...
SELECT * FROM t1;
f1 f2
1 a
2 b
3 c
Shutting down server ...
UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
SELECT * FROM t1;
f1 f2
1 a
2 d
3 d
Starting server ...
Starting server ...
SELECT * FROM t1;
f1 f2
1 a
2 d
3 d
DROP TABLE t1;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY AUTO_INCREMENT,
parent_id INT
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1);
INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;;
UPDATE parent SET id = 2 WHERE id = 1;;
SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
COUNT(*) = 10000
1
SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
COUNT(*) = 10000
1
DROP TABLE child;
DROP TABLE parent;
DROP TABLE ten;
connection node_1;
CREATE DATABASE database1;
USE database1;
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) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
SET SESSION wsrep_retry_autocommit = 0;
INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
connection node_1a;
USE database1;
SET SESSION wsrep_retry_autocommit = 0;
INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
connection node_2;
DROP DATABASE database1;;
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1a;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
connection node_1;
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
COUNT(*) = 0
1
USE database1;
ERROR 42000: Unknown database 'database1'
connection node_2;
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
COUNT(*) = 0
1
USE database1;
ERROR 42000: Unknown database 'database1'
connection node_1;
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) ENGINE=InnoDB;
connection node_2;
SET SESSION wsrep_retry_autocommit = 0;
INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
connection node_1;
TRUNCATE TABLE t1;;
connection node_1;
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
DROP TABLE t1;
DROP TABLE ten;
......@@ -43,6 +43,7 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
disconnect node_2;
disconnect node_1;
# End of test
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5);
SET SESSION wsrep_retry_autocommit = 0;
INSERT INTO t1 (f1) VALUES (1),(2);;
TRUNCATE TABLE t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET SESSION wsrep_retry_autocommit = 1;
INSERT INTO t1 (f1) VALUES (3),(4);;
TRUNCATE TABLE t1;
SELECT * FROM test.t1;
f1 f2
3 0
4 0
CREATE PROCEDURE repeated_truncate ()
BEGIN
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET i = 0;
WHILE i <= 1000 DO
TRUNCATE TABLE t1;
SET i = i + 1;
END WHILE;
END|
CALL repeated_truncate();
SET SESSION wsrep_retry_autocommit = 1;
INSERT INTO t1 (f1) VALUES (5),(6);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET SESSION wsrep_retry_autocommit = 1024;
INSERT INTO t1 (f1) VALUES (7),(8);;
include/diff_servers.inc [servers=1 2]
DROP TABLE t1;
DROP PROCEDURE repeated_truncate;
CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread.");
connection node_1;
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
......
CREATE TABLE t1 (
f1 VARCHAR(255) PRIMARY KEY
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('abc');
connection node_2;
SELECT f1 = 'abc' FROM t1;
f1 = 'abc'
1
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'klm';
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'xyz';
connection node_1;
COMMIT;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
include/assert_grep.inc [cluster conflict due to high priority abort for threads]
DROP TABLE t1;
call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
call mtr.add_suppression("WSREP\: Set options returned 7");
SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
ERROR HY000: Incorrect arguments to SET
Unhandled exceptions: 0
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
FLUSH TABLES t1 FOR EXPORT;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
connection node_2;
UNLOCK TABLES;
### t1 should have column f2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`f2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * from t1;
id f2
1 NULL
2 3
connection node_1;
DROP TABLE t1;
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
FLUSH TABLE WITH READ LOCK;
### This shouldn't block.
FLUSH TABLES t1 FOR EXPORT;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
connection node_2;
UNLOCK TABLES;
### t1 should have column f2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`f2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection node_1;
INSERT INTO t1 VALUES (2,3);
connection node_2;
SELECT * from t1;
id f2
1 NULL
2 3
connection node_1;
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
FLUSH TABLE WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
connection node_2a;
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
FLUSH TABLES t1 WITH READ LOCK;;
connection node_2;
UNLOCK TABLES;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
connection node_2a;
UNLOCK TABLES;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`f2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * from t1;
id f2
1 NULL
2 3
connection node_1;
DROP TABLE t1;
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
FLUSH TABLES t1 WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
connection node_2;
UNLOCK TABLES;
### t1 should have column f2
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`f2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT * from t1;
id f2
1 NULL
2 3
connection node_1;
DROP TABLE t1;
connection node_1;
set GLOBAL wsrep_slave_threads=26;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 (f1) SELECT * from t1 as x1;
connection node_2;
set GLOBAL wsrep_slave_threads=16;
SET GLOBAL wsrep_provider='none';
INSERT INTO t1 VALUES (2);
connection node_1;
INSERT INTO t1 VALUES (3);
connection node_2;
INSERT INTO t1 VALUES (4);
set GLOBAL wsrep_slave_threads=5;
SELECT COUNT(*) = 5 FROM t1;
COUNT(*) = 5
1
connection node_1;
set GLOBAL wsrep_slave_threads=12;
SELECT COUNT(*) = 4 FROM t1;
COUNT(*) = 4
1
INSERT INTO t1 VALUES (100), (101), (102);
connection node_2;
set GLOBAL wsrep_slave_threads=5;
INSERT INTO t1 (f1) SELECT * from t1 as x1;
show global variables like 'wsrep_slave_threads';
Variable_name Value
wsrep_slave_threads 5
SET GLOBAL wsrep_slave_threads = 1;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
connection node_1;
SELECT COUNT(*) FROM t1;
COUNT(*)
15
show global variables like 'wsrep_slave_threads';
Variable_name Value
wsrep_slave_threads 12
SET GLOBAL wsrep_slave_threads = 1;
DROP TABLE t1;
# This tests proper desync counter cleanup when DONOR/DESYNC state is cleared.
--source include/galera_cluster.inc
--source include/have_innodb.inc
# Make node 1 tolerate split-brain
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
# Desync and disconnect node 2 from the PC:
--connection node_2
SET @@global.wsrep_desync = 1;
SET SESSION wsrep_dirty_reads=1;
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
# Wait until node 2 disappears from the PC:
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
# Modify app state to force node 2 into PRIMARY upon reconnection.
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
# Reconnect node 2 to the PC:
--connection node_2
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
# Must return 0:
SHOW STATUS LIKE 'wsrep_desync_count';
# Resync node_2, should pass:
SET @@global.wsrep_desync = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--source include/wait_condition.inc
SHOW CREATE TABLE t1;
DROP TABLE t1;
CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
#
# GAL-419 safe_to_bootstrap: boostrap using wsrep_cluster_address=gcomm:// not prevented
#
--source include/galera_cluster.inc
--source include/big_test.inc
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--connection node_1
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--sleep 2
# Node #1 has wsrep_cluster_address=gcomm:// in my.cnf, so should fail to bootstrap
--error 1
--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf | grep 'This node is not safe to bootstrap the cluster'
# Unless we remove grastate.dat
--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--connection node_1
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
--connection node_2
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
--source include/galera_cluster.inc
--connection node_1
CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB;
FLUSH TABLE t1 FOR EXPORT;
UNLOCK TABLES;
ALTER TABLE t1 DROP COLUMN f1;
SET SESSION wsrep_osu_method='RSU';
ALTER TABLE t1 ADD COLUMN f1 CHAR(10);
ALTER TABLE t1 DROP COLUMN f1;
ALTER TABLE t1 ADD COLUMN f2 CHAR(10);
ALTER TABLE t1 DROP COLUMN f2;
ALTER TABLE t1 ADD COLUMN f3 CHAR(10);
ALTER TABLE t1 DROP COLUMN f3;
ALTER TABLE t1 ADD COLUMN f4 CHAR(10);
ALTER TABLE t1 DROP COLUMN f4;
ALTER TABLE t1 ADD COLUMN f5 CHAR(10);
ALTER TABLE t1 DROP COLUMN f5;
ALTER TABLE t1 ADD COLUMN f6 CHAR(10);
ALTER TABLE t1 DROP COLUMN f6;
ALTER TABLE t1 ADD COLUMN f7 CHAR(10);
ALTER TABLE t1 DROP COLUMN f7;
ALTER TABLE t1 ADD COLUMN f8 CHAR(10);
ALTER TABLE t1 DROP COLUMN f8;
ALTER TABLE t1 ADD COLUMN f9 CHAR(10);
ALTER TABLE t1 DROP COLUMN f9;
ALTER TABLE t1 ADD COLUMN f10 CHAR(10);
ALTER TABLE t1 DROP COLUMN f10;
ALTER TABLE t1 ADD COLUMN f11 CHAR(10);
ALTER TABLE t1 DROP COLUMN f11;
ALTER TABLE t1 ADD COLUMN f12 CHAR(10);
ALTER TABLE t1 DROP COLUMN f12;
ALTER TABLE t1 ADD COLUMN f13 CHAR(10);
ALTER TABLE t1 DROP COLUMN f13;
ALTER TABLE t1 ADD COLUMN f14 CHAR(10);
ALTER TABLE t1 DROP COLUMN f14;
ALTER TABLE t1 ADD COLUMN f15 CHAR(10);
ALTER TABLE t1 DROP COLUMN f15;
ALTER TABLE t1 ADD COLUMN f16 CHAR(10);
ALTER TABLE t1 DROP COLUMN f16;
SET SESSION wsrep_osu_method='TOI';
DROP TABLE t1;
......@@ -34,7 +34,7 @@ UNLOCK TABLES;
--connection node_1
--echo value after RSU:
--sleep 2
--sleep 3
SHOW STATUS LIKE 'wsrep_desync_count';
SHOW VARIABLES LIKE 'wsrep_desync';
SET GLOBAL wsrep_desync=0;
......
#
# MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_binlog_format_row.inc
# No error expected for SELECT and SHOW
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
# Error expected for DML
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 SELECT * FROM t1;
START TRANSACTION;
INSERT INTO t1 (f1) VALUES (1);
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f1) VALUES (2),(3),(4);
ROLLBACK;
START TRANSACTION;
--error ER_ERROR_DURING_COMMIT
DELETE FROM t1;
DROP TABLE t1;
SET GLOBAL wsrep_max_ws_rows = 0;
#
# Cleanup for MW-328 tests
#
--connection node_1
--disable_query_log
--eval KILL CONNECTION $sp_connection_id
--enable_query_log
--connection node_1X
--error 2013,1317
--reap
--connection node_1
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
#
# Initialization for MW-328 tests
#
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
INSERT INTO t1 (f1) VALUES (1);
CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
#
# Have some random updates going on against t1
#
DELIMITER |;
CREATE PROCEDURE proc_update ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
END WHILE;
END|
DELIMITER ;|
--connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1X
--let $sp_connection_id = `SELECT CONNECTION_ID()`
--send CALL proc_update();
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Attempt to insert into t2 and check if insert actually inserted rows if
# a success was reported.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
--let $count = 100
--let $successes = 0
--let $deadlocks = 0
SET SESSION wsrep_retry_autocommit = 0;
--disable_query_log
while ($count)
{
TRUNCATE TABLE t2;
--error 0,1213
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
if ($mysql_errno != 1213) {
--inc $successes
if (`SELECT COUNT(*) = 0 FROM t2`) {
--die No rows arrived in table t2
}
}
if ($mysql_errno == 1213) {
--inc $deadlocks
}
--dec $count
}
--enable_query_log
#
# Check that the test produced both deadlocks and successes
#
--disable_query_log
--eval SELECT $successes > 0 AS have_successes
--eval SELECT $deadlocks > 0 AS have_deadlocks
--enable_query_log
--source suite/galera/t/MW-328-footer.inc
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Make sure an unrelated SELECT following a BF-aborted query never
# gets the deadlock error
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
--let $count = 100
SET SESSION wsrep_retry_autocommit = 0;
--disable_query_log
while ($count)
{
--error 0,1213
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
--disable_result_log
--error 0
SELECT 1 FROM DUAL;
--enable_result_log
--dec $count
}
--enable_query_log
--source suite/galera/t/MW-328-footer.inc
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Make sure that a high value of wsrep_retry_autocommit
# masks all deadlock errors
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source suite/galera/t/MW-328-header.inc
--connection node_2
--let $count = 100
SET SESSION wsrep_retry_autocommit = 10000;
--disable_query_log
while ($count)
{
--error 0
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
--disable_result_log
--error 0
SELECT 1 FROM DUAL;
--enable_result_log
--dec $count
}
--enable_query_log
--source suite/galera/t/MW-328-footer.inc
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Test that non-Galera deadlock error still behaves as expected
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
CREATE TABLE t2 (i INT) ENGINE = InnoDB;
# Create a deadlock situation
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--send INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;
--connection node_1
--sleep 2
DELETE FROM t1 WHERE i = 1;
COMMIT;
# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement
--connection node_1a
--error ER_LOCK_DEADLOCK
--reap
DROP TABLE t1, t2;
#
# MW-328 Fix unnecessary/silent BF aborts
#
#
# Test that non-Galera deadlock error still behaves as expected (case #2)
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
insert into t1 values (1,0);
insert into t2 values (2,0);
set autocommit=off;
start transaction;
update t1 set j=1 where i=1;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
set autocommit=off;
start transaction;
begin;
update t2 set j=1 where i=2;
--connection node_1
# Hang expected here
--send insert into t1 select * from t2;
--sleep 2
--connection node_1a
--error ER_LOCK_DEADLOCK
insert into t2 select * from t1;
--connection node_1
--reap
DROP TABLE t1, t2;
#
# #MW-329 Fix incorrect affected rows count after replay
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 INTEGER, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
# We start with a populated table
INSERT INTO t1 (f1) VALUES (1),(65535);
# Clear the wsrep_local_replays counter
FLUSH STATUS;
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
#
# Run concurrent INSERTs
#
DELIMITER |;
CREATE PROCEDURE proc_insert ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 ));
END WHILE;
END|
DELIMITER ;|
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1b
--let $connection_id = `SELECT CONNECTION_ID()`
--send CALL proc_insert();
#
# Run concurrent UPDATEs. We expect that each UPDATE will report that
# some rows were matched and updated
#
--connection node_2
--let $count = 10
while ($count)
{
--let $signature = `SELECT LEFT(MD5(RAND()), 10)`
--disable_query_log
--error 0,ER_LOCK_DEADLOCK
--eval UPDATE t1 SET f2 = '$signature'
--enable_query_log
--let $row_count = `SELECT ROW_COUNT()`
if (`SELECT @@error_count = 0`) {
if (`SELECT $row_count = 0`) {
--die ROW_COUNT() = 0
}
}
--dec $count
}
#
# Confirm that some transaction replays occurred
#
SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
#
# Terminate the stored procedure
#
--connection node_1
--disable_query_log
--eval KILL CONNECTION $connection_id
--enable_query_log
--connection node_1b
--error 0,2013,1317
--reap
--connection node_1
DROP PROCEDURE proc_insert;
DROP TABLE t1;
# Disable SAVEPOINT and ROLLBACK TO SAVEPOINT in SP, SF, TR.
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
--echo SAVEPOINT in a stored function should be forbidden
--delimiter |
CREATE FUNCTION f1 () RETURNS INT BEGIN
SAVEPOINT s;
RETURN 1;
END|
--delimiter ;
SELECT f1();
DROP FUNCTION f1;
--echo ROLLBACK TO SAVEPOINT in a stored function should be forbidden
--delimiter |
CREATE FUNCTION f2 () RETURNS INT BEGIN
ROLLBACK TO SAVEPOINT s;
RETURN 1;
END|
--delimiter ;
BEGIN;
SAVEPOINT s;
--error ER_SP_DOES_NOT_EXIST
SELECT f2();
COMMIT;
DROP FUNCTION f2;
BEGIN;
SAVEPOINT S;
ROLLBACK TO SAVEPOINT S;
COMMIT;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 values (110), (111), (112), (113), (114);
--echo Direct SAVEPOINT in a trigger should be forbidden
--connection node_2
CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
--connection node_1
INSERT INTO t1 VALUES (1);
DROP TRIGGER i1_t1;
CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
INSERT INTO t1 VALUES (2);
DROP TRIGGER i2_t1;
INSERT INTO t1 VALUES (3);
CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
UPDATE t1 SET a=4 WHERE a=3;
DROP TRIGGER u1_t1;
CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
UPDATE t1 SET a=4 WHERE a=3;
DROP TRIGGER u2_t1;
CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
DELETE FROM t1;
DROP TRIGGER d1_t1;
CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
DELETE FROM t1;
DROP TRIGGER d1_t1;
--echo SAVEPOINT in a compound statement in a trigger should be forbidden
--delimiter |
CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
SAVEPOINT s;
END|
--delimiter ;
INSERT INTO t1 VALUES (5);
DROP TRIGGER i3_t1;
--echo SAVEPOINT in a PS call in a trigger should be forbidden
# echo handled by SAVEPOINT forbidden in PS
--delimiter |
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
PREPARE set_savepoint FROM "SAVEPOINT s";
EXECUTE set_savepoint;
DEALLOCATE PREPARE set_savepoint;
END|
--delimiter ;
--connection node_2
--echo SAVEPOINT in SP called from a trigger should be forbidden
--delimiter |
CREATE PROCEDURE p1() BEGIN
SAVEPOINT s;
END|
--delimiter ;
--connection node_1
CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
INSERT INTO t1 VALUES (6);
DROP TRIGGER i5_t1;
--echo SAVEPOINT in a SP called from a PS called from a trigger be forbidden
# echo handled by SAVEPOINT forbidden in PS
PREPARE call_p1 FROM "CALL p1";
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
--echo SAVEPOINT in a function called from a trigger should be forbidden
--delimiter |
CREATE FUNCTION f1 () RETURNS INT BEGIN
SAVEPOINT s;
RETURN 1;
END|
--delimiter ;
CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
INSERT INTO t1 VALUES (7);
DROP TRIGGER i7_t1;
--echo SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
--delimiter |
CREATE PROCEDURE p2() BEGIN
CALL p1();
END|
--delimiter ;
CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
INSERT INTO t1 VALUES (8);
DROP TRIGGER i8_t1;
--echo SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
--delimiter |
CREATE PROCEDURE p3() BEGIN
INSERT INTO t1 VALUES (9);
END|
--delimiter ;
CALL p3();
DROP TRIGGER i9_t1;
--echo ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
# Trigger activation creates a new savepoint level, making the earlier levels
# inaccessible. Thus forbidding SAVEPOINT should be enough as then there is
# no valid savepoint to pass to ROLLBACK TO SAVEPOINT, but we forbid it once
# more just in case.
CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
BEGIN;
SAVEPOINT s;
--error ER_SP_DOES_NOT_EXIST
INSERT INTO t1 VALUES (5);
COMMIT;
DROP TRIGGER i4_t1;
--echo ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
--delimiter |
CREATE PROCEDURE p4() BEGIN
ROLLBACK TO SAVEPOINT s;
END|
--delimiter ;
CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
BEGIN;
SAVEPOINT s;
--error ER_SP_DOES_NOT_EXIST
INSERT INTO t1 VALUES (6);
COMMIT;
DROP TRIGGER i5_t1;
--echo SAVEPOINT in a SP next to a trigger should work
CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
--delimiter |
CREATE PROCEDURE p5() BEGIN
SAVEPOINT s;
INSERT INTO t1 VALUES (10);
ROLLBACK TO SAVEPOINT s;
END|
--delimiter ;
BEGIN;
CALL p5();
COMMIT;
DROP TRIGGER i6_t1;
--connection node_2
delimiter |;
create trigger t1 before insert on t1 for each row
begin
insert into t2 values (NULL);
end|
delimiter ;|
--connection node_1
INSERT INTO t1 VALUES (201), (202), (203);
--connection node_1
SELECT * FROM t1;
SELECT COUNT(*) FROM t2;
--connection node_2
SELECT * FROM t1;
SELECT COUNT(*) FROM t2;
--connection node_1
DEALLOCATE PREPARE call_p1;
--connection node_2
DROP TABLE t1, t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
DROP PROCEDURE p4;
DROP PROCEDURE p5;
DROP FUNCTION f1;
......@@ -24,10 +24,14 @@ SET SESSION wsrep_on = OFF;
SET SESSION wsrep_on = ON;
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
--connection node_1
CALL mtr.add_suppression("Failed to set packet size");
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
--source include/wait_condition.inc
CALL mtr.add_suppression("Failed to set packet size");
......@@ -18,14 +18,12 @@ SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
# ALTER USER
#
# LP bug 1376269
#
#--connection node_1
#ALTER USER user1 PASSWORD EXPIRE;
#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
#
#--connection node_2
#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
--connection node_1
ALTER USER user1 PASSWORD EXPIRE;
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
--connection node_2
SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
#
# RENAME USER
......
#
# Test that various admin commands from sql_admin.cc
# Currently, REPAIR, OPTIMIZE and ANALYZE are tested.
# Jira: PXC-390
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
DROP TABLE IF EXISTS x1, x2;
--enable_warnings
--connection node_1
CREATE TABLE t1 (f1 INTEGER);
CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
# Wait until all the data from t2 has been replicated
--connection node_2
--let $wait_condition = SELECT COUNT(*) = 10 FROM x1;
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 10 FROM x2;
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 10 FROM t1;
--source include/wait_condition.inc
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t2;
--source include/wait_condition.inc
--echo # ANALYZE test
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
ANALYZE TABLE t1, t2;
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
--source include/wait_condition.inc
--echo # OPTIMIZE test
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
OPTIMIZE TABLE t1, t2;
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
--source include/wait_condition.inc
--echo # REPAIR test
--connection node_2
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--connection node_1
REPAIR TABLE x1, x2;
--connection node_2
--let $wait_condition = SELECT VARIABLE_VALUE >= $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
--source include/wait_condition.inc
--connection node_2
SELECT COUNT(*) = 10 FROM t1;
SELECT COUNT(*) = 10 FROM x1;
SELECT COUNT(*) = 10000 FROM t2;
SELECT COUNT(*) = 10 FROM x2;
--connection node_1
DROP TABLE t1, t2;
DROP TABLE x1, x2;
SET GLOBAL wsrep_replicate_myisam = FALSE;
......@@ -5,20 +5,25 @@
# Test a local transaction being aborted by a slave one
#
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_2
--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1,'node_2');
--connection node_1
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (1,'node_1');
--connection node_2a
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'node_1'
--source include/wait_condition.inc
--connection node_2
--error ER_LOCK_DEADLOCK
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (2, 'node_2');
--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
......
#
# Test for overlapped transactions under manual desync.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug_sync.inc
--let $galera_connection_name = node_1a
--let $galera_server_number = 1
--source include/galera_connect.inc
--connection node_1
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
SET GLOBAL wsrep_desync = 1;
show status like 'wsrep_desync_count';
SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
send INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
--connection node_1a
SET GLOBAL wsrep_desync = 1;
show status like 'wsrep_desync_count';
SET DEBUG_SYNC='now WAIT_FOR alter1';
SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
send INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
--connection node_1
reap;
--connection node_1a
reap;
--connection node_1
SET DEBUG_SYNC='RESET';
SET GLOBAL wsrep_desync = 0;
show status like 'wsrep_desync_count';
SET GLOBAL wsrep_desync = 0;
show status like 'wsrep_desync_count';
--disable_query_log
call mtr.add_suppression("Trying to make wsrep_desync = OFF on the node that is already synchronized.");
--enable_query_log
show status like 'wsrep_desync_count';
SET GLOBAL wsrep_desync = 0;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t2;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE ten;
--query_cache_type=1 --query_cache_size=1000000 --userstat=1 --wsrep_replicate_myisam=true
--query_cache_type=1 --query_cache_size=1000000
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true'
#
# Kill entire cluster while gcache.recover=yes. Expect that node #2 will rejoin using IST
#
--source include/galera_cluster.inc
--source include/big_test.inc
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
--connection node_2
--let $wait_condition = SELECT COUNT(*) > 0 FROM t1;
--source include/wait_condition.inc
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
INSERT INTO t1 VALUES (2);
--source include/kill_galera.inc
--sleep 1
--connection node_1
--let $galera_wsrep_recover_server_id=1
--source suite/galera/include/galera_wsrep_recover.inc
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/start_mysqld.inc
INSERT INTO t1 VALUES (3);
--connection node_2
--let $galera_wsrep_recover_server_id=2
--source suite/galera/include/galera_wsrep_recover.inc
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
--connection node_1
--source include/wait_until_connected_again.inc
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--let $diff_servers = 1 2
--source include/diff_servers.inc
--connection node_1
# Warning happens when the cluster is started for the first time
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
# Confirm that IST took place
--let $assert_text = async IST sender starting to serve
--let $assert_select = async IST sender starting to serve
--let $assert_count = 1
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_only_after = starting as process
--source include/assert_grep.inc
--connection node_2
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
# Confirm that gcache recovery took place
--let $assert_text = Recovering GCache ring buffer: found gapless sequence
--let $assert_select = Recovering GCache ring buffer: found gapless sequence
--let $assert_count = 1
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_only_after = starting as process
--source include/assert_grep.inc
DROP TABLE t1;
!include ../galera_2nodes.cnf
[mysqld.1]
max_allowed_packet=10M
innodb_log_file_size=110M
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M'
#
# Attempt gcache recovery on a full gcache. Node will not be able to join via IST due to gcache rollover
#
--source include/galera_cluster.inc
--source include/big_test.inc
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--connection node_1
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
--source include/kill_galera.inc
--connection node_1
--let $galera_wsrep_recover_server_id=1
--source suite/galera/include/galera_wsrep_recover.inc
--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/start_mysqld.inc
--connection node_2
--let $galera_wsrep_recover_server_id=2
--source suite/galera/include/galera_wsrep_recover.inc
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
--connection node_1
--source include/wait_until_connected_again.inc
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--let $diff_servers = 1 2
--source include/diff_servers.inc
--connection node_1
DROP TABLE t1;
# Warning always happens when the cluster is started for the first time
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
# Confirm that IST did not take place
--let $assert_text = IST first seqno 2 not found from cache, falling back to SST
--let $assert_select = IST first seqno 2 not found from cache, falling back to SST
--let $assert_count = 1
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_only_after = starting as process
--source include/assert_grep.inc
--connection node_2
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
!include ../galera_2nodes.cnf
[mysqld.1]
innodb_log_file_size=110M
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
[mysqld.2]
innodb_log_file_size=110M
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
#
# Kill entire cluster while various transactions are in progress
# restore the cluster and expect that node #2 will rejoin using IST
#
--source include/galera_cluster.inc
--source include/big_test.inc
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
DELIMITER |;
CREATE PROCEDURE insert_simple ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef');
END WHILE;
END|
CREATE PROCEDURE insert_multi ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
END WHILE;
END|
CREATE PROCEDURE insert_transaction ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
SET AUTOCOMMIT = OFF;
WHILE 1 DO
START TRANSACTION;
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
INSERT INTO t1 (f1) VALUES (DEFAULT);
COMMIT;
END WHILE;
END|
DELIMITER ;|
DELIMITER |;
CREATE PROCEDURE update_simple ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
UPDATE t1 SET f2 = CONCAT(f2,f2);
END WHILE;
END|
CREATE PROCEDURE insert_1k ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024));
END WHILE;
END|
CREATE PROCEDURE insert_1m ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024));
END WHILE;
END|
CREATE PROCEDURE insert_10m ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET SESSION wsrep_sync_wait = 0;
WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
END WHILE;
END|
DELIMITER ;|
--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_update_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_1k, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_1m, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_1_insert_10m, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1_insert_simple
--send CALL insert_simple();
--connection node_1_insert_multi
--send CALL insert_multi();
--connection node_1_insert_transaction
--send CALL insert_transaction ();
--connection node_1_update_simple
--send CALL update_simple ();
--connection node_1_insert_1k
--send CALL insert_1k ();
--connection node_1_insert_1m
--send CALL insert_1m ();
--connection node_1_insert_10m
--send CALL insert_10m ();
--connection node_2
SET SESSION wsrep_sync_wait = 0;
--source include/kill_galera.inc
--sleep 10
--connection node_1
--source include/kill_galera.inc
--connection node_1_insert_simple
--error 2013
--reap
--connection node_1_insert_multi
--error 2013
--reap
--connection node_1_insert_transaction
--error 2013
--reap
--connection node_1_update_simple
--error 2013
--reap
--connection node_1_insert_1k
--error 2013
--reap
--connection node_1_insert_1m
--error 2013
--reap
--connection node_1_insert_10m
--error 2013
--reap
--connection node_1
--let $galera_wsrep_recover_server_id=1
--source suite/galera/include/galera_wsrep_recover.inc
--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/start_mysqld.inc
--connection node_2
--let $galera_wsrep_recover_server_id=2
--source suite/galera/include/galera_wsrep_recover.inc
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
--connection node_1
--source include/wait_until_connected_again.inc
--source include/galera_wait_ready.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--let $diff_servers = 1 2
--source include/diff_servers.inc
--connection node_1
DROP TABLE t1;
DROP TABLE ten;
DROP PROCEDURE insert_simple;
DROP PROCEDURE insert_multi;
DROP PROCEDURE insert_transaction;
DROP PROCEDURE update_simple;
DROP PROCEDURE insert_1k;
DROP PROCEDURE insert_1m;
--connection node_1
CALL mtr.add_suppression("conflict state 7 after post commit");
# Warning happens when the cluster is started for the first time
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
# Confirm that IST took place
--let $assert_text = async IST sender starting to serve
--let $assert_select = async IST sender starting to serve
--let $assert_count = 1
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $assert_only_after = starting as process
--source include/assert_grep.inc
--connection node_2
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
# Confirm that gcache recovery took place
--let $assert_text = Recovering GCache ring buffer: found gapless sequence
--let $assert_select = Recovering GCache ring buffer: found gapless sequence
--let $assert_count = 1
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_only_after = starting as process
--source include/assert_grep.inc
......@@ -7,18 +7,12 @@ if (!`SELECT @@open_files_limit >= 1024`){
}
#
# This test forces 900 tables with a PK to participate in a single
# transaction. The reason for 900 is that some linux system has by default
# a limit of 1024 open files / process
#
#
# First, create 900 tables and make sure the DDLs are all propagated
# First, create 100 tables and make sure the DDLs are all propagated
#
--connection node_1
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -29,7 +23,7 @@ while ($count)
}
--connection node_2
SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
#
# Second, create a transaction that uses all those tables
......@@ -39,7 +33,7 @@ SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test'
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -58,7 +52,7 @@ COMMIT;
--connection node_2
CREATE TABLE sum_table (f1 INTEGER);
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -68,7 +62,7 @@ while ($count)
--dec $count
}
SELECT SUM(f1) = 900 FROM sum_table;
SELECT SUM(f1) = 100 FROM sum_table;
#
# Fourth, create a deadlock
......@@ -78,7 +72,7 @@ SELECT SUM(f1) = 900 FROM sum_table;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
--let $count = 900
--let $count = 100
while ($count)
{
--disable_query_log
......@@ -91,7 +85,7 @@ while ($count)
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t900 SET f1 = 3;
UPDATE t100 SET f1 = 3;
--connection node_1
COMMIT;
......@@ -100,5 +94,8 @@ COMMIT;
--error ER_LOCK_DEADLOCK
COMMIT;
--let $diff_servers = 1 2
--source include/diff_servers.inc
DROP SCHEMA test;
CREATE SCHEMA test;
--source include/galera_cluster.inc
--source include/have_innodb.inc
# Suppress expected warnings:
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
#
# We should count the number of "Assertion failed" warnings
# in the log file before and after testing. To do this we need
# to save original log file before testing:
#
--let TEST_LOG=$MYSQLTEST_VARDIR/log/mysqld.2.err
--perl
use strict;
my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
my $test_log_copy=$test_log . '.copy';
if (-e $test_log_copy) {
unlink $test_log_copy;
}
EOF
--copy_file $TEST_LOG $TEST_LOG.copy
--connection node_2
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
SELECT * FROM t1;
# Initiate normal shutdown on the node 2 and
# waiting until shutdown has been completed:
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Some updates on node 1:
UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
SELECT * FROM t1;
# Remove the "grastate.dat" file (to initiate new SST)
# and restart node 2 with unknown option:
--connection node_2
--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--let $start_mysqld_params=--galera-unknown-option
--echo Starting server ...
--exec echo "try:$start_mysqld_params" > $_expect_file_name
# Sleep to ensure that server exited...
--sleep 30
# Restart node 2 without unknown option:
--let $start_mysqld_params=
--echo Starting server ...
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Sanity check (node 2 is running now and can perform SQL operators):
SELECT * FROM t1;
# Initiate normal shutdown on the node 2 and
# waiting until shutdown has been completed:
--echo Shutting down server ...
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Some updates on node 1 - to initiate IST next time:
UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
SELECT * FROM t1;
# Restart node 2 with unknown option:
--connection node_2
--let $start_mysqld_params=--galera-unknown-option
--echo Starting server ...
--exec echo "try:$start_mysqld_params" > $_expect_file_name
# Sleep to ensure that server exited...
--sleep 30
# Restart node 2 without unknown option:
--let $start_mysqld_params=
--echo Starting server ...
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
--source include/wait_condition.inc
# Sanity check (node 2 is running now and can perform SQL operators):
SELECT * FROM t1;
--connection node_1
DROP TABLE t1;
#
# We should count the number of "Assertion failed" warnings
# in the log file during test phase - to print the error message
# if quantity of such warnings in log file increased at the end
# of the test:
#
--perl
use strict;
my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
my $test_log_copy=$test_log . '.copy';
open(FILE, $test_log_copy) or die("Unable to open $test_log_copy: $!\n");
my $initial=grep(/Assertion * failed/gi,<FILE>);
close(FILE);
open(FILE, $test_log) or die("Unable to open $test_log: $!\n");
my $count_warnings=grep(/Assertion * failed/gi,<FILE>);
close(FILE);
if ($count_warnings != $initial) {
my $diff=$count_warnings-$initial;
print "Assertion failed $diff times.\n";
}
EOF
--remove_file $TEST_LOG.copy
......@@ -102,6 +102,7 @@ REVOKE EXECUTE ON PROCEDURE test1.pr1 FROM role1;
--echo # Connect with foo_node_1
--connection foo_node_1
--sleep 1
--error ER_PROCACCESS_DENIED_ERROR
CALL test1.pr1();
......
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
#
# This test creates a new FK constraint while an UPDATE is running
#
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY AUTO_INCREMENT,
parent_id INT
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1);
INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
--connection node_1
--sleep 1
--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;
--connection node_2
--sleep 1
--send UPDATE parent SET id = 2 WHERE id = 1;
--connection node_1
--reap
--connection node_2
--reap
--connection node_2
SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
--connection node_1
SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
DROP TABLE child;
DROP TABLE parent;
DROP TABLE ten;
#
# Test the operation of DDLs that affect multiple database objects
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $galera_connection_name = node_1a
--let $galera_server_number = 1
--source include/galera_connect.inc
--connection node_1
CREATE DATABASE database1;
USE database1;
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) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
# Make sure autocommit retrying does not kick in as this will mask the error we expect to get
SET SESSION wsrep_retry_autocommit = 0;
# Attemp to insert 1M rows
--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
--connection node_1a
USE database1;
SET SESSION wsrep_retry_autocommit = 0;
--send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
--connection node_2
--sleep 1
--send DROP DATABASE database1;
--connection node_1
--sleep 1
--error ER_LOCK_DEADLOCK
--reap
--connection node_1a
--error ER_LOCK_DEADLOCK
--reap
--connection node_2
--reap
--connection node_1
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
--error ER_BAD_DB_ERROR
USE database1;
--connection node_2
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
--error ER_BAD_DB_ERROR
USE database1;
#
# Test the operation of TRUNCATE with concurrent DML.
# The DML should be BF-aborted if the DDL arrives from another node
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
#
# INSERT and TRUNCATE on different nodes
#
--connection node_1
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) ENGINE=InnoDB;
# Insert 100K rows
--connection node_2
# Prevent autocommit retring from masking the deadlock error we expect to get
SET SESSION wsrep_retry_autocommit = 0;
--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
--connection node_1
--sleep 1
--send TRUNCATE TABLE t1;
--connection node_1
--reap
--connection node_2
--error ER_LOCK_DEADLOCK
--reap
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
--connection node_1
SELECT COUNT(*) = 0 FROM t1;
DROP TABLE t1;
DROP TABLE ten;
......@@ -69,9 +69,11 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
# Restore original auto_increment_offset values.
--source include/auto_increment_offset_restore.inc
--source include/galera_end.inc
--echo # End of test
#
# Test that the wsrep_retry_autocommit variable is respected. We use an INSERT that
# proceeds very slowly due to extra SLEEP() in a trigger
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5);
#
# With wsrep_retry_autocommit = 0, error is certain
#
--connection node_1
SET SESSION wsrep_retry_autocommit = 0;
--send INSERT INTO t1 (f1) VALUES (1),(2);
--connection node_2
--sleep 1
TRUNCATE TABLE t1;
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
#
# With wsrep_retry_autocommit = 1, success against one TRUNCATE
#
--connection node_1
SET SESSION wsrep_retry_autocommit = 1;
--send INSERT INTO t1 (f1) VALUES (3),(4);
--connection node_2
--sleep 1
TRUNCATE TABLE t1;
--connection node_1
--error 0
--reap
SELECT * FROM test.t1;
#
# With wsrep_retry_autocommit = 1, failure against multiple TRUNCATEs
#
--connection node_2
DELIMITER |;
CREATE PROCEDURE repeated_truncate ()
BEGIN
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
SET i = 0;
WHILE i <= 1000 DO
TRUNCATE TABLE t1;
SET i = i + 1;
END WHILE;
END|
DELIMITER ;|
# Begin streaming TRUNCATEs
--let $truncate_connection_id = `SELECT CONNECTION_ID()`
--send CALL repeated_truncate()
--connection node_1
SET SESSION wsrep_retry_autocommit = 1;
--sleep 1
--error ER_LOCK_DEADLOCK
INSERT INTO t1 (f1) VALUES (5),(6);
#
# With wsrep_retry_autocommit = 1024, success against multiple TRUNCATEs
#
--connection node_1
SET SESSION wsrep_retry_autocommit = 1024;
--send INSERT INTO t1 (f1) VALUES (7),(8);
--sleep 6
# Once he stream of TRUNCATEs is complete
--connection node_2
--reap
# the INSERT will eventually be sucessfull
--connection node_1
--error 0
--reap
--let $diff_servers = 1 2
--source include/diff_servers.inc
DROP TABLE t1;
DROP PROCEDURE repeated_truncate;
......@@ -6,7 +6,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
CALL mtr.add_suppression("WSREP: Refusing exit for the last slave thread.");
--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads`
--connection node_1
......
#
# Test --wsrep_log_conflicts=ON
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (
f1 VARCHAR(255) PRIMARY KEY
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('abc');
--connection node_2
SELECT f1 = 'abc' FROM t1;
#
# Provoke a conflict
#
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'klm';
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'xyz';
--connection node_1
COMMIT;
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_2a
--let $wait_condition = SELECT f1 = 'klm' FROM t1;
--source include/wait_condition.inc
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
#
# We can not really check the log output very much because it is quite variable
#
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
--let $assert_only_after = CURRENT_TEST
--let $assert_text = cluster conflict due to high priority abort for threads
--let $assert_select = cluster conflict due to high priority abort for threads
--let $assert_match = cluster conflict due to high priority abort for threads
--source include/assert_grep.inc
DROP TABLE t1;
#
# PXC-318: Typo in wsrep_provider_options causes an unhandled exception
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err
--disable_info
call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
call mtr.add_suppression("WSREP\: Set options returned 7");
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
# Search for unhandled exception message.
perl;
use strict;
my $logf= $ENV{'LOGF'} or die "LOGF not set";
open(FILE, "$logf") or die("Unable to open $logf: $!\n");
my $count_warnings=grep(/terminate called after throwing an instance of /gi,<FILE>);
print "Unhandled exceptions: $count_warnings\n";
close(FILE);
EOF
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
FLUSH TABLES t1 FOR EXPORT;
--connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
--connection node_2
UNLOCK TABLES;
--echo ### t1 should have column f2
SHOW CREATE TABLE t1;
SELECT * from t1;
--connection node_1
DROP TABLE t1;
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
FLUSH TABLE WITH READ LOCK;
--echo ### This shouldn't block.
FLUSH TABLES t1 FOR EXPORT;
--connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
--connection node_2
UNLOCK TABLES;
--echo ### t1 should have column f2
SHOW CREATE TABLE t1;
--connection node_1
INSERT INTO t1 VALUES (2,3);
--connection node_2
SELECT * from t1;
--connection node_1
DROP TABLE t1;
#
# Test Flush tables with read lock along with
# flush tables <table> with read lock for compatibility.
# Also, making sure all DDL and DMLs are propagated
# after provider is unpaused
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $galera_connection_name = node_2a
--let $galera_server_number = 2
--source include/galera_connect.inc
--connection node_1
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
FLUSH TABLE WITH READ LOCK;
--connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
--connection node_2a
SET session wsrep_sync_wait=0;
SET session wsrep_causal_reads=OFF;
SHOW CREATE TABLE t1;
--sleep 1
--send FLUSH TABLES t1 WITH READ LOCK;
--connection node_2
# let the flush table wait in pause state before we unlock
# table otherwise there is window where-in flush table is
# yet to wait in pause and unlock allows alter table to proceed.
# this is because send in asynchronous.
--sleep 3
# this will release existing lock but will not resume
# the cluster as there is new FTRL that is still pausing it.
UNLOCK TABLES;
SHOW CREATE TABLE t1;
--connection node_2a
--reap
UNLOCK TABLES;
--sleep 1
SHOW CREATE TABLE t1;
SELECT * from t1;
--connection node_1
DROP TABLE t1;
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--connection node_2
FLUSH TABLES t1 WITH READ LOCK;
--connection node_1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2,3);
--sleep 2
--connection node_2
UNLOCK TABLES;
--echo ### t1 should have column f2
SHOW CREATE TABLE t1;
SELECT * from t1;
--connection node_1
DROP TABLE t1;
#
# PXC-421: Test deadlock involving updates of
# wsrep_provider, wsrep_cluster_address and wsrep_slave_threads.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads`
set GLOBAL wsrep_slave_threads=26;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 (f1) SELECT * from t1 as x1;
--connection node_2
--let $wsrep_slave_2 = `SELECT @@wsrep_slave_threads`
set GLOBAL wsrep_slave_threads=16;
--let $wsrep_provider_orig = `SELECT @@wsrep_provider`
--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
SET GLOBAL wsrep_provider='none';
INSERT INTO t1 VALUES (2);
--connection node_1
INSERT INTO t1 VALUES (3);
--connection node_2
--disable_query_log
--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
--enable_query_log
--source include/wait_until_connected_again.inc
--source include/galera_wait_ready.inc
INSERT INTO t1 VALUES (4);
set GLOBAL wsrep_slave_threads=5;
# Node #2 has all the inserts
SELECT COUNT(*) = 5 FROM t1;
--connection node_1
set GLOBAL wsrep_slave_threads=12;
# Node #1 is missing the insert made while Node #2 was not replicated
SELECT COUNT(*) = 4 FROM t1;
INSERT INTO t1 VALUES (100), (101), (102);
--connection node_2
set GLOBAL wsrep_slave_threads=5;
INSERT INTO t1 (f1) SELECT * from t1 as x1;
show global variables like 'wsrep_slave_threads';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2
SELECT COUNT(*) FROM t1;
--connection node_1
SELECT COUNT(*) FROM t1;
show global variables like 'wsrep_slave_threads';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1
DROP TABLE t1;
......@@ -27,7 +27,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
......@@ -36,7 +38,9 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
......
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 1']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
SET SESSION wsrep_on = OFF;
Killing server ...
safe_to_bootstrap: 1
safe_to_bootstrap: 0
safe_to_bootstrap: 0
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Test the safe_to_bootstrap in grastate.dat
#
--source include/galera_cluster.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
#
# At start, all grastate.dat files have safe_to_boostrap: 0
#
--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0'
--let $assert_select= safe_to_bootstrap: 0
--let $assert_count= 1
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
--source include/assert_grep.inc
#
# Shut down one node
#
--connection node_2
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
# Still, all grastate.dat files should have safe_to_boostrap: 0
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
--source include/assert_grep.inc
#
# Shut down one more node
#
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
--source include/shutdown_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
# Now, nodes 2,3 should have safe_to_boostrap: 0
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
--source include/assert_grep.inc
# But node #1 should have safe_to_boostrap: 1
--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 1'
--let $assert_select= safe_to_bootstrap: 1
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--source include/assert_grep.inc
# Restart one node
--connection node_2
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
# All nodes should be back to 'safe_to_bootstrap: 0'
--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0'
--let $assert_select= safe_to_bootstrap: 0
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--source include/assert_grep.inc
--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
--source include/assert_grep.inc
#
# Kill the cluster
#
--connection node_2
--source include/shutdown_mysqld.inc
--connection node_1
SET SESSION wsrep_on = OFF;
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--source include/kill_galera.inc
#
# Only node #1 should have safe_to_bootstrap: 1
# include/assert_grep.inc requires a running server, so we revert to simple grep
#
--error 0
--exec grep 'safe_to_bootstrap: 1' $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
--error 0
--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
--error 0
--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
#
# Attempt to bootstrap nodes #2, #3, should fail
#
--error 1
--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
--error 1
--exec $MYSQLD --defaults-group-suffix=.3 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
#
# Attempt to bootstrap starting from node #1, should succeed
#
--connection node_1
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
--connection node_2
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
--source include/start_mysqld.inc
--connection node_3
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
--source include/start_mysqld.inc
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
--connection node_2
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
--connection node_3
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
SHOW CREATE TABLE t1;
DROP TABLE t1;
--- suite/innodb/r/innodb-wl5522.result
+++ suite/innodb/r/innodb-wl5522.reject
@@ -580,7 +580,7 @@
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x0)
+ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x0)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
@@ -592,7 +592,7 @@
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x0)
+ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x0)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
@@ -766,7 +766,7 @@
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x1)
+ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x1)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
@@ -778,7 +778,7 @@
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x1)
+ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
@@ -955,7 +955,7 @@
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x21)
+ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x1 and the meta-data file has 0x21)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
@@ -967,7 +967,7 @@
ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x5 and the meta-data file has 0x21)
+ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x0 and the meta-data file has 0x21)
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
......@@ -367,7 +367,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME WSREP_PATCH_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE wsrep_25.16
GLOBAL_VALUE wsrep_25.19
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
......
call mtr.add_suppression("WSREP: MariaDB Galera and flashback do not support binlog format.*");
call mtr.add_suppression("WSREP: MariaDB Galera does not support binlog format");
call mtr.add_suppression("WSREP: Cannot get fake transaction ID from storage engine.");
#
# MDEV-4227: Galera server should stop crashing on setting binlog_format STATEMENT
......
......@@ -8,14 +8,14 @@ connection master;
connection slave;
connection master;
CREATE TABLE t1(i INT) ENGINE = INNODB;
SET @@GLOBAL.wsrep_max_ws_rows = 1;
SET @@GLOBAL.wsrep_max_ws_rows = 2;
INSERT INTO t1 VALUES(1), (2);
connection slave;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
connection slave;
SET @@GLOBAL.wsrep_max_ws_rows = 1;
SET @@GLOBAL.wsrep_max_ws_rows = 2;
connection master;
DELETE FROM t1;
connection slave;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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