From 39323920302a039ac7e3a80052fbd68d31e5e75d Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Wed, 2 Jan 2013 16:31:58 +0530 Subject: BUG#11753923-SQL THREAD CRASHES ON DISK FULL Problem:If Disk becomes full while writing into the binlog, then the server instance hangs till someone frees the space. After user frees up the disk space, mysql server crashes with an assert (m_status != DA_EMPTY) Analysis: wait_for_free_space is being called in an infinite loop i.e., server instance will hang until someone frees up the space. So there is no need to set status bit in diagnostic area. Fix: Replace my_error/my_printf_error with sql_print_warning() which prints the warning in error log. include/my_sys.h: Provision to call sql_print_warning from mysys files mysys/errors.c: Replace my_error/my_printf_error with sql_print_warning() which prints the warning in error log. mysys/my_error.c: implementation of my_printf_warning mysys/my_write.c: Adding logic to break infinite loop in the simulation sql/mysqld.cc: Provision to call sql_print_warning from mysys files --- mysys/my_write.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysys/my_write.c') diff --git a/mysys/my_write.c b/mysys/my_write.c index b545ab776b0..d0a59a605b6 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -36,6 +36,8 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) if (unlikely(!Count)) DBUG_RETURN(0); + DBUG_EXECUTE_IF ("simulate_file_write_error_once", + { DBUG_SET("+d,simulate_file_write_error");}); for (;;) { writenbytes= write(Filedes, Buffer, Count); @@ -69,6 +71,8 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) { wait_for_free_space(my_filename(Filedes), errors); errors++; + DBUG_EXECUTE_IF("simulate_file_write_error_once", + { DBUG_SET("-d,simulate_file_write_error");}); continue; } -- cgit v1.2.1