diff options
Diffstat (limited to 'storage/innobase/srv/srv0srv.c')
-rw-r--r-- | storage/innobase/srv/srv0srv.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 3f6f1982992..3240b7515f8 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -48,6 +48,10 @@ Created 10/8/1995 Heikki Tuuri #include "srv0start.h" #include "row0mysql.h" #include "ha_prototypes.h" +#include "read0read.h" + +#include "m_string.h" /* for my_sys.h */ +#include "my_sys.h" /* DEBUG_SYNC_C */ /* This is set to TRUE if the MySQL user has set it in MySQL; currently affects only FOREIGN KEY definition parsing */ @@ -1435,6 +1439,10 @@ srv_suspend_mysql_thread( trx = thr_get_trx(thr); + if (trx->mysql_thd != 0) { + DEBUG_SYNC_C("srv_suspend_mysql_thread_enter"); + } + os_event_set(srv_lock_timeout_thread_event); mutex_enter(&kernel_mutex); @@ -1913,6 +1921,25 @@ srv_export_innodb_status(void) export_vars.innodb_rows_updated = srv_n_rows_updated; export_vars.innodb_rows_deleted = srv_n_rows_deleted; +#ifdef UNIV_DEBUG + if (ut_dulint_cmp(trx_sys->max_trx_id, purge_sys->done_trx_no) < 0) { + export_vars.innodb_purge_trx_id_age = 0; + } else { + export_vars.innodb_purge_trx_id_age = + ut_dulint_minus(trx_sys->max_trx_id, purge_sys->done_trx_no); + } + + if (!purge_sys->view + || ut_dulint_cmp(trx_sys->max_trx_id, + purge_sys->view->up_limit_id) < 0) { + export_vars.innodb_purge_view_trx_id_age = 0; + } else { + export_vars.innodb_purge_view_trx_id_age = + ut_dulint_minus(trx_sys->max_trx_id, + purge_sys->view->up_limit_id); + } +#endif /* UNIV_DEBUG */ + mutex_exit(&srv_innodb_monitor_mutex); } @@ -2387,6 +2414,29 @@ loop: + buf_pool->n_pages_written; srv_main_thread_op_info = "sleeping"; +#ifdef UNIV_DEBUG + if (btr_cur_limit_optimistic_insert_debug) { + /* If btr_cur_limit_optimistic_insert_debug is enabled + and no purge_threads, purge opportunity is increased + by x100 (1purge/100msec), to speed up debug scripts + which should wait for purged. */ + + if (!skip_sleep) { + os_thread_sleep(100000); + } + + do { + if (srv_fast_shutdown + && srv_shutdown_state > 0) { + goto background_loop; + } + + srv_main_thread_op_info = "purging"; + n_pages_purged = trx_purge(); + + } while (n_pages_purged); + } else +#endif /* UNIV_DEBUG */ if (!skip_sleep) { os_thread_sleep(1000000); |