diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-10-28 19:04:23 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-10-28 19:04:23 +0200 |
commit | 8e7ebfbce89a472b3c5a6c30e6de101e567a8218 (patch) | |
tree | 9f9950feb45222c7df4f37c841f4af593ec75ee5 /storage/xtradb/srv/srv0start.c | |
parent | 3bdede3c67032345ca5f71dd53ca308377dc2398 (diff) | |
parent | 7c24e8d54d1d41374b7836e3273e7e5eaf22e2c4 (diff) | |
download | mariadb-git-8e7ebfbce89a472b3c5a6c30e6de101e567a8218.tar.gz |
5.2 merge
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 |