Skip to content

Commit

Permalink
MDEV-30227 [ERROR] [FATAL] InnoDB: fdatasync() returned 9
Browse files Browse the repository at this point in the history
fil_space_t::flush<false>(): If the CLOSING flag is set,
the file may already have been closed, resulting in EBADF
being returned by fdatasync(). In any case, the
thread that had set the flag should take care of invoking
os_file_flush_func().

The crash occurred during the execution of FLUSH TABLES...FOR EXPORT.

Tested by: Matthias Leich
  • Loading branch information
dr-m committed Dec 15, 2022
1 parent 03fee58 commit 92ff7bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storage/innobase/include/fil0fil.h
Original file line number Diff line number Diff line change
Expand Up @@ -1469,9 +1469,10 @@ template<bool have_reference> inline void fil_space_t::flush()
}
else if (have_reference)
flush_low();
else if (!(acquire_low() & STOPPING))
else
{
flush_low();
if (!(acquire_low() & (STOPPING | CLOSING)))
flush_low();
release();
}
}
Expand Down

0 comments on commit 92ff7bb

Please sign in to comment.