Bug #69424 '/dev/sdb1' not a regular file
Submitted: 7 Jun 2013 11:57 Modified: 2 Dec 2013 20:42
Reporter: Christian Rabe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.6.12 OS:Linux (Debian Wheezy)
Assigned to: CPU Architecture:Any
Tags: innodb, raw device, regression

[7 Jun 2013 11:57] Christian Rabe
Description:
We got this problem while upgrading our mysql from 5.5 to 5.6

InnoDB refuses to use the existing raw device.
Configuring newraw does nothing either. It seems not even to try to create the new raw partition.

System: Debian Wheezy
Mysql: Debian package 5.6.12
InnoDB using a raw partition.

config line:
innodb_data_file_path=/dev/sdb1:270Graw

The Device is a 300GB SAS drive, dedicated to and already running with innodb.
So no "you didn't calculate the size correctly" please *g*

Everything worked fine up to the upgrade to 5.6.12 (from 5.5.31-0+wheezy1 (Debian))

error-log:
2013-06-06 14:48:06 15886 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-06 14:48:06 15886 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-06-06 14:48:06 15886 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-06 14:48:06 15886 [Note] InnoDB: Using Linux native AIO
2013-06-06 14:48:06 15886 [Note] InnoDB: Using CPU crc32 instructions
2013-06-06 14:48:06 15886 [Note] InnoDB: Initializing buffer pool, size = 56.0G
2013-06-06 14:48:08 15886 [Note] InnoDB: Completed initialization of buffer pool
2013-06-06 14:48:08 15886 [ERROR] InnoDB: '/dev/sdb1' not a regular file.
2013-06-06 14:48:08 15886 [ERROR] InnoDB: The system tablespace must be writable!
2013-06-06 14:48:08 15886 [ERROR] Plugin 'InnoDB' init function returned error.
2013-06-06 14:48:08 15886 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2013-06-06 14:48:08 15886 [ERROR] Unknown/unsupported storage engine: InnoDB

How to repeat:
Take a Debian Wheezy server, install the mysql-package:
http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.12-debian6.0-x86_64.deb/from/http:/...

Try to configure a raw partition. 
Look into the error log.

