diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-06-12 11:08:06 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-06-12 11:08:06 +0300 |
commit | 4325041df6cf13ed1e62749fdb43fb8f138d1e78 (patch) | |
tree | 7f96c4fd5a081fd52c6456eef579d0c9d5ce638c /storage/xtradb | |
parent | 417434f12dba3ccf5b79ca4e7afe72fe27807fd0 (diff) | |
download | mariadb-git-4325041df6cf13ed1e62749fdb43fb8f138d1e78.tar.gz |
MDEV-13057 innodb_read_only=1 should avoid creating buf_flush_page_cleaner_thread
When the server is started in innodb_read_only mode, there cannot be
any writes to persistent InnoDB/XtraDB files. Just like the creation
of buf_flush_page_cleaner_thread is skipped in this case, also
the creation of the XtraDB-specific buf_flush_lru_manager_thread
should be skipped.
Diffstat (limited to 'storage/xtradb')
-rw-r--r-- | storage/xtradb/buf/buf0flu.cc | 4 | ||||
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 8 | ||||
-rw-r--r-- | storage/xtradb/srv/srv0start.cc | 11 |
3 files changed, 12 insertions, 11 deletions
diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 955be5a6161..17bfb92580e 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -61,7 +61,7 @@ doing the shutdown */ UNIV_INTERN bool buf_page_cleaner_is_active; /** Flag indicating if the lru_manager is in active state. */ -UNIV_INTERN bool buf_lru_manager_is_active = false; +UNIV_INTERN bool buf_lru_manager_is_active; #ifdef UNIV_PFS_THREAD UNIV_INTERN mysql_pfs_key_t buf_page_cleaner_thread_key; @@ -2868,8 +2868,6 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)( os_thread_pf(os_thread_get_curr_id())); #endif /* UNIV_DEBUG_THREAD_CREATION */ - buf_lru_manager_is_active = true; - /* On server shutdown, the LRU manager thread runs through cleanup phase to provide free pages for the master and purge threads. */ while (srv_shutdown_state == SRV_SHUTDOWN_NONE diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 9717136e030..e4238af7747 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -17032,6 +17032,10 @@ innodb_sched_priority_cleaner_update( const void* save) /*!< in: immediate result from check function */ { + if (srv_read_only_mode) { + return; + } + ulint priority = *static_cast<const ulint *>(save); ulint actual_priority; ulint nice = 0; @@ -17058,10 +17062,6 @@ innodb_sched_priority_cleaner_update( } /* Set the priority for the page cleaner thread */ - if (srv_read_only_mode) { - - return; - } ut_ad(buf_page_cleaner_is_active); nice = os_thread_get_priority(srv_cleaner_tid); diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 525c985f71b..f12f895488d 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -2947,12 +2947,15 @@ files_checked: if (!srv_read_only_mode) { buf_page_cleaner_is_active = true; - buf_flush_page_cleaner_thread_handle = os_thread_create(buf_flush_page_cleaner_thread, NULL, NULL); + buf_flush_page_cleaner_thread_handle = os_thread_create( + buf_flush_page_cleaner_thread, NULL, NULL); buf_flush_page_cleaner_thread_started = true; - } - buf_flush_lru_manager_thread_handle = os_thread_create(buf_flush_lru_manager_thread, NULL, NULL); - buf_flush_lru_manager_thread_started = true; + buf_lru_manager_is_active = true; + buf_flush_lru_manager_thread_handle = os_thread_create( + buf_flush_lru_manager_thread, NULL, NULL); + buf_flush_lru_manager_thread_started = true; + } if (!srv_file_per_table && srv_pass_corrupt_table) { fprintf(stderr, "InnoDB: Warning:" |