#At file:///media/sdb2/hezx/work/mysql/bzrwork/b22082/5.0/
2731 He Zhenxing 2009-02-25
BUG#22082 Slave hangs(holds mutex) on "disk full"
When disk is full, server may waiting for free space while
writing binlog, relay-log or MyISAM tables. The server will
continue after user have freed some space. But the error
message printed was not quite clear about the how often the
error message is printed, and there will be a delay before
the server continue and user freeing space. And caused users
thinking that the server was hanging forever.
This patch fixed the problem by making the error messages
printed more clear. The error message is split into two part,
the first part will only be printed once, and the second part
will be printed very 10 times.
Message first part:
Disk is full writing '<filename>' (Errcode: <errorno>). Waiting
for someone to free space... (Expect 60 secs delay for server
to continue after freeing disk space)
Message second part:
Retry in 60 secs, Message reprinted in 600 secs
modified:
mysys/errors.c
mysys/my_fstream.c
mysys/my_pread.c
mysys/my_write.c
=== modified file 'mysys/errors.c'
--- a/mysys/errors.c 2008-06-16 08:05:00 +0000
+++ b/mysys/errors.c 2009-02-25 05:02:39 +0000
@@ -39,7 +39,7 @@ const char * NEAR globerrs[GLOBERRS]=
"Can't change dir to '%s' (Errcode: %d)",
"Warning: '%s' had %d links",
"%d files and %d streams is left open\n",
- "Disk is full writing '%s' (Errcode: %d). Waiting for someone to free space... Retry in %d secs",
+ "Disk is full writing '%s' (Errcode: %d). Waiting for someone to free space... (Expect %d secs delay for server to continue after freeing disk space)",
"Can't create directory '%s' (Errcode: %d)",
"Character set '%s' is not a compiled character set and is not specified in the '%s' file",
"Out of resources when opening file '%s' (Errcode: %d)",
=== modified file 'mysys/my_fstream.c'
--- a/mysys/my_fstream.c 2007-03-28 17:46:42 +0000
+++ b/mysys/my_fstream.c 2009-02-25 05:02:39 +0000
@@ -116,9 +116,15 @@ uint my_fwrite(FILE *stream, const byte
if ((errno == ENOSPC || errno == EDQUOT) &&
(MyFlags & MY_WAIT_IF_FULL))
{
- if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
+ if (errors == 1)
my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
- "[stream]",my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
+ my_printf_error(EE_DISK_FULL,
+ "Retry in %d secs. Message reprinted in %d secs",
+ MYF(ME_BELL | ME_NOREFRESH),
+ MY_WAIT_FOR_USER_TO_FIX_PANIC,
+ MY_WAIT_GIVE_USER_A_MESSAGE * MYWAIT_FOR_USER_TO_FIX_PANIC );
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
VOID(my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0)));
continue;
=== modified file 'mysys/my_pread.c'
--- a/mysys/my_pread.c 2007-03-28 17:46:42 +0000
+++ b/mysys/my_pread.c 2009-02-25 05:02:39 +0000
@@ -121,9 +121,15 @@ uint my_pwrite(int Filedes, const byte *
if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
(MyFlags & MY_WAIT_IF_FULL))
{
- if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
+ if (errors == 1)
my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
+ my_printf_error(EE_DISK_FULL,
+ "Retry in %d secs. Message reprinted in %d secs",
+ MYF(ME_BELL | ME_NOREFRESH),
+ MY_WAIT_FOR_USER_TO_FIX_PANIC,
+ MY_WAIT_GIVE_USER_A_MESSAGE * MYWAIT_FOR_USER_TO_FIX_PANIC );
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
continue;
}
=== modified file 'mysys/my_write.c'
--- a/mysys/my_write.c 2007-10-25 04:19:57 +0000
+++ b/mysys/my_write.c 2009-02-25 05:02:39 +0000
@@ -54,9 +54,15 @@ uint my_write(int Filedes, const byte *B
if ((my_errno == ENOSPC || my_errno == EDQUOT) &&
(MyFlags & MY_WAIT_IF_FULL))
{
- if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
+ if (errors == 1)
my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH),
my_filename(Filedes),my_errno,MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE))
+ my_printf_error(EE_DISK_FULL,
+ "Retry in %d secs. Message reprinted in %d secs",
+ MYF(ME_BELL | ME_NOREFRESH),
+ MY_WAIT_FOR_USER_TO_FIX_PANIC,
+ MY_WAIT_GIVE_USER_A_MESSAGE * MYWAIT_FOR_USER_TO_FIX_PANIC );
VOID(sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC));
continue;
}
Thread |
---|
• bzr commit into mysql-5.0-bugteam branch (zhenxing.he:2731) Bug#22082 | He Zhenxing | 25 Feb |