diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-12-15 12:45:26 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-12-15 12:45:26 +0200 |
commit | 92ff7bb63fee54a932ca0b7d8092af5aac1ded57 (patch) | |
tree | 8e2b5c1aa4718f4ed7aebc2b0283f0b59b0bb803 | |
parent | 03fee585c12cb6bc9e2e03b9c182fa4c6dad88b7 (diff) | |
download | mariadb-git-92ff7bb63fee54a932ca0b7d8092af5aac1ded57.tar.gz |
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
-rw-r--r-- | storage/innobase/include/fil0fil.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index bcbcb02ccdb..af941e359f8 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -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(); } } |