Skip to content
Permalink
Browse files
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 118e258
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.
  • Loading branch information
dr-m committed Nov 3, 2020
1 parent 95fcd56 commit 90f43d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
@@ -0,0 +1,5 @@
[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 */

0 comments on commit 90f43d2

Please sign in to comment.