MDEV-30227 [ERROR] [FATAL] InnoDB: fdatasync() returned 9

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
This commit is contained in:
Marko Mäkelä 2022-12-15 12:45:26 +02:00
parent 03fee585c1
commit 92ff7bb63f

View file

@ -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();
}
}