Commit a710016d authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27967 Assertion !buf_pool.any_io_pending() failed

The test innodb.log_file_size would occasionally crash in
a debug assertion failure in srv_prepare_to_delete_redo_log_file().
In the core dump, the assertion would hold.

buf_pool_t::any_io_pending(): Avoid dirty reads by acquiring
buf_pool.mutex. This function is only being invoked in debug builds,
so we do not care about any performance impact.
parent 9af4c7c6
...@@ -2042,9 +2042,14 @@ class buf_pool_t ...@@ -2042,9 +2042,14 @@ class buf_pool_t
buf_tmp_buffer_t *io_buf_reserve() { return io_buf.reserve(); } buf_tmp_buffer_t *io_buf_reserve() { return io_buf.reserve(); }
/** @return whether any I/O is pending */ /** @return whether any I/O is pending */
bool any_io_pending() const bool any_io_pending()
{ {
return n_pend_reads || n_flush_LRU() || n_flush_list(); if (n_pend_reads)
return true;
mysql_mutex_lock(&mutex);
const bool any_pending{n_flush_LRU_ || n_flush_list_};
mysql_mutex_unlock(&mutex);
return any_pending;
} }
/** @return total amount of pending I/O */ /** @return total amount of pending I/O */
ulint io_pending() const ulint io_pending() const
......
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