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.
This commit is contained in:
Sujatha Sivakumar 2016-04-11 11:41:47 +05:30
parent b4afc6a7a9
commit 3a8f43bec7
4 changed files with 15 additions and 9 deletions

View File

@ -7,7 +7,7 @@ CALL mtr.add_suppression("Retry in 60 secs");
include/stop_slave_sql.inc include/stop_slave_sql.inc
SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space'; SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
INSERT INTO t1 VALUES(2); 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'; SET @@GLOBAL.DEBUG= '$debug_saved';
include/assert_grep.inc [Found the disk full error message on the slave] include/assert_grep.inc [Found the disk full error message on the slave]
include/start_slave_sql.inc include/start_slave_sql.inc

View File

@ -42,16 +42,13 @@ SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
--connection master --connection master
INSERT INTO t1 VALUES(2); INSERT INTO t1 VALUES(2);
--connection slave --connection slave1
# Wait until IO thread is queuing events from master SET DEBUG_SYNC='now WAIT_FOR parked';
# 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
# 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) --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 # Restore the debug options to "simulate" freed space on disk
SET @@GLOBAL.DEBUG= '$debug_saved'; SET @@GLOBAL.DEBUG= '$debug_saved';

View File

@ -15,7 +15,7 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include "mysys_err.h" #include "mysys_err.h"
#include "m_string.h"
#ifndef SHARED_LIBRARY #ifndef SHARED_LIBRARY
const char *globerrs[GLOBERRS]= const char *globerrs[GLOBERRS]=
@ -128,6 +128,7 @@ void wait_for_free_space(const char *filename, int errors)
}); });
(void) sleep(time_to_sleep); (void) sleep(time_to_sleep);
DEBUG_SYNC_C("disk_full_reached");
} }
const char **get_global_errmsgs() const char **get_global_errmsgs()

View File

@ -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. sufficient to block SQL thread when IO thread is updating relay log here.
*/ */
mysql_mutex_unlock(&mi->data_lock); 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 do
{ {
if (my_b_append(&log_file,(uchar*) buf,len)) if (my_b_append(&log_file,(uchar*) buf,len))