diff options
-rw-r--r-- | innobase/include/os0file.h | 3 | ||||
-rw-r--r-- | innobase/sync/sync0arr.c | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index 5c52f0e92bf..b221bf7aef9 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -18,6 +18,9 @@ extern ibool os_do_not_call_flush_at_each_write; extern ibool os_has_said_disk_full; extern ibool os_aio_print_debug; +extern ulint os_file_n_pending_preads; +extern ulint os_file_n_pending_pwrites; + #ifdef __WIN__ /* We define always WIN_ASYNC_IO, and check at run-time whether diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c index 4854b40409e..06e9fdcd63d 100644 --- a/innobase/sync/sync0arr.c +++ b/innobase/sync/sync0arr.c @@ -14,6 +14,7 @@ Created 9/5/1995 Heikki Tuuri #include "sync0sync.h" #include "sync0rw.h" #include "os0sync.h" +#include "os0file.h" #include "srv0srv.h" /* @@ -940,6 +941,16 @@ sync_array_print_long_waits(void) "InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:\n"); old_val = srv_print_innodb_monitor; + /* If some crucial semaphore is reserved, then also the InnoDB + Monitor can hang, and we do not get diagnostics. Since in + many cases an InnoDB hang is caused by a pwrite() or a pread() + call hanging inside the operating system, let us print right + now the values of pending calls of these. */ + + fprintf(stderr, +"InnoDB: Pending preads %lu, pwrites %lu\n", (ulong)os_file_n_pending_preads, + (ulong)os_file_n_pending_pwrites); + srv_print_innodb_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); |