Skip to content
Permalink
Browse files

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.
  • Loading branch information...
dr-m committed Jun 23, 2017
1 parent 0288fa6 commit 0d69d313a11fb03f31d71282f622b25d0a4764b8
Showing with 16 additions and 12 deletions.
  1. +12 −12 storage/innobase/buf/buf0flu.cc
  2. +4 −0 storage/innobase/srv/srv0start.cc
@@ -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);
}

0 comments on commit 0d69d31

Please sign in to comment.
You can’t perform that action at this time.