Commit 90f43d26 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-24101 innodb_random_read_ahead=ON causes hang on DDL or shutdown

buf_read_ahead_random(): Do not leak a tablespace reference.
The reference was already acquired in fil_space_t::get(),
and we must only check that operations were not stopped.

This error was introduced when
commit 118e258a
merged n_pending_ios, n_pending_ops into a single n_pending.

This was not noticed earlier, because innodb_random_read_ahead
is OFF by default and our regression tests did not vary that
parameter at all.
parent 95fcd567
[read-ahead]
--innodb-random-read-ahead=ON
[normal]
--innodb-random-read-ahead=OFF
......@@ -431,7 +431,7 @@ buf_read_ahead_random(const page_id_t page_id, ulint zip_size, bool ibuf)
return 0;
read_ahead:
if (!space->acquire_if_not_stopped())
if (space->is_stopping())
goto no_read_ahead;
/* Read all the suitable blocks within the area */
......
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