summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujatha Sivakumar <sujatha.sivakumar@oracle.com>2016-04-11 11:41:47 +0530
committerSujatha Sivakumar <sujatha.sivakumar@oracle.com>2016-04-19 11:44:34 +0530
commit3a8f43bec76d3d93a809b6a3c76e26e946ba0425 (patch)
tree92289c9eb54a2a8d31871aee77ad5def5790e7a2
parentb4afc6a7a94a60980eac15dad385cd29ad1dd816 (diff)
downloadmariadb-git-3a8f43bec76d3d93a809b6a3c76e26e946ba0425.tar.gz
Bug#22897202: RPL_IO_THD_WAIT_FOR_DISK_SPACE HAS OCCASIONAL
FAILURES Analysis: ========= Test script is not ensuring that "assert_grep.inc" should be called only after 'Disk is full' error is written to the error log. Test checks for "Queueing master event to the relay log" state. But this state is set before invoking 'queue_event'. Actual 'Disk is full' error happens at a very lower level. It can happen that we might even reset the debug point before even the actual disk full simulation occurs and the "Disk is full" message will never appear in the error log. In order to guarentee that we must have some mechanism where in after we write "Disk is full" error messge into the error log we must signal the test to execute SSS and then reset the debug point. So that test is deterministic. Fix: === Added debug sync point to make script deterministic.
-rw-r--r--mysql-test/suite/rpl/r/rpl_io_thd_wait_for_disk_space.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_io_thd_wait_for_disk_space.test11
-rw-r--r--mysys/errors.c3
-rw-r--r--sql/log.cc8
4 files changed, 15 insertions, 9 deletions
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
index c601c9a4169..b11ad4f53bd 100644
--- 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
@@ -7,7 +7,7 @@ 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);
-include/wait_for_slave_param.inc [Slave_IO_State]
+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
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
index 9eed1089e6d..6076be60ebc 100644
--- 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
@@ -42,16 +42,13 @@ SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
--connection master
INSERT INTO t1 VALUES(2);
---connection slave
-# Wait until IO thread is queuing events from master
-# Notice that this is performed by querying SHOW SLAVE STATUS
---let $slave_param= Slave_IO_State
---let $slave_param_value= Queueing master event to the relay log
---source include/wait_for_slave_param.inc
+--connection slave1
+SET DEBUG_SYNC='now WAIT_FOR parked';
-# Get the relay log file name, also using SHOW SLAVE STATUS
+# 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';
diff --git a/mysys/errors.c b/mysys/errors.c
index 942fd3230c0..b6064460535 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -15,7 +15,7 @@
#include "mysys_priv.h"
#include "mysys_err.h"
-
+#include "m_string.h"
#ifndef SHARED_LIBRARY
const char *globerrs[GLOBERRS]=
@@ -128,6 +128,7 @@ void wait_for_free_space(const char *filename, int errors)
});
(void) sleep(time_to_sleep);
+ DEBUG_SYNC_C("disk_full_reached");
}
const char **get_global_errmsgs()
diff --git a/sql/log.cc b/sql/log.cc
index eab9a118147..a7f05905514 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -4452,6 +4452,14 @@ bool MYSQL_BIN_LOG::appendv(Master_info* mi, const char* buf, uint len,...)
sufficient to block SQL thread when IO thread is updating relay log here.
*/
mysql_mutex_unlock(&mi->data_lock);
+ DBUG_EXECUTE_IF("simulate_io_thd_wait_for_disk_space",
+ {
+ const char act[]= "disk_full_reached SIGNAL parked";
+ DBUG_ASSERT(opt_debug_sync_timeout > 0);
+ DBUG_ASSERT(!debug_sync_set_action(current_thd,
+ STRING_WITH_LEN(act)));
+ };);
+
do
{
if (my_b_append(&log_file,(uchar*) buf,len))