summaryrefslogtreecommitdiff
path: root/mysys/errors.c
diff options
context:
space:
mode:
authorSujatha Sivakumar <sujatha.sivakumar@oracle.com>2016-03-01 12:29:51 +0530
committerSujatha Sivakumar <sujatha.sivakumar@oracle.com>2016-03-01 12:29:51 +0530
commit8361151765cc5efd72ad18c5553f80aa440a1d83 (patch)
tree3491624d184a21c83db6283141c32be797b40c92 /mysys/errors.c
parentbb32ac1d9b6c1333316a8da32ea46105eceefa29 (diff)
downloadmariadb-git-8361151765cc5efd72ad18c5553f80aa440a1d83.tar.gz
Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS
FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE Problem: ======== Currently SHOW SLAVE STATUS blocks if IO thread waits for disk space. This makes automation tools verifying server health block on taking relevant action. Finally this will create SHOW SLAVE STATUS piles. Analysis: ========= SHOW SLAVE STATUS hangs on mi->data_lock if relay log write is waiting for free disk space while holding mi->data_lock. mi->data_lock is needed to protect the format description event (mi->format_description_event) which is accessed by the clients running FLUSH LOGS and slave IO thread. Note relay log writes don't need to be protected by mi->data_lock, LOCK_log is used to protect relay log between IO and SQL thread (see MYSQL_BIN_LOG::append_event). The code takes mi->data_lock to protect mi->format_description_event during relay log rotate which might get triggered right after relay log write. Fix: ==== Release the data_lock just for the duration of writing into relay log. Made change to ensure the following lock order is maintained to avoid deadlocks. data_lock, LOCK_log data_lock is held during relay log rotations to protect the description event.
Diffstat (limited to 'mysys/errors.c')
-rw-r--r--mysys/errors.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mysys/errors.c b/mysys/errors.c
index ddd65836b30..942fd3230c0 100644
--- a/mysys/errors.c
+++ b/mysys/errors.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -109,6 +109,7 @@ void init_glob_errs()
*/
void wait_for_free_space(const char *filename, int errors)
{
+ size_t time_to_sleep= MY_WAIT_FOR_USER_TO_FIX_PANIC;
if (!(errors % MY_WAIT_GIVE_USER_A_MESSAGE))
{
my_printf_warning(EE(EE_DISK_FULL),
@@ -119,10 +120,14 @@ void wait_for_free_space(const char *filename, int errors)
}
DBUG_EXECUTE_IF("simulate_no_free_space_error",
{
- (void) sleep(1);
- return;
+ time_to_sleep= 1;
});
- (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC);
+ DBUG_EXECUTE_IF("simulate_io_thd_wait_for_disk_space",
+ {
+ time_to_sleep= 1;
+ });
+
+ (void) sleep(time_to_sleep);
}
const char **get_global_errmsgs()