diff options
Diffstat (limited to 'storage/xtradb/srv/srv0start.c')
-rw-r--r-- | storage/xtradb/srv/srv0start.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c index 62ffa366f18..b36faf2d2d7 100644 --- a/storage/xtradb/srv/srv0start.c +++ b/storage/xtradb/srv/srv0start.c @@ -126,9 +126,9 @@ static mutex_t ios_mutex; static ulint ios; /** io_handler_thread parameters for thread identification */ -static ulint n[SRV_MAX_N_IO_THREADS + 6 + 64]; +static ulint n[SRV_MAX_N_IO_THREADS + 7 + 64]; /** io_handler_thread identifiers */ -static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 64]; +static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 7 + 64]; /** We use this mutex to test the return value of pthread_mutex_trylock on successful locking. HP-UX does NOT return 0, though Linux et al do. */ @@ -1719,8 +1719,8 @@ innobase_start_or_create_for_mysql(void) Note that this is not as heavy weight as it seems. At this point there will be only ONE page in the buf_LRU and there must be no page in the buf_flush list. */ - /* TODO: treat more correctly */ - if (!srv_buffer_pool_shm_key) + /* buffer_pool_shm should not be reused when recovery was needed. */ + if (!srv_buffer_pool_shm_is_reused) buf_pool_invalidate(); /* We always try to do a recovery, even if the database had @@ -1835,6 +1835,10 @@ innobase_start_or_create_for_mysql(void) os_thread_create(&srv_monitor_thread, NULL, thread_ids + 4 + SRV_MAX_N_IO_THREADS); + /* Create the thread which automaticaly dumps/restore buffer pool */ + os_thread_create(&srv_LRU_dump_restore_thread, NULL, + thread_ids + 5 + SRV_MAX_N_IO_THREADS); + srv_is_being_started = FALSE; if (trx_doublewrite == NULL) { @@ -1859,13 +1863,13 @@ innobase_start_or_create_for_mysql(void) ulint i; os_thread_create(&srv_purge_thread, NULL, thread_ids - + (5 + SRV_MAX_N_IO_THREADS)); + + (6 + SRV_MAX_N_IO_THREADS)); for (i = 0; i < srv_use_purge_thread - 1; i++) { - n[6 + i + SRV_MAX_N_IO_THREADS] = i; /* using as index for arrays in purge_sys */ + n[7 + i + SRV_MAX_N_IO_THREADS] = i; /* using as index for arrays in purge_sys */ os_thread_create(&srv_purge_worker_thread, - n + (6 + i + SRV_MAX_N_IO_THREADS), - thread_ids + (6 + i + SRV_MAX_N_IO_THREADS)); + n + (7 + i + SRV_MAX_N_IO_THREADS), + thread_ids + (7 + i + SRV_MAX_N_IO_THREADS)); } } #ifdef UNIV_DEBUG @@ -2214,6 +2218,10 @@ innobase_shutdown_for_mysql(void) log_mem_free(); buf_pool_free(); mem_close(); + + /* ut_free_all_mem() frees all allocated memory not freed yet + in shutdown, and it will also free the ut_list_mutex, so it + should be the last one for all operation */ ut_free_all_mem(); if (os_thread_count != 0 |