summaryrefslogtreecommitdiff
path: root/storage/innobase/srv/srv0start.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/srv/srv0start.cc')
-rw-r--r--storage/innobase/srv/srv0start.cc86
1 files changed, 43 insertions, 43 deletions
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 4be92906851..f8347469c73 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1247,13 +1247,12 @@ srv_shutdown_all_bg_threads()
/* NOTE: IF YOU CREATE THREADS IN INNODB, YOU MUST EXIT THEM
HERE OR EARLIER */
- if (!srv_read_only_mode) {
-
- if (srv_start_state_is_set(SRV_START_STATE_LOCK_SYS)) {
- /* a. Let the lock timeout thread exit */
- os_event_set(lock_sys->timeout_event);
- }
+ if (srv_start_state_is_set(SRV_START_STATE_LOCK_SYS)) {
+ /* a. Let the lock timeout thread exit */
+ os_event_set(lock_sys->timeout_event);
+ }
+ if (!srv_read_only_mode) {
/* b. srv error monitor thread exits automatically,
no need to do anything here */
@@ -1270,31 +1269,31 @@ srv_shutdown_all_bg_threads()
}
if (srv_start_state_is_set(SRV_START_STATE_IO)) {
+ ut_ad(!srv_read_only_mode);
+
/* e. Exit the i/o threads */
- if (!srv_read_only_mode) {
- if (recv_sys->flush_start != NULL) {
- os_event_set(recv_sys->flush_start);
- }
- if (recv_sys->flush_end != NULL) {
- os_event_set(recv_sys->flush_end);
- }
+ if (recv_sys->flush_start != NULL) {
+ os_event_set(recv_sys->flush_start);
+ }
+ if (recv_sys->flush_end != NULL) {
+ os_event_set(recv_sys->flush_end);
}
os_event_set(buf_flush_event);
- if (!buf_page_cleaner_is_active
- && os_aio_all_slots_free()) {
- os_aio_wake_all_threads_at_shutdown();
+ /* f. dict_stats_thread is signaled from
+ logs_empty_and_mark_files_at_shutdown() and
+ should have already quit or is quitting right
+ now. */
+
+ if (srv_use_mtflush) {
+ /* g. Exit the multi threaded flush threads */
+ buf_mtflu_io_thread_exit();
}
}
- /* f. dict_stats_thread is signaled from
- logs_empty_and_mark_files_at_shutdown() and should have
- already quit or is quitting right now. */
-
- if (srv_use_mtflush) {
- /* g. Exit the multi threaded flush threads */
- buf_mtflu_io_thread_exit();
+ if (!buf_page_cleaner_is_active && os_aio_all_slots_free()) {
+ os_aio_wake_all_threads_at_shutdown();
}
bool active = os_thread_active();
@@ -1465,8 +1464,9 @@ innobase_start_or_create_for_mysql(void)
if (srv_read_only_mode) {
ib::info() << "Started in read only mode";
- /* There is no write except to intrinsic table and so turn-off
- doublewrite mechanism completely. */
+ /* There is no write to InnoDB tablespaces (not even
+ temporary ones, because also CREATE TEMPORARY TABLE is
+ refused in read-only mode). */
srv_use_doublewrite_buf = FALSE;
}
@@ -1856,26 +1856,26 @@ innobase_start_or_create_for_mysql(void)
thread_started[t] = true;
}
- /* Even in read-only mode there could be flush job generated by
- intrinsic table operations. */
- buf_flush_page_cleaner_init();
+ if (!srv_read_only_mode) {
+ buf_flush_page_cleaner_init();
- os_thread_create(buf_flush_page_cleaner_coordinator,
- NULL, NULL);
+ os_thread_create(buf_flush_page_cleaner_coordinator,
+ NULL, NULL);
- buf_flush_page_cleaner_thread_started = true;
+ buf_flush_page_cleaner_thread_started = true;
- for (i = 1; i < srv_n_page_cleaners; ++i) {
- os_thread_create(buf_flush_page_cleaner_worker,
- NULL, NULL);
- }
+ for (i = 1; i < srv_n_page_cleaners; ++i) {
+ os_thread_create(buf_flush_page_cleaner_worker,
+ NULL, NULL);
+ }
- /* Make sure page cleaner is active. */
- while (!buf_page_cleaner_is_active) {
- os_thread_sleep(10000);
- }
+ /* Make sure page cleaner is active. */
+ while (!buf_page_cleaner_is_active) {
+ os_thread_sleep(10000);
+ }
- srv_start_state_set(SRV_START_STATE_IO);
+ srv_start_state_set(SRV_START_STATE_IO);
+ }
if (srv_n_log_files * srv_log_file_size * UNIV_PAGE_SIZE
>= 512ULL * 1024ULL * 1024ULL * 1024ULL) {
@@ -2575,10 +2575,10 @@ files_checked:
purge_sys->state = PURGE_STATE_DISABLED;
}
- /* wake main loop of page cleaner up */
- os_event_set(buf_flush_event);
-
if (!srv_read_only_mode) {
+ /* wake main loop of page cleaner up */
+ os_event_set(buf_flush_event);
+
if (srv_use_mtflush) {
/* Start multi-threaded flush threads */
mtflush_ctx = buf_mtflu_handler_init(