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 118e258aaa
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.
This commit is contained in:
Marko Mäkelä 2020-11-03 12:41:41 +02:00
parent 95fcd567bd
commit 90f43d260e
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
[read-ahead]
--innodb-random-read-ahead=ON
[normal]
--innodb-random-read-ahead=OFF

View file

@ -431,7 +431,7 @@ no_read_ahead:
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 */