diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-01 09:13:25 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-01 09:13:25 +0200 |
commit | a710016d578dc1165c511db19a5d4a094e736012 (patch) | |
tree | f4d8badd9ca6a3cbec8dbc0ff97002cf25ed1fbb | |
parent | 9af4c7c6d7420e71f323b7b582c47bc2e43fc68c (diff) | |
download | mariadb-git-a710016d578dc1165c511db19a5d4a094e736012.tar.gz |
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.
-rw-r--r-- | storage/innobase/include/buf0buf.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 89987b05fdb..fec8dcb4e2a 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -2042,9 +2042,14 @@ public: buf_tmp_buffer_t *io_buf_reserve() { return io_buf.reserve(); } /** @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 */ ulint io_pending() const |