summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSujatha Sivakumar <sujatha.sivakumar@oracle.com>2016-05-13 16:42:45 +0530
committerSujatha Sivakumar <sujatha.sivakumar@oracle.com>2016-05-13 16:42:45 +0530
commitdf7ecf64f5b9c6fb4b7789a414306de89b58bec7 (patch)
tree795cd2d820ad193478404efdbd0ae6344d558bc8 /mysql-test
parent818b3a91231119663a95b854ab1e0e2d7a2d3feb (diff)
downloadmariadb-git-df7ecf64f5b9c6fb4b7789a414306de89b58bec7.tar.gz
Bug#23251517: SEMISYNC REPLICATION HANGING
Revert following bug fix: Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE This fix results in a deadlock between slave IO thread and SQL thread.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/assert_grep.inc154
-rw-r--r--mysql-test/include/rpl_init.inc31
-rw-r--r--mysql-test/include/rpl_reconnect.inc33
-rw-r--r--mysql-test/include/start_slave_sql.inc39
-rw-r--r--mysql-test/suite/rpl/r/rpl_io_thd_wait_for_disk_space.result15
-rw-r--r--mysql-test/suite/rpl/t/rpl_io_thd_wait_for_disk_space.test71
6 files changed, 14 insertions, 329 deletions
diff --git a/mysql-test/include/assert_grep.inc b/mysql-test/include/assert_grep.inc
deleted file mode 100644
index a980a6d73b1..00000000000
--- a/mysql-test/include/assert_grep.inc
+++ /dev/null
@@ -1,154 +0,0 @@
-# ==== 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
diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc
index 820bc8e9016..2abfd901b03 100644
--- a/mysql-test/include/rpl_init.inc
+++ b/mysql-test/include/rpl_init.inc
@@ -43,7 +43,6 @@
#
# [--let $rpl_server_count= 7]
# --let $rpl_topology= 1->2->3->1->4, 2->5, 6->7
-# [--let $rpl_extra_connections_per_server= 1]
# [--let $rpl_check_server_ids= 1]
# [--let $rpl_skip_change_master= 1]
# [--let $rpl_skip_start_slave= 1]
@@ -66,12 +65,6 @@
# want to specify the empty topology (no server replicates at
# all), you have to set $rpl_topology=none.
#
-# $rpl_extra_connections_per_server
-# By default, this script creates connections server_N and
-# server_N_1. If you can set this variable to a number, the
-# script creates:
-# server_N, server_N_1, ..., server_N_$rpl_extra_connections_per_server
-#
# $rpl_check_server_ids
# If $rpl_check_server_ids is set, this script checks that the
# @@server_id of all servers are different. This is normally
@@ -146,17 +139,8 @@ if (!$SERVER_MYPORT_4)
# Check that $rpl_server_count is set
if (!$rpl_server_count)
{
- --let $rpl_server_count= `SELECT REPLACE('$rpl_topology', '->', ',')`
- if (`SELECT LOCATE(',', '$rpl_server_count')`)
- {
- --let $rpl_server_count= `SELECT GREATEST($rpl_server_count)`
- }
-}
-
---let $_rpl_extra_connections_per_server= $rpl_extra_connections_per_server
-if ($_rpl_extra_connections_per_server == '')
-{
- --let $_rpl_extra_connections_per_server= 1
+ --let $_compute_rpl_server_count= `SELECT REPLACE('$rpl_topology', '->', ',')`
+ --let $rpl_server_count= `SELECT GREATEST($_compute_rpl_server_count)`
}
@@ -175,20 +159,15 @@ if (!$rpl_debug)
# Create two connections to each server; reset master/slave, select
# database, set autoinc variables.
--let $_rpl_server= $rpl_server_count
---let $underscore= _
+--let $_rpl_one= _1
while ($_rpl_server)
{
# Connect.
--let $rpl_server_number= $_rpl_server
--let $rpl_connection_name= server_$_rpl_server
--source include/rpl_connect.inc
- --let $_rpl_connection_number= 1
- while ($_rpl_connection_number <= $_rpl_extra_connections_per_server)
- {
- --let $rpl_connection_name= server_$_rpl_server$underscore$_rpl_connection_number
- --source include/rpl_connect.inc
- --inc $_rpl_connection_number
- }
+ --let $rpl_connection_name= server_$_rpl_server$_rpl_one
+ --source include/rpl_connect.inc
# Configure server.
--let $rpl_connection_name= server_$_rpl_server
diff --git a/mysql-test/include/rpl_reconnect.inc b/mysql-test/include/rpl_reconnect.inc
index 673f382bac0..cdbbd0a1bf1 100644
--- a/mysql-test/include/rpl_reconnect.inc
+++ b/mysql-test/include/rpl_reconnect.inc
@@ -12,7 +12,6 @@
# ==== Usage ====
#
# --let $rpl_server_number= N
-# [--let $rpl_extra_connections_per_server= 1]
# [--let $rpl_debug= 1]
# --source include/rpl_reconnect.inc
#
@@ -22,7 +21,7 @@
# master server, 2 the slave server, 3 the 3rd server, and so on.
# Cf. include/rpl_init.inc
#
-# $rpl_extra_connections_per_server, $rpl_debug
+# $rpl_debug
# See include/rpl_init.inc
--let $include_filename= rpl_reconnect.inc
@@ -33,11 +32,6 @@ if (!$rpl_server_number)
--die ERROR IN TEST: you must set $rpl_server_number before you source rpl_connect.inc
}
-if ($_rpl_extra_connections_per_server == '')
-{
- --let $_rpl_extra_connections_per_server= 1
-}
-
if ($rpl_debug)
{
@@ -78,14 +72,10 @@ if (!$_rpl_server_number)
--source include/rpl_connection.inc
--enable_reconnect
---let $_rpl_connection_number= 1
-while ($_rpl_connection_number <= $_rpl_extra_connections_per_server)
-{
- --let $rpl_connection_name= server_$rpl_server_number$underscore$_rpl_connection_number
- --source include/rpl_connection.inc
- --enable_reconnect
- --inc $_rpl_connection_number
-}
+--let $_rpl_one= _1
+--let $rpl_connection_name= server_$rpl_server_number$_rpl_one
+--source include/rpl_connection.inc
+--enable_reconnect
if ($rpl_debug)
{
@@ -132,15 +122,10 @@ if (!$_rpl_server_number)
--source include/wait_until_connected_again.inc
--disable_reconnect
---let $_rpl_connection_number= 1
-while ($_rpl_connection_number <= $_rpl_extra_connections_per_server)
-{
- --let $rpl_connection_name= server_$rpl_server_number$underscore$_rpl_connection_number
- --source include/rpl_connection.inc
- --source include/wait_until_connected_again.inc
- --disable_reconnect
- --inc $_rpl_connection_number
-}
+--let $rpl_connection_name= server_$rpl_server_number$_rpl_one
+--source include/rpl_connection.inc
+--source include/wait_until_connected_again.inc
+--disable_reconnect
--let $include_filename= rpl_reconnect.inc
diff --git a/mysql-test/include/start_slave_sql.inc b/mysql-test/include/start_slave_sql.inc
deleted file mode 100644
index 9cb66a2eb40..00000000000
--- a/mysql-test/include/start_slave_sql.inc
+++ /dev/null
@@ -1,39 +0,0 @@
-# ==== Purpose ====
-#
-# Issues START SLAVE SQL_THREAD on the current connection. Then waits
-# until the SQL thread has started, or until a timeout is reached.
-#
-# Please use this instead of 'START SLAVE SQL_THREAD', to reduce the
-# risk of races in test cases.
-#
-#
-# ==== Usage ====
-#
-# [--let $slave_timeout= NUMBER]
-# [--let $rpl_debug= 1]
-# --source include/start_slave_sql.inc
-#
-# Parameters:
-# $slave_timeout
-# See include/wait_for_slave_param.inc
-#
-# $rpl_debug
-# See include/rpl_init.inc
-
-
---let $include_filename= start_slave_sql.inc
---source include/begin_include_file.inc
-
-
-if (!$rpl_debug)
-{
- --disable_query_log
-}
-
-
-START SLAVE SQL_THREAD;
---source include/wait_for_slave_sql_to_start.inc
-
-
---let $include_filename= start_slave_sql.inc
---source include/end_include_file.inc
diff --git a/mysql-test/suite/rpl/r/rpl_io_thd_wait_for_disk_space.result b/mysql-test/suite/rpl/r/rpl_io_thd_wait_for_disk_space.result
deleted file mode 100644
index b11ad4f53bd..00000000000
--- a/mysql-test/suite/rpl/r/rpl_io_thd_wait_for_disk_space.result
+++ /dev/null
@@ -1,15 +0,0 @@
-include/master-slave.inc
-[connection master]
-CREATE TABLE t1(a INT);
-INSERT INTO t1 VALUES(1);
-CALL mtr.add_suppression("Disk is full writing");
-CALL mtr.add_suppression("Retry in 60 secs");
-include/stop_slave_sql.inc
-SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
-INSERT INTO t1 VALUES(2);
-SET DEBUG_SYNC='now WAIT_FOR parked';
-SET @@GLOBAL.DEBUG= '$debug_saved';
-include/assert_grep.inc [Found the disk full error message on the slave]
-include/start_slave_sql.inc
-DROP TABLE t1;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_io_thd_wait_for_disk_space.test b/mysql-test/suite/rpl/t/rpl_io_thd_wait_for_disk_space.test
deleted file mode 100644
index 6076be60ebc..00000000000
--- a/mysql-test/suite/rpl/t/rpl_io_thd_wait_for_disk_space.test
+++ /dev/null
@@ -1,71 +0,0 @@
-# ==== Purpose ====
-#
-# Check that the execution of SHOW SLAVE STATUS command is not blocked when IO
-# thread is blocked waiting for disk space.
-#
-# ==== Implementation ====
-#
-# Simulate a scenario where IO thread is waiting for disk space while writing
-# into the relay log. Execute SHOW SLAVE STATUS command after IO thread is
-# blocked waiting for space. The command should not be blocked.
-#
-# ==== References ====
-#
-# Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR
-# DISK SPACE
-# Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS FULL
-#
-###############################################################################
---source include/have_debug.inc
-# Inorder to grep a specific error pattern in error log a fresh error log
-# needs to be generated.
---source include/force_restart.inc
---source include/master-slave.inc
-
-# Generate events to be replicated to the slave
-CREATE TABLE t1(a INT);
-INSERT INTO t1 VALUES(1);
---sync_slave_with_master
-
-# Those errors will only happen in the slave
-CALL mtr.add_suppression("Disk is full writing");
-CALL mtr.add_suppression("Retry in 60 secs");
-
-# Stop the SQL thread to avoid writing on disk
---source include/stop_slave_sql.inc
-
-# Set the debug option that will simulate disk full
---let $debug_saved= `SELECT @@GLOBAL.DEBUG`
-SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
-
-# Generate events to be replicated to the slave
---connection master
-INSERT INTO t1 VALUES(2);
-
---connection slave1
-SET DEBUG_SYNC='now WAIT_FOR parked';
-
-# Get the relay log file name using SHOW SLAVE STATUS
---let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
-
---connection slave
-# Restore the debug options to "simulate" freed space on disk
-SET @@GLOBAL.DEBUG= '$debug_saved';
-
-# There should be a message in the error log of the slave stating
-# that it was waiting for space to write on the relay log.
---let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
-# Grep only after the message that the I/O thread has started
---let $assert_only_after= Slave I/O .* connected to master .*replication started in log .* at position
---let $assert_count= 1
---let $assert_select=Disk is full writing .*$relay_log_file.*
---let $assert_text= Found the disk full error message on the slave
---source include/assert_grep.inc
-
-# Start the SQL thread to let the slave to sync and finish gracefully
---source include/start_slave_sql.inc
-
-# Cleanup
---connection master
-DROP TABLE t1;
---source include/rpl_end.inc