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
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Laurynas Biveinis
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
High
Laurynas Biveinis
5.6
Fix Released
High
Laurynas Biveinis

Bug Description

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

https://mariadb.atlassian.net/browse/MDEV-5355

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(

  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;

Related branches

Revision history for this message
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
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

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?

Revision history for this message
Jan Lindström (jplindst) wrote :

Yes, you are correct on this.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

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;
  }
 #endif

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.