Bug #64988 FLUSH LOGS failed when large_pages is on
Submitted: 15 Apr 2012 22:10 Modified: 24 Apr 2012 19:06
Reporter: Don Hui Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.5.23 OS:Linux
Assigned to: CPU Architecture:Any
Tags: flush logs, large_page

[15 Apr 2012 22:10] Don Hui
Description:
If I turn on large_pages support I'm having a problem with flushing logs:

mysql> flush logs;
ERROR 1105 (HY000): Unknown error

I can see that there is a new file created in /var/log/mysql with new number, but I don't know why mysql reports unknown error.

If I turn large_pages off flush logs works correctly.

Please suggest what to do.

I'm on Debian 6 squeeze stable with MySQL-5.5 compiled from dotdeb.org.

Server version: 5.5.23-1~dotdeb.0-log

For large pages I did add following to sysctl.conf:

#MySQL & Huge Pages

# Set the number of pages to be used.
# Each page is normally 2MB, so a value of 40 = 80MB.
# Set it 512 or higher if you have lots of memory
vm.nr_hugepages=9000

# Set the group number (mysql group number is 106) that is allowed to access this memory. The mysql user must be a member of this group.
vm.hugetlb_shm_group=106

# Increase the amount of shmem allowed per segment
# This depends upon your memory, remember your
kernel.shmmax = 19327352832

# Increase total amount of shared memory.
kernel.shmall = 9437184

How to repeat:
Turn on large_pages support and try to flush logs.
[15 Apr 2012 23:15] Don Hui
my.cnf

Attachment: my.cnf (application/octet-stream, text), 5.88 KiB.

[17 Apr 2012 10:23] Valeriy Kravchuk
I can not repeat this with current 5.5.24 on 64-bit FC14:

[openxs@chief 5.5]$ bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.24-debug-log Source distribution

Copyright (c) 2000, 2011, 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> show variables like 'large%';
+---------------------+---------+
| Variable_name       | Value   |
+---------------------+---------+
| large_files_support | ON      |
| large_page_size     | 2097152 |
| large_pages         | ON      |
+---------------------+---------+
3 rows in set (0.00 sec)

mysql> flush logs;
Query OK, 0 rows affected (0.12 sec)

mysql> exit
Bye
[openxs@chief 5.5]$ ls -l data/
total 151636
-rw-rw----  1 openxs openxs       150 Apr 17 13:21 chief-bin.000001
-rw-rw----  1 openxs openxs       107 Apr 17 13:21 chief-bin.000002
-rw-rw----  1 openxs openxs        38 Apr 17 13:21 chief-bin.index
-rw-rw----. 1 openxs openxs     47477 Apr 17 13:20 chief.err
-rw-rw----  1 openxs openxs         5 Apr 17 13:20 chief.pid
-rw-rw----. 1 openxs openxs 144703488 Apr 17 11:37 ibdata1
-rw-rw----. 1 openxs openxs   5242880 Apr 17 13:20 ib_logfile0
-rw-rw----. 1 openxs openxs   5242880 Apr 17 13:20 ib_logfile1
drwxrwxr-x. 2 openxs openxs      4096 Apr 13 11:23 mysql
drwx------. 2 openxs openxs      4096 Mar 12  2011 performance_schema
drwxrwxr-x. 2 openxs openxs      4096 Apr 13 11:23 test
[openxs@chief 5.5]$ uname -a
Linux chief 2.6.35.14-106.fc14.x86_64 #1 SMP Wed Nov 23 13:07:52 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
[17 Apr 2012 10:52] Don Hui
could you please try with my.cnf?

Thanks
[17 Apr 2012 18:31] Sveta Smirnova
Thank you for the feedback.

I can not repeat specified behavior with your configuration file too.

Please try our binaries available from dev.mysql.com/downloads to be sure this is not Debian port issue.
[17 Apr 2012 21:58] Don Hui
Hello!

I've tested on our other server. It seems to be a server issue, but I can't figure it out yet.

Here is the results from the another server with less memory (8GB there, I used 5000M for InnoDB pool, all other configuration variables are the same.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.5.23-1~dotdeb.0-log (Debian)

Copyright (c) 2000, 2011, 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> flush logs;
Query OK, 0 rows affected (0.74 sec)

mysql> show variables like '%large_page%';
+-----------------+---------+
| Variable_name   | Value   |
+-----------------+---------+
| large_page_size | 2097152 |
| large_pages     | ON      |
+-----------------+---------+
2 rows in set (0.00 sec)

The software is identical.

Here is how I configured huge-tlb support here:

vm.nr_hugepages=2700

# Set the group number (mysql group number is 113) that is allowed to access this memory. The mysql user must be a member of this group.
vm.hugetlb_shm_group=113

# Increase the amount of shmem allowed per segment
# This depends upon your memory, remember your
#kernel.shmmax = 19327352832
kernel.shmmax = 6488588288
# Increase total amount of shared memory.
#kernel.shmall = 9437184
kernel.shmall = 3168256

+ I've added this to /etc/security/limits.conf:

@mysql soft memlock         unlimited
@mysql hard    memlock         unlimited

(this entry is also on the buggy server).

I'm gonna test this with less memory / InnoDB pool on buggy serverand report back.

Thanks.
[18 Apr 2012 18:39] Sveta Smirnova
Thank you for the feedback.

Please update this report if you find this can be bug in MySQL code.
[20 Apr 2012 10:35] Don Hui
OK, I just tried on a completely different box with almost the same configuration with exception that memory pool allocated for big pages was 14G this time.

I had the same 'Unknown Error' while flushing logs.

I'm gonna try now binary from MySQL site 5.5.23 x64 for Debian.
[20 Apr 2012 10:53] Don Hui
Just checked on MySQL-5.5.23 (for Debian x64 6.0) - works fine here with the same configuration, except I had to manually specify --language= and omit log-error.

So it seems there is an issue with dotdeb.org package, sorry for wasting your time.

Is there any way I can debug this 'Unknown Error' thing on dotdeb package?

i have another question (maybe a bit offtopic), but is there a good stable build of MySQL-5.5 for debian 6.0?

the build from the site seems to be installing everything in /opt not very good solution, and everything there libs / headers / etc.
[24 Apr 2012 18:22] Sveta Smirnova
Thank you for the feedback.

> Is there any way I can debug this 'Unknown Error' thing on dotdeb package?

As this is not our build you need to create bug at Debian or use gdb and good knowledge of MySQL sources to debug this error.

> i have another question (maybe a bit offtopic), but is there a good stable build of
> MySQL-5.5 for debian 6.0?
> 
> the build from the site seems to be installing everything in /opt not
> very good solution, and everything there libs / headers / etc.

Our recommended build is our Debian build. If you think it is not good enough write a feature request, so our build team can consider this change.
[24 Apr 2012 19:06] Don Hui
Regarding your build, would be good to have separate packages and repository for Debian squeeze, just like dotdeb is doing right now and not using /opt.

About this bug - I emailed author of dotdeb packaging scripts he didn't get back to me asap.

Where should I write a feature request?
[24 Apr 2012 19:08] Sveta Smirnova
Same place: bugs.mysql.com. Just choose S4 as "Severity"