diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2017-08-08 10:18:43 +0200 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-08 10:18:43 +0200 |
| commit | 8e8d42ddf0291b2364fef8e3224e65d596ef4202 (patch) | |
| tree | 056e6f1c489477cb7e1c285924e88f8f02e5918b /storage/xtradb/buf/buf0flu.cc | |
| parent | 2395adfbfd6b4425981053f074865769414b5614 (diff) | |
| parent | ef2e51c39637ace64b66fa82b834e31f0e4ef38a (diff) | |
| download | mariadb-git-8e8d42ddf0291b2364fef8e3224e65d596ef4202.tar.gz | |
Merge branch '10.0' into 10.1
Diffstat (limited to 'storage/xtradb/buf/buf0flu.cc')
| -rw-r--r-- | storage/xtradb/buf/buf0flu.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 7f5d3548acf..b1a0f2daa21 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -2861,7 +2861,10 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( when SRV_SHUTDOWN_CLEANUP is set other threads like the master and the purge threads may be working as well. We start flushing the buffer pool but can't be sure that no new pages are being - dirtied until we enter SRV_SHUTDOWN_FLUSH_PHASE phase. */ + dirtied until we enter SRV_SHUTDOWN_FLUSH_PHASE phase. Because + the LRU manager thread is also flushing at SRV_SHUTDOWN_CLEANUP + but not SRV_SHUTDOWN_FLUSH_PHASE, we only leave the + SRV_SHUTDOWN_CLEANUP loop when the LRU manager quits. */ do { n_flushed = page_cleaner_do_flush_batch(PCT_IO(100), LSN_MAX); @@ -2870,7 +2873,10 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( if (n_flushed == 0) { os_thread_sleep(100000); } - } while (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP); + + os_rmb; + } while (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP + || buf_lru_manager_is_active); /* At this point all threads including the master and the purge thread must have been suspended. */ @@ -2887,6 +2893,11 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)( buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST); buf_flush_wait_LRU_batch_end(); +#ifdef UNIV_DEBUG + os_rmb; + ut_ad(!buf_lru_manager_is_active); +#endif + bool success; do { @@ -2965,6 +2976,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)( } buf_lru_manager_is_active = false; + os_wmb; /* We count the number of threads in os_thread_exit(). A created thread should always use that to exit and not use return() to exit. */ |
