Percona Server with XtraDB

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

Reported by Jan Lindström on 2013-11-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server
Status tracked in 5.6
5.1
Undecided
Unassigned
5.5
High
Laurynas Biveinis
5.6
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;

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

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

Other bug subscribers