mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
MDEV-5355: InnoDB assertion at shutdown if posix_fallocate is used in ut_a(node->n_pending == 0 || node->space->stop_new_ops);
Analysis: When filespace is extended there is first prepare for IO. But if posix_fallocate is used there was no complete IO causing assertion at shutdown indicating that all IO is not finished. Fix: If posix_fallocate is used to extend the filespace, there is no need to wait for IO to complete, thus we treat this operation as a read operation. We need to mark IO as completed or there would be assertion on shutdown at fil_node_close_file() because all pending IO is not finished.
This commit is contained in:
parent
fb2de58294
commit
57a70a635a
1 changed files with 8 additions and 2 deletions
|
@ -5027,10 +5027,16 @@ fil_extend_space_to_desired_size(
|
|||
|
||||
mem_free(buf2);
|
||||
|
||||
fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
|
||||
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
complete_io:
|
||||
/* If posix_fallocate was used to extent the file space
|
||||
we need to complete the io. Because no actual writes were
|
||||
dispatched read operation is enough here. Without this
|
||||
there will be assertion at shutdown indicating that
|
||||
all IO is not completed. */
|
||||
fil_node_complete_io(node, fil_system, OS_FILE_READ);
|
||||
#else
|
||||
fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
|
||||
#endif
|
||||
|
||||
*actual_size = space->size;
|
||||
|
|
Loading…
Reference in a new issue