Suggested fix:
No clue :( Only known workaround for us atm is not to use 5.6 :|
[26 Jun 2013 7:39] Valeriy Kravchuk
I wonder what this regression bug is waiting for? It is easy to verify, like this:

[openxs@chief 5.5]$ su -c "bin/mysqld_safe --no-defaults --user=root --datadir=/tmp/data --innodb_data_home_dir= --innodb_data_file_path=/dev/sda3:2Graw --socket=/tmp/mysql.sock &"
Password:
[openxs@chief 5.5]$ 130626 10:33:01 mysqld_safe Logging to '/tmp/data/chief.err'.
130626 10:33:01 mysqld_safe Starting mysqld daemon with databases from /tmp/data

[openxs@chief 5.5]$ bin/mysql --no-defaults -uroot test                         Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.32 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create table t1(c1 int) engine=InnoDB;
Query OK, 0 rows affected (0.12 sec)

mysql> show create table t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `c1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

mysql> show variables like 'innodb_data_file%';
+-----------------------+-----------------+
| Variable_name         | Value           |
+-----------------------+-----------------+
| innodb_data_file_path | /dev/sda3:2Graw |
+-----------------------+-----------------+
1 row in set (0.00 sec)

mysql> exit
Bye

So, 5.5.32 allowed to use raw device and create InnoDB table on it. Now, let's "upgrade" to 5.6.12: 

[openxs@chief 5.5]$ bin/mysqladmin --no-defaults -uroot shutdown                [openxs@chief 5.5]$ 130626 10:34:05 mysqld_safe mysqld from pid file /tmp/data/chief.pid ended
[openxs@chief 5.5]$ cd ../5.6
[openxs@chief 5.6]$ su -c "bin/mysqld_safe --no-defaults --user=root --datadir=/tmp/data --innodb_data_home_dir= --innodb_data_file_path=/dev/sda3:2Graw --socket=/tmp/mysql.sock &"
Password:
[openxs@chief 5.6]$ 130626 10:34:30 mysqld_safe Logging to '/tmp/data/chief.err'.
130626 10:34:30 mysqld_safe Starting mysqld daemon with databases from /tmp/data
130626 10:34:30 mysqld_safe mysqld from pid file /tmp/data/chief.pid ended

[openxs@chief 5.6]$ tail -100 /tmp/data/chief.err                               
...
130626 10:33:02 InnoDB: 5.5.32 started; log sequence number 1595669
130626 10:33:02 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130626 10:33:02 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130626 10:33:02 [Note] Server socket created on IP: '0.0.0.0'.
130626 10:33:02 [Note] Event Scheduler: Loaded 0 events
130626 10:33:02 [Note] /home/openxs/dbs/5.5/bin/mysqld: ready for connections.
Version: '5.5.32'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
130626 10:34:01 [Note] /home/openxs/dbs/5.5/bin/mysqld: Normal shutdown

130626 10:34:01 [Note] Event Scheduler: Purging the queue. 0 events
130626 10:34:03  InnoDB: Starting shutdown...
130626 10:34:05  InnoDB: Shutdown completed; log sequence number 1597314
130626 10:34:05 [Note] /home/openxs/dbs/5.5/bin/mysqld: Shutdown complete

130626 10:34:05 mysqld_safe mysqld from pid file /tmp/data/chief.pid ended
130626 10:34:30 mysqld_safe Starting mysqld daemon with databases from /tmp/data
2013-06-26 10:34:30 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-06-26 10:34:30 4372 [Note] Plugin 'FEDERATED' is disabled.
2013-06-26 10:34:30 4372 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-26 10:34:30 4372 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-06-26 10:34:30 4372 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-26 10:34:30 4372 [Note] InnoDB: Using Linux native AIO
2013-06-26 10:34:30 4372 [Note] InnoDB: Not using CPU crc32 instructions
2013-06-26 10:34:30 4372 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-06-26 10:34:30 4372 [Note] InnoDB: Completed initialization of buffer pool
2013-06-26 10:34:30 4372 [ERROR] InnoDB: '/dev/sda3' not a regular file.
2013-06-26 10:34:30 4372 [ERROR] InnoDB: The system tablespace must be writable!
2013-06-26 10:34:30 4372 [ERROR] Plugin 'InnoDB' init function returned error.
2013-06-26 10:34:30 4372 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2013-06-26 10:34:30 4372 [ERROR] Unknown/unsupported storage engine: InnoDB
2013-06-26 10:34:30 4372 [ERROR] Aborting

2013-06-26 10:34:30 4372 [Note] Binlog end
2013-06-26 10:34:30 4372 [Note] Shutting down plugin 'partition'
...
2013-06-26 10:34:30 4372 [Note] Shutting down plugin 'sha256_password'
2013-06-26 10:34:30 4372 [Note] Shutting down plugin 'mysql_old_password'
2013-06-26 10:34:30 4372 [Note] Shutting down plugin 'mysql_native_password'
2013-06-26 10:34:30 4372 [Note] Shutting down plugin 'binlog'
2013-06-26 10:34:30 4372 [Note] /home/openxs/dbs/5.6/bin/mysqld: Shutdown complete

130626 10:34:30 mysqld_safe mysqld from pid file /tmp/data/chief.pid ended
[27 Jun 2013 12:16] MySQL Verification Team
FYI 5.5.32->5.6.12 + raw partition, it works okay on Windows...
[27 Jun 2013 13:12] MySQL Verification Team
Thank you for the bug report.
[2 Dec 2013 20:42] Daniel Price
Fixed as of 5.6.16, 5.7.4 and noted in 5.6.16, 5.7.4 changelogs.

The function "os_file_get_status" would not work with raw devices.

Thank you for the bug report.
[3 Feb 2014 10:59] Laurynas Biveinis
5.6$ bzr log -r 5664
------------------------------------------------------------
revno: 5664
committer: Annamalai Gurusami <annamalai.gurusami@oracle.com>
branch nick: mysql-5.6
timestamp: Mon 2013-12-02 13:52:59 +0530
message:
  Bug #17023438 '/DEV/SDB1' NOT A REGULAR FILE
  
  Problem:
  
  The function os_file_get_status() does not handle the raw block devices.
  
  Solution:
  
  Updated the function os_file_get_status() to handle the raw block devices.
  
  rb#3989 approved by Jimmy.