It's possible to have innodb_open_files>open_files_limit and it can crash Percona Server
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
New
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
High
|
Unassigned | |||
5.7 |
Fix Released
|
High
|
Unassigned |
Bug Description
(As reported in http://
Description:
It's possible to have innodb_
+------
| Variable_name | Value |
+------
| innodb_open_files | 16384 |
| open_files_limit | 8510 |
+------
Having open_files_limit < innodb_open_files is not normal, it only seems to be possible to configure it like this when innodb_
With MySQL 5.6.27 (coming from a production environment), you get the following crash::
```
2015-10-27 10:20:33 5535 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 11015335, page no 0, i/o length 16384 bytes
2015-10-27 10:20:33 7fa725a05700 InnoDB: Error: trying to access tablespace 11015335 page no. 0,
InnoDB: but the tablespace does not exist or is just being dropped.
2015-10-27 10:20:33 7fa725a05700 InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means 'Too many open files'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://
2015-10-27 10:20:33 7fa725a05700201
. InnoDB: Have you deleted .ibd files under a running mysqld server?
...
2015-10-27 10:20:33 5535 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 11015335, page no 0, i/o length 16384 bytes
2015-10-27 10:20:33 7fa725a05700 InnoDB: Error: trying to access tablespace 11015335 page no. 0,
InnoDB: but the tablespace does not exist or is just being dropped.
2015-10-27 10:20:33 7fa725a05700 InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means 'Too many open files'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://
2015-10-27 10:20:33 7fa725a05700201
. InnoDB: Have you deleted .ibd files under a running mysqld server?
2015-10-27 10:20:33 5535 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 11015335, page no 0, i/o length 16384 bytes
2015-10-27 10:20:33 7fa725a05700 InnoDB: Error: trying to access tablespace 11015335 page no. 0,
InnoDB: but the tablespace does not exist or is just being dropped.
InnoDB: Error: Unable to read tablespace 11015335 page no 0 into the buffer pool after 100 attempts
InnoDB: The most probable cause of this error may be that the table has been corrupted.
InnoDB: You can try to fix this problem by using innodb_
InnoDB: Please see reference manual for more details.
InnoDB: Aborting...
2015-10-27 10:20:33 7fa725a05700 InnoDB: Assertion failure in thread 140355867531008 in file buf0buf.cc line 2740
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://
InnoDB: about forcing recovery.
09:20:33 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_
read_buffer_
max_used_
max_threads=500
thread_count=41
connection_count=40
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7fa7193dfc40
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 = 7fa725a04e38 thread_stack 0x40000
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
/lib64/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (147612830): show table status like 'event\_log\_1310'
Connection ID (thread ID): 104064
Status: NOT_KILLED
The manual page at http://
information that should help you find out what is causing the crash.
```
How to repeat:
Script to Reproduce:
```
#!/bin/bash
# configure mysql with the following settings (doublecheck innodb_
#+-----
#| Variable_name | Value |
#+-----
#| innodb_open_files | 16384 |
#| open_files_limit | 16384 |
#+-----
mysqladmin create test
unionquery="SELECT 1"
# creating many files here (innodb_
for tables in `seq 1 1 10`; do
mysql -e "create table Stolen$tables (a int) partition by hash(a) partitions 1024;" test
unionquery=
done
echo "now remove open_files_limit from the mysql configuration and restart mysql"
echo "you should have innodb_
echo "+-----
echo "| Variable_name | Value |"
echo "+-----
echo "| innodb_open_files | 16384 |"
echo "| open_files_limit | 5000 |"
echo "+-----
echo "then run the following query:"
echo "$unionquery"
```
Having open_files_limit < innodb_open_files is not normal, it only seems to be possible to configure it like this when innodb_
When you run the query, then in the error log you get the errors and crash of MySQL:
Percona Server 5.6.26 (created with the reproducing script)::
```
2015-10-27 14:16:36 19887 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 63140, page no 3, i/o length 16384 bytes
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Error: trying to access tablespace 63140 page no. 3,
InnoDB: but the tablespace does not exist or is just being dropped.
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means 'Too many open files'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://
2015-10-27 14:16:36 7f70c01d3700201
. InnoDB: Have you deleted .ibd files under a running mysqld server?
...
...
2015-10-27 14:16:36 19887 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 63140, page no 3, i/o length 16384 bytes
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Error: trying to access tablespace 63140 page no. 3,
InnoDB: but the tablespace does not exist or is just being dropped.
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means 'Too many open files'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://
2015-10-27 14:16:36 7f70c01d3700201
. InnoDB: Have you deleted .ibd files under a running mysqld server?
2015-10-27 14:16:36 19887 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 63140, page no 3, i/o length 16384 bytes
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Error: trying to access tablespace 63140 page no. 3,
InnoDB: but the tablespace does not exist or is just being dropped.
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means 'Too many open files'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://
2015-10-27 14:16:36 7f70c01d3700201
. InnoDB: Have you deleted .ibd files under a running mysqld server?
2015-10-27 14:16:36 19887 [ERROR] InnoDB: Trying to do i/o to a tablespace which exists without .ibd data file. i/o type 10, space id 63140, page no 3, i/o length 16384 bytes
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Error: trying to access tablespace 63140 page no. 3,
InnoDB: but the tablespace does not exist or is just being dropped.
InnoDB: Error: Unable to read tablespace 63140 page no 3 into the buffer pool after 100 attempts
InnoDB: The most probable cause of this error may be that the table has been corrupted.
InnoDB: You can try to fix this problem by using innodb_
InnoDB: Please see reference manual for more details.
InnoDB: Aborting...
2015-10-27 14:16:36 7f70c01d3700 InnoDB: Assertion failure in thread 140122236204800 in file buf0buf.cc line 2788
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://
InnoDB: about forcing recovery.
14:16:36 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.
Please help us make Percona Server better by reporting any
bugs at http://
key_buffer_
read_buffer_
max_used_
max_threads=153
thread_count=2
connection_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x3f85dd0
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 = 7f70c01d2d80 thread_stack 0x40000
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
/lib64/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/usr/sbin/
/lib64/
/lib64/
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f708c004d60): is an invalid pointer
Connection ID (thread ID): 4
Status: NOT_KILLED
You may download the Percona Server operations manual by visiting
http://
in the manual which will help you identify the cause of the crash.
151027 14:16:36 mysqld_safe Number of processes running now: 0
```
Suggested fix:
Make sure that innodb_open_files cannot be larger open_files_limit.
tags: | added: upstream |
This bug is verified in upstream