diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-08-20 11:01:47 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-08-20 11:01:47 +0300 |
commit | 2fa9f8c53a80e8b52c14d8c3260b18e7e77cc154 (patch) | |
tree | e1e69ba81d7dd1b170b8572edc6e7625b38567b8 /storage/innobase/buf | |
parent | f8bf5b0f8431493975f8f4488d0bef6e0e4e289e (diff) | |
parent | de0e7cd72a6e071aba686178a8ff461dd5a757f5 (diff) | |
download | mariadb-git-2fa9f8c53a80e8b52c14d8c3260b18e7e77cc154.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 24 | ||||
-rw-r--r-- | storage/innobase/buf/buf0flu.cc | 4 |
2 files changed, 18 insertions, 10 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 905c04fa811..51b67237f22 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -5615,9 +5615,21 @@ buf_page_create( && block->index); if (drop_hash_entry) { - mutex_enter(&block->mutex); - buf_page_set_sticky(&block->page); - mutex_exit(&block->mutex); + /* Avoid a hang if I/O is going on. Release + the buffer pool mutex and page hash lock + and wait for I/O to complete */ + while (buf_block_get_io_fix(block) != BUF_IO_NONE) { + block->fix(); + buf_pool_mutex_exit(buf_pool); + rw_lock_x_unlock(hash_lock); + + os_thread_yield(); + + buf_pool_mutex_enter(buf_pool); + rw_lock_x_lock(hash_lock); + block->unfix(); + } + rw_lock_x_lock(&block->lock); } #endif /* Page can be found in buf_pool */ @@ -5628,11 +5640,7 @@ buf_page_create( #ifdef BTR_CUR_HASH_ADAPT if (drop_hash_entry) { btr_search_drop_page_hash_index(block); - buf_pool_mutex_enter(buf_pool); - mutex_enter(&block->mutex); - buf_page_unset_sticky(&block->page); - mutex_exit(&block->mutex); - buf_pool_mutex_exit(buf_pool); + rw_lock_x_unlock(&block->lock); } #endif /* BTR_CUR_HASH_ADAPT */ diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 9b49b9570e2..45c9b661d6f 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -3079,7 +3079,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(void*) /* The page_cleaner skips sleep if the server is idle and there are no pending IOs in the buffer pool and there is work to do. */ - if (srv_check_activity(&last_activity) + if (srv_check_activity(last_activity) || buf_get_n_pending_read_ios() || n_flushed == 0) { @@ -3171,7 +3171,7 @@ DECLARE_THREAD(buf_flush_page_cleaner_coordinator)(void*) n_flushed = n_flushed_lru + n_flushed_list; - } else if (srv_check_activity(&last_activity)) { + } else if (srv_check_activity(last_activity)) { ulint n_to_flush; lsn_t lsn_limit = 0; |