Bug #76827 Assertion failed while creating view after full disk error
Submitted: 24 Apr 2015 13:26 Modified: 26 Jun 2015 10:01
Reporter: Shahriyar Rzayev Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:5.6.24, 5.6.26 OS:Linux (CentOS 6.5)
Assigned to: CPU Architecture:Any

[24 Apr 2015 13:26] Shahriyar Rzayev
Description:
While testing full disk conditions, if we try to import huge dump, we will see:

2015-04-24 09:07:52 7faf8bcab700 InnoDB: Error: Write to file ./sales/sales.ibd failed at offset 247463936.
InnoDB: 1048576 bytes should have been written, only 299008 were written.
InnoDB: Operating system error number 11.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 11 means 'Resource temporarily unavailable'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2015-04-24 09:07:52 28213 [ERROR] /opt/mysql/bin/mysqld: The table 'sales' is full
2015-04-24 09:08:13 28213 [ERROR] /opt/mysql/bin/mysqld: The table 'sales' is full
2015-04-24 09:08:27 28213 [ERROR] /opt/mysql/bin/mysqld: The table 'sales' is full

After detecting Full Disk error, if you try to create view:

mysql> create view f as select * from sales;
ERROR 2013 (HY000): Lost connection to MySQL server during query

From error log:

mysqld: /root/mysql-5.6.24/mysys/mf_iocache.c:1799: my_b_flush_io_cache: Assertion `info->end_of_file == inline_mysql_file_tell("/root/mysql-5.6.24/mysys/mf_iocache.c", 1799, info->file, (myf) (0))' failed.
13:13:48 UTC - mysqld got signal 6 ;

Thread pointer: 0x399bda0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7faf8bcaad20 thread_stack 0x40000
/opt/mysql/bin/mysqld(my_print_stacktrace+0x35)[0xaf3925]
/opt/mysql/bin/mysqld(handle_fatal_signal+0x404)[0x7491a6]
/lib64/libpthread.so.0(+0xf710)[0x7fafb7ced710]
/lib64/libc.so.6(gsignal+0x35)[0x7fafb6334925]
/lib64/libc.so.6(abort+0x175)[0x7fafb6336105]
/lib64/libc.so.6(+0x2ba4e)[0x7fafb632da4e]
/lib64/libc.so.6(__assert_perror_fail+0x0)[0x7fafb632db10]
/opt/mysql/bin/mysqld(my_b_flush_io_cache+0x39a)[0xad0864]
/opt/mysql/bin/mysqld(end_io_cache+0x127)[0xad0a43]
/opt/mysql/bin/mysqld(_Z26sql_create_definition_filePK19st_mysql_lex_stringS1_S1_PhP11File_option+0x365)[0x73c263]
/opt/mysql/bin/mysqld[0x89d204]
/opt/mysql/bin/mysqld(_Z17mysql_create_viewP3THDP10TABLE_LIST21enum_view_create_mode+0xa55)[0x89c244]
/opt/mysql/bin/mysqld(_Z21mysql_execute_commandP3THD+0x73c6)[0x804501]
/opt/mysql/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x423)[0x8081b5]
/opt/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xd15)[0x7fad43]
/opt/mysql/bin/mysqld(_Z10do_commandP3THD+0x34f)[0x7f9dbd]
/opt/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x1be)[0x7beb67]
/opt/mysql/bin/mysqld(handle_one_connection+0x33)[0x7be66f]
/opt/mysql/bin/mysqld(pfs_spawn_thread+0x159)[0xbb79ff]
/lib64/libpthread.so.0(+0x79d1)[0x7fafb7ce59d1]
/lib64/libc.so.6(clone+0x6d)[0x7fafb63eab5d]

How to repeat:
1. Create a full disk error condition
2. Try to create view

Suggested fix:
Should be an error message related to views in this condition
[26 Jun 2015 10:01] MySQL Verification Team
Hello Shahriyar,

Thank you for the bug report.
Observed with 5.6.26 debug build.

Thanks,
Umesh
[26 Jun 2015 10:02] MySQL Verification Team
### with release build

mysql> create view vv1 as select * from t4;
ERROR 3 (HY000): Error writing file './bug77497/vv1.frm~' (Errcode: 28 - No space left on device)
mysql>

## With debug build

mysql> show variables like '%version%';
+-------------------------+---------------------------------------------------------------+
| Variable_name           | Value                                                         |
+-------------------------+---------------------------------------------------------------+
| innodb_version          | 5.6.26                                                        |
| protocol_version        | 10                                                            |
| slave_type_conversions  |                                                               |
| version                 | 5.6.26-enterprise-commercial-advanced-debug                   |
| version_comment         | MySQL Enterprise Server - Advanced Edition Debug (Commercial) |
| version_compile_machine | x86_64                                                        |
| version_compile_os      | linux-glibc2.5                                                |
+-------------------------+---------------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| bug77497           |
| mysql              |
| performance_schema |
| test               |
+--------------------+
5 rows in set (0.00 sec)

mysql> use bug77497
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> create view vv1 as select * from t4;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>

##

2015-06-26 11:57:51 29556 [Note] bin/mysqld-debug: ready for connections.
Version: '5.6.26-enterprise-commercial-advanced-debug'  socket: '/tmp/mysql_ushastry.sock'  port: 15000  MySQL Enterprise Server - Advanced Edition Debug (Commercial)
mysqld-debug: /export/home/pb2/build/sb_0-15519407-1433936768.38/mysqlcom-pro-5.6.26/mysys/mf_iocache.c:1799: my_b_flush_io_cache: Assertion `info->end_of_file == inline_mysql_file_tell("/export/home/pb2/build/sb_0-15519407-1433936768.38/mysqlcom-pro-5.6.26/mysys/mf_iocache.c", 1799, info->file, (myf) (0))' failed.
09:58:27 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68113 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x3f6aba0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fc5a75eee68 thread_stack 0x40000
bin/mysqld-debug(my_print_stacktrace+0x32)[0xae29a0]
bin/mysqld-debug(handle_fatal_signal+0x47a)[0x7463fa]
/lib64/libpthread.so.0(+0xf130)[0x7fc5d1d57130]
/lib64/libc.so.6(gsignal+0x39)[0x7fc5d095a5c9]
/lib64/libc.so.6(abort+0x148)[0x7fc5d095bcd8]
/lib64/libc.so.6(+0x2e536)[0x7fc5d0953536]
/lib64/libc.so.6(+0x2e5e2)[0x7fc5d09535e2]
bin/mysqld-debug(my_b_flush_io_cache+0x368)[0xac75e3]
bin/mysqld-debug(end_io_cache+0x11e)[0xac779d]
bin/mysqld-debug(_Z26sql_create_definition_filePK19st_mysql_lex_stringS1_S1_PhP11File_option+0x385)[0x73b9a9]
bin/mysqld-debug[0x894b03]
bin/mysqld-debug(_Z17mysql_create_viewP3THDP10TABLE_LIST21enum_view_create_mode+0x9c0)[0x895a4c]
bin/mysqld-debug(_Z21mysql_execute_commandP3THD+0x72bf)[0x801cc9]
bin/mysqld-debug(_Z11mysql_parseP3THDPcjP12Parser_state+0x408)[0x802c9a]
bin/mysqld-debug(_Z16dispatch_command19enum_server_commandP3THDPcj+0xcfe)[0x8048be]
bin/mysqld-debug(_Z10do_commandP3THD+0x318)[0x80614a]
bin/mysqld-debug(_Z24do_handle_one_connectionP3THD+0x1ad)[0x7bbb7d]
bin/mysqld-debug(handle_one_connection+0x2d)[0x7bbc43]
bin/mysqld-debug(pfs_spawn_thread+0x18c)[0xb94598]
/lib64/libpthread.so.0(+0x7df3)[0x7fc5d1d4fdf3]
/lib64/libc.so.6(clone+0x6d)[0x7fc5d0a1b47d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fc57c004fd0): create view vv1 as select * from t4
Connection ID (thread ID): 1
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file
Aborted (core dumped)