Skip to content

Commit 2a9a6b2

Browse files
author
Sujatha Sivakumar
committed
Bug#22897202: RPL_IO_THD_WAIT_FOR_DISK_SPACE HAS OCCASIONAL
FAILURES Merge branch 'mysql-5.6' into mysql-5.7
2 parents 8d55d5c + d912a6d commit 2a9a6b2

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

mysql-test/suite/rpl/r/rpl_io_thd_wait_for_disk_space.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CALL mtr.add_suppression("Retry in 60 secs");
1010
include/stop_slave_sql.inc
1111
SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
1212
INSERT INTO t1 VALUES(2);
13-
include/wait_for_slave_param.inc [Slave_IO_State]
13+
set debug_sync='now WAIT_FOR parked';
1414
SET @@GLOBAL.DEBUG= '$debug_saved';
1515
include/assert_grep.inc [Found the disk full error message on the slave]
1616
include/start_slave_sql.inc

mysql-test/suite/rpl/t/rpl_io_thd_wait_for_disk_space.test

+3-6
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,13 @@ SET @@GLOBAL.DEBUG= 'd,simulate_io_thd_wait_for_disk_space';
4242
--connection master
4343
INSERT INTO t1 VALUES(2);
4444

45-
--connection slave
46-
# Wait until IO thread is queuing events from master
47-
# Notice that this is performed by querying SHOW SLAVE STATUS
48-
--let $slave_param= Slave_IO_State
49-
--let $slave_param_value= Queueing master event to the relay log
50-
--source include/wait_for_slave_param.inc
45+
--connection slave1
46+
set debug_sync='now WAIT_FOR parked';
5147

5248
# Get the relay log file name, also using SHOW SLAVE STATUS
5349
--let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
5450

51+
--connection slave
5552
# Restore the debug options to "simulate" freed space on disk
5653
SET @@GLOBAL.DEBUG= '$debug_saved';
5754

mysys/errors.c

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "mysys_err.h"
1818
#include "my_sys.h"
1919
#include "my_thread_local.h"
20+
#include "m_string.h"
2021

2122
const char *globerrs[GLOBERRS]=
2223
{
@@ -89,6 +90,7 @@ void wait_for_free_space(const char *filename, int errors)
8990
});
9091

9192
(void) sleep(time_to_sleep);
93+
DEBUG_SYNC_C("disk_full_reached");
9294
}
9395

9496
const char *get_global_errmsg(int nr)

sql/binlog.cc

+7
Original file line numberDiff line numberDiff line change
@@ -6718,6 +6718,13 @@ bool MYSQL_BIN_LOG::append_buffer(const char* buf, uint len, Master_info *mi)
67186718
sufficient to block SQL thread when IO thread is updating relay log here.
67196719
*/
67206720
mysql_mutex_unlock(&mi->data_lock);
6721+
DBUG_EXECUTE_IF("simulate_io_thd_wait_for_disk_space",
6722+
{
6723+
const char act[]= "disk_full_reached SIGNAL parked";
6724+
DBUG_ASSERT(opt_debug_sync_timeout > 0);
6725+
DBUG_ASSERT(!debug_sync_set_action(current_thd,
6726+
STRING_WITH_LEN(act)));
6727+
};);
67216728
// write data
67226729
bool error= false;
67236730
if (my_b_append(&log_file,(uchar*) buf,len) == 0)

0 commit comments

Comments
 (0)