Failed to set O_DIRECT when using tmpfs

1291 views
Skip to first unread message

Andrea Usuelli

unread,
Jul 2, 2010, 2:13:30 PM7/2/10
to Percona Dev
Hi, I switched to Percona from MySQL 5.5 a couple of days ago, I only
have a problem, the error log is full of these:

100702 20:00:01 InnoDB: Failed to set O_DIRECT on file /dev/mysqltemp/
#sql12ff_13a_1.ibd: OPEN: Invalid argument, continuing anyway
100702 20:00:01 InnoDB: O_DIRECT is known to result in 'Invalid
argument' on Linux on tmpfs, see MySQL Bug#26662

The bug which the error is referring to should be solved (I was using
the same configuration with MySQL 5.5 and I didn't have these errors).
Am I doing something wrong here or is this a Percona bug?

my.cnf:
tmpdir = /dev/mysqltmp

mount: tmpfs on /dev/mysqltmp type tmpfs
(rw,size=512M,nr_inodes=10k,mode=0700)

Percona version: 5.1.47-rel11.1 x64 on Ubuntu 10.04

Thank you,
Andrea

Vadim Tkachenko

unread,
Jul 2, 2010, 2:20:25 PM7/2/10
to perco...@googlegroups.com
Andrea,

This bug exists in stock MySQL-5.1, which we base our releases on.

Thanks,
Vadim

> --
> You received this message because you are subscribed to the Google Groups "Percona Dev" group.
> To post to this group, send email to perco...@googlegroups.com.
> To unsubscribe from this group, send email to percona-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/percona-dev?hl=en.
>
>

--
Vadim Tkachenko, CTO, Percona Inc.
Phone +1-888-401-3403, Skype: vadimtk153
Schedule meeting: http://tungle.me/VadimTkachenko

Percona Training Workshops
http://www.percona.com/training/

Andrea Usuelli

unread,
Jul 2, 2010, 3:14:11 PM7/2/10
to Percona Dev
Hi Vadim,

mmmm, looks like it should be solved in 5.1.47: http://bugs.mysql.com/bug.php?id=26662
isn't it?

Thanks,
Andrea
> > For more options, visit this group athttp://groups.google.com/group/percona-dev?hl=en.

Vadim Tkachenko

unread,
Jul 2, 2010, 3:20:14 PM7/2/10
to perco...@googlegroups.com, Oleg Tsarev
Andrea,

It seems solved in stock InnoDB, but not in InnoDB-plugin..

Anyway, I agree - we should have this bug fix.

Oleg, please report bug and include patch.


Thanks,
Vadim

> For more options, visit this group at http://groups.google.com/group/percona-dev?hl=en.

Andrea Usuelli

unread,
Jul 3, 2010, 12:26:15 PM7/3/10
to Percona Dev
Perfect, thanks!

On 2 Lug, 21:20, Vadim Tkachenko <va...@percona.com> wrote:
> Andrea,
>

Vadim Tkachenko

unread,
Jul 3, 2010, 6:31:47 PM7/3/10
to Oleg Tsarev, Andrea Usuelli, perco...@googlegroups.com
Oleg,

You should point tmpdir to shmfs
and force InnoDB to create temporary file.


On Sat, Jul 3, 2010 at 3:20 PM, Oleg Tsarev <oleg....@percona.com> wrote:
> Hello,
>
> I can't reproduce this bug.
>
> tsarev@main:/storage/project/percona/mysql-bench$ sudo mount |grep mysql
> tmpfs on /dev/mysqltmp type tmpfs (rw)
> tsarev@main:/storage/project/percona/mysql-bench$ cat etc/my.cnf | grep tmp
> datadir         = /dev/mysqltmp/var
> tmpdir          = /dev/mysqltmp/tmp
> tsarev@main:/storage/project/percona/mysql-bench$ cat /etc/issue
> Ubuntu maverick (development branch) \n \l
>
> tsarev@main:/storage/project/percona/mysql-bench$ uname -a
> Linux main 2.6.35-6-generic #9-Ubuntu SMP Thu Jul 1 03:01:23 UTC 2010 x86_64 GNU/Linux
>
> mysql> use mysql;
> mysql> create temporary table o_direct_test like user;
> Query OK, 0 rows affected (0,00 sec)
>
> Can you provide additional information about the trouble?
>
> Thank you, Oleg.

Vadim Tkachenko

unread,
Jul 3, 2010, 7:26:42 PM7/3/10
to Oleg Tsarev, Andrea Usuelli, perco...@googlegroups.com
Oleg,

The steps are
in
http://bugs.mysql.com/bug.php?id=26662

and you should check error.log to see error message.


On Sat, Jul 3, 2010 at 3:37 PM, Oleg Tsarev <oleg....@percona.com> wrote:
> tsarev@main:/storage/project/percona/mysql-bench$ sudo mount -t tmpfs shmfs /dev/mysqltmp/
> tsarev@main:/storage/project/percona/mysql-bench$ mkdir /dev/mysqltmp/tmp
> tsarev@main:/storage/project/percona/mysql-bench$ ./libexec/mysqld --defaults-file=./etc/my.cnf --verbose
> 100704  2:34:53 [Warning] One can only use the --user switch if running as root
> tsarev@main:/storage/project/percona/mysql-bench$ cat etc/my.cnf
> [client]
> port            = 9999
> socket          = /home/tsarev/mysqld.socket
> [mysqld_safe]
> socket          = /home/tsarev/mysqld.sock
> nice            = 0
> [mysqld]
> user            = root
> socket          = /home/tsarev/mysqld.socket
> port            = 9999
> basedir         = /storage/project/percona/mysql-bench
> datadir         = /storage/project/percona/mysql-bench/var
> tmpdir          = /dev/mysqltmp/tmp
> skip-external-locking
> bind-address            = 127.0.0.1
> log_error                = /home/tsarev/mysqld-error.log
> tsarev@main:/storage/project/percona/mysql-bench$ mysql --socket=/home/tsarev/mysqld.socket --user=root
> Welcome to the MySQL monitor.  Commands end with ; or \g.
> Your MySQL connection id is 2
> Server version: 5.1.48 Source distribution
>
> Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
> This software comes with ABSOLUTELY NO WARRANTY. This is free software,
> and you are welcome to modify and redistribute it under the GPL v2 license
>
> Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
>
> mysql> use mysql;
> 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 temporary table o_direct like user;

Reply all
Reply to author
Forward
0 new messages