diff options
author | heikki@hundin.mysql.fi <> | 2004-03-11 10:38:37 +0200 |
---|---|---|
committer | heikki@hundin.mysql.fi <> | 2004-03-11 10:38:37 +0200 |
commit | 0a0e981220117d9aca344ba89d85ab928e9796c3 (patch) | |
tree | 4df4c01cdaf7a830bd650a24bb003fe406ac7634 /innobase | |
parent | 9d6f8a7b8870cf033111946354c7be69f6b9df2d (diff) | |
download | mariadb-git-0a0e981220117d9aca344ba89d85ab928e9796c3.tar.gz |
sync0arr.c, os0file.h:
Print always the count of pending pread() and pwrite() calls if there is a long semaphore wait
Diffstat (limited to 'innobase')
-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); |