diff options
Diffstat (limited to 'innobase/srv/srv0srv.c')
-rw-r--r-- | innobase/srv/srv0srv.c | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 37bf59b6b9a..424bb8a7086 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -57,7 +57,7 @@ ulint srv_activity_count = 0; ibool srv_lock_timeout_and_monitor_active = FALSE; ibool srv_error_monitor_active = FALSE; -char* srv_main_thread_op_info = ""; +char* srv_main_thread_op_info = (char *) ""; /* Server parameters which are read from the initfile */ @@ -188,6 +188,12 @@ ulint srv_n_rows_read_old = 0; ibool srv_print_innodb_monitor = FALSE; ibool srv_print_innodb_lock_monitor = FALSE; ibool srv_print_innodb_tablespace_monitor = FALSE; + +/* + Set the following to 0 if you want InnoDB to write messages on + stderr on startup/shutdown +*/ +ibool srv_print_verbose_log = TRUE; ibool srv_print_innodb_table_monitor = FALSE; /* The parameters below are obsolete: */ @@ -928,6 +934,7 @@ srv_communication_init( /************************************************************************* Implements the recovery utility. */ +#ifdef NOT_USED static ulint srv_recovery_thread( @@ -965,7 +972,7 @@ srv_recovery_thread( return(0); } - +#endif /************************************************************************* Implements the purge utility. */ @@ -1017,6 +1024,7 @@ srv_create_utility_threads(void) /************************************************************************* Implements the communication threads. */ +#ifdef NOT_USED static ulint srv_com_thread( @@ -1064,7 +1072,7 @@ srv_com_thread( return(0); } - +#endif /************************************************************************* Creates the communication threads. */ @@ -1086,6 +1094,7 @@ srv_create_com_threads(void) /************************************************************************* Implements the worker threads. */ +#ifdef NOT_USED static ulint srv_worker_thread( @@ -1128,7 +1137,7 @@ srv_worker_thread( return(0); } - +#endif /************************************************************************* Creates the worker threads. */ @@ -2296,7 +2305,7 @@ srv_master_thread( os_event_set(srv_sys->operational); loop: - srv_main_thread_op_info = "reserving kernel mutex"; + srv_main_thread_op_info = (char *) "reserving kernel mutex"; n_ios_very_old = log_sys->n_log_ios + buf_pool->n_pages_read + buf_pool->n_pages_written; @@ -2312,7 +2321,7 @@ loop: for (i = 0; i < 10; i++) { n_ios_old = log_sys->n_log_ios + buf_pool->n_pages_read + buf_pool->n_pages_written; - srv_main_thread_op_info = "sleeping"; + srv_main_thread_op_info = (char *) "sleeping"; os_thread_sleep(1000000); if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) { @@ -2324,7 +2333,7 @@ loop: is issued or the we have specified in my.cnf no flush at transaction commit */ - srv_main_thread_op_info = "flushing log"; + srv_main_thread_op_info = (char *) "flushing log"; log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); /* If there were less than 10 i/os during the @@ -2337,10 +2346,11 @@ loop: n_ios = log_sys->n_log_ios + buf_pool->n_pages_read + buf_pool->n_pages_written; if (n_pend_ios < 3 && (n_ios - n_ios_old < 10)) { - srv_main_thread_op_info = "doing insert buffer merge"; + srv_main_thread_op_info = + (char *) "doing insert buffer merge"; ibuf_contract_for_n_pages(TRUE, 5); - srv_main_thread_op_info = "flushing log"; + srv_main_thread_op_info = (char *) "flushing log"; log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); } @@ -2372,20 +2382,20 @@ loop: + buf_pool->n_pages_written; if (n_pend_ios < 3 && (n_ios - n_ios_very_old < 200)) { - srv_main_thread_op_info = "flushing buffer pool pages"; + srv_main_thread_op_info =(char *) "flushing buffer pool pages"; buf_flush_batch(BUF_FLUSH_LIST, 50, ut_dulint_max); - srv_main_thread_op_info = "flushing log"; + srv_main_thread_op_info = (char *) "flushing log"; log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); } /* We run a batch of insert buffer merge every 10 seconds, even if the server were active */ - srv_main_thread_op_info = "doing insert buffer merge"; + srv_main_thread_op_info = (char *) "doing insert buffer merge"; ibuf_contract_for_n_pages(TRUE, 5); - srv_main_thread_op_info = "flushing log"; + srv_main_thread_op_info = (char *) "flushing log"; log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); /* We run a full purge every 10 seconds, even if the server @@ -2402,13 +2412,13 @@ loop: goto background_loop; } - srv_main_thread_op_info = "purging"; + srv_main_thread_op_info = (char *) "purging"; n_pages_purged = trx_purge(); current_time = time(NULL); if (difftime(current_time, last_flush_time) > 1) { - srv_main_thread_op_info = "flushing log"; + srv_main_thread_op_info = (char *) "flushing log"; log_flush_up_to(ut_dulint_max, LOG_WAIT_ONE_GROUP); last_flush_time = current_time; @@ -2419,7 +2429,7 @@ background_loop: /* In this loop we run background operations when the server is quiet */ - srv_main_thread_op_info = "reserving kernel mutex"; + srv_main_thread_op_info = (char *) "reserving kernel mutex"; mutex_enter(&kernel_mutex); if (srv_activity_count != old_activity_count) { @@ -2432,11 +2442,11 @@ background_loop: /* The server has been quiet for a while: start running background operations */ - srv_main_thread_op_info = "purging"; + srv_main_thread_op_info = (char *) "purging"; n_pages_purged = trx_purge(); - srv_main_thread_op_info = "reserving kernel mutex"; + srv_main_thread_op_info = (char *) "reserving kernel mutex"; mutex_enter(&kernel_mutex); if (srv_activity_count != old_activity_count) { @@ -2445,10 +2455,10 @@ background_loop: } mutex_exit(&kernel_mutex); - srv_main_thread_op_info = "doing insert buffer merge"; + srv_main_thread_op_info = (char *) "doing insert buffer merge"; n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20); - srv_main_thread_op_info = "reserving kernel mutex"; + srv_main_thread_op_info = (char *) "reserving kernel mutex"; mutex_enter(&kernel_mutex); if (srv_activity_count != old_activity_count) { @@ -2457,10 +2467,10 @@ background_loop: } mutex_exit(&kernel_mutex); - srv_main_thread_op_info = "flushing buffer pool pages"; + srv_main_thread_op_info = (char *) "flushing buffer pool pages"; n_pages_flushed = buf_flush_batch(BUF_FLUSH_LIST, 100, ut_dulint_max); - srv_main_thread_op_info = "reserving kernel mutex"; + srv_main_thread_op_info = (char *) "reserving kernel mutex"; mutex_enter(&kernel_mutex); if (srv_activity_count != old_activity_count) { @@ -2469,14 +2479,15 @@ background_loop: } mutex_exit(&kernel_mutex); - srv_main_thread_op_info = "waiting for buffer pool flush to end"; + srv_main_thread_op_info = + (char *) "waiting for buffer pool flush to end"; buf_flush_wait_batch_end(BUF_FLUSH_LIST); - srv_main_thread_op_info = "making checkpoint"; + srv_main_thread_op_info = (char *) "making checkpoint"; log_checkpoint(TRUE, FALSE); - srv_main_thread_op_info = "reserving kernel mutex"; + srv_main_thread_op_info = (char *) "reserving kernel mutex"; mutex_enter(&kernel_mutex); if (srv_activity_count != old_activity_count) { @@ -2485,7 +2496,8 @@ background_loop: } mutex_exit(&kernel_mutex); - srv_main_thread_op_info = "archiving log (if log archive is on)"; + srv_main_thread_op_info = + (char *) "archiving log (if log archive is on)"; log_archive_do(FALSE, &n_bytes_archived); @@ -2509,7 +2521,7 @@ background_loop: master thread to wait for more server activity */ suspend_thread: - srv_main_thread_op_info = "suspending"; + srv_main_thread_op_info = (char *) "suspending"; mutex_enter(&kernel_mutex); @@ -2517,7 +2529,7 @@ suspend_thread: mutex_exit(&kernel_mutex); - srv_main_thread_op_info = "waiting for server activity"; + srv_main_thread_op_info = (char *) "waiting for server activity"; os_event_wait(event); |