Commit 9f74c82f authored by Jan Lindström's avatar Jan Lindström

MDEV-5355: InnoDB assertion at shutdown if posix_fallocate is used in...

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.
parent 42300bdd
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment