Commit 0d69d313 authored by Marko Mäkelä's avatar Marko Mäkelä

Prevent interleaved error log output on InnoDB startup

buf_flush_page_cleaner_coordinator(): Signal the thread creator
that the error log output regarding setpriority() has been issued.

innobase_start_or_create_for_mysql(): Wait for
buf_flush_page_cleaner_coordinator() to completely start up.

This prevents sporadic failures of tests that search the server
error log for InnoDB redo log recovery messages.
parent 0288fa61
......@@ -3133,12 +3133,6 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(
os_thread_create */
{
my_thread_init();
ulint next_loop_time = ut_time_ms() + 1000;
ulint n_flushed = 0;
ulint last_activity = srv_get_activity_count();
ulint last_pages = 0;
my_thread_init();
#ifdef UNIV_PFS_THREAD
pfs_register_thread(page_cleaner_thread_key);
#endif /* UNIV_PFS_THREAD */
......@@ -3160,6 +3154,8 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(
" page cleaner thread priority can be changed."
" See the man page of setpriority().";
}
/* Signal that setpriority() has been attempted. */
os_event_set(recv_sys->flush_end);
#endif /* UNIV_LINUX */
while (!srv_read_only_mode
......@@ -3203,12 +3199,16 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(
os_event_wait(buf_flush_event);
ulint ret_sleep = 0;
ulint n_evicted = 0;
ulint n_flushed_last = 0;
ulint warn_interval = 1;
ulint warn_count = 0;
int64_t sig_count = os_event_reset(buf_flush_event);
ulint ret_sleep = 0;
ulint n_evicted = 0;
ulint n_flushed_last = 0;
ulint warn_interval = 1;
ulint warn_count = 0;
int64_t sig_count = os_event_reset(buf_flush_event);
ulint next_loop_time = ut_time_ms() + 1000;
ulint n_flushed = 0;
ulint last_activity = srv_get_activity_count();
ulint last_pages = 0;
while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
......
......@@ -1861,6 +1861,10 @@ innobase_start_or_create_for_mysql()
NULL, NULL);
}
#ifdef UNIV_LINUX
/* Wait for the setpriority() call to finish. */
os_event_wait(recv_sys->flush_end);
#endif /* UNIV_LINUX */
srv_start_state_set(SRV_START_STATE_IO);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment