XtraDB assertion at shutdown if posix_fallocate is used in ut_a(node->n_pending == 0 || node->space->stop_new_ops);

Bug #1255628 reported by Jan Lindström on 2013-11-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Laurynas Biveinis
Fix Released
Laurynas Biveinis
Fix Released
Laurynas Biveinis

Bug Description

This bug happens if you use posix_fallocate to extent filespace (e.g. on FusionIO ssd drive)


lp:maria/5.5 revno 3988

Suggested fix:

=== modified file 'storage/xtradb/fil/fil0fil.c'
--- storage/xtradb/fil/fil0fil.c 2013-11-19 14:43:22 +0000
+++ storage/xtradb/fil/fil0fil.c 2013-11-27 18:22:20 +0000
@@ -5027,10 +5027,16 @@ fil_extend_space_to_desired_size(


- fil_node_complete_io(node, fil_system, OS_FILE_WRITE);
+ /* 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);
+ fil_node_complete_io(node, fil_system, OS_FILE_WRITE);

  *actual_size = space->size;

Related branches

Jan Lindström (jplindst) wrote :

Affected versions 5.5 and 5.6

affects: percona-xtrabackup → percona-xtradb
affects: percona-xtradb → percona-server
tags: added: contribution low-hanging-fruit xtradb

Jan -

Thank you for the bug report and the patch provided.

Looking at which, what about the case where HAVE_POSIX_FALLOCATE is defined but server is running with srv_use_posix_fallocate == FALSE? Then we'd perform actual writes to extend the tablespace but with the patch applied end up calling fil_node_complete_io() with OS_FILE_READ instead of OS_FILE_WRITE? It looks to me that "if (srv_use_posix_fallocate)" guard is required there too?

Jan Lindström (jplindst) wrote :

Yes, you are correct on this.

Jan -

I am testing the following then:

=== modified file 'Percona-Server/storage/innobase/fil/fil0fil.c'
--- Percona-Server/storage/innobase/fil/fil0fil.c 2013-09-24 12:47:59 +0000
+++ Percona-Server/storage/innobase/fil/fil0fil.c 2013-11-29 07:26:52 +0000
@@ -4967,6 +4967,7 @@
    space->size += (size_after_extend - start_page_no);
    os_has_said_disk_full = FALSE;
+ fil_node_complete_io(node, fil_system, OS_FILE_READ);
   goto complete_io;

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-744

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers