For a while now our MySQL has been crashing daily, sometimes multiple times even. I've troubleshot a lot but nothing seems to help, it's also a live server so I have to be careful with tests/experiments. I even tried cloning the entire server to test more thoroughly, but I'm unable to reproduce the errors on there. So I'm fairly certain it requires at least a certain pressure on the server.

We're on CentOS 6.8 x86_64, running MySQL 5.6.29 (we're unable to upgrade either due to circumstances). It has 8 GB of RAM, usually about 4 GB is "cached" memory with a few 100 MBs that are actually unallocated. All databases run on the built-in version of InnoDB as far as I can tell.

Error logs

The DB and .ibd file in the first line are different every time so it's not that that particular DB/table is corrupt. If it were, the test server would've crashed too.

2017-02-10 02:39:47 24223 [ERROR] InnoDB: Unable to lock ./mydb/field_revision_field_tel_nr_.ibd, error: 37
2017-02-10 02:39:47 2ab04c081700  InnoDB: Assertion failure in thread 46936678209280 in file fil0fil.cc line 875
InnoDB: Failing assertion: ret
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
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://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
01:39:47 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.

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

Thread pointer: 0xf906670
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 = 2ab04c080e10 thread_stack 0x40000

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (2ab054008b90): is an invalid pointer
Connection ID (thread ID): 1435

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.
170210 02:39:48 mysqld_safe Number of processes running now: 0
170210 02:39:48 mysqld_safe mysqld restarted
2017-02-10 02:39:49 0 [Note] /usr/sbin/mysqld (mysqld 5.6.29) starting as process 5207 ...
2017-02-10 02:39:50 5207 [Note] Plugin 'FEDERATED' is disabled.
2017-02-10 02:39:50 5207 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-02-10 02:39:50 5207 [Note] InnoDB: The InnoDB memory heap is disabled
2017-02-10 02:39:50 5207 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-02-10 02:39:50 5207 [Note] InnoDB: Memory barrier is not used
2017-02-10 02:39:50 5207 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-02-10 02:39:50 5207 [Note] InnoDB: Using Linux native AIO
2017-02-10 02:39:50 5207 [Note] InnoDB: Using CPU crc32 instructions
2017-02-10 02:39:50 5207 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-02-10 02:39:50 5207 [Note] InnoDB: Completed initialization of buffer pool
2017-02-10 02:39:50 5207 [Note] InnoDB: Highest supported file format is Barracuda.
2017-02-10 02:39:50 5207 [Note] InnoDB: The log sequence numbers 98028365051 and 98028365051 in ibdata files do not match the log sequence number 101119859781 in the ib_logfiles!
2017-02-10 02:39:50 5207 [Note] InnoDB: Database was not shutdown normally!
2017-02-10 02:39:50 5207 [Note] InnoDB: Starting crash recovery.
2017-02-10 02:39:50 5207 [Note] InnoDB: Reading tablespace information from the .ibd files...
2017-02-10 02:40:35 5207 [Note] InnoDB: Restoring possible half-written data pages
2017-02-10 02:40:36 5207 [Note] InnoDB: 128 rollback segment(s) are active.
2017-02-10 02:40:36 5207 [Note] InnoDB: Waiting for purge to start
2017-02-10 02:40:36 5207 [Note] InnoDB: 5.6.29 started; log sequence number 101119859781
2017-02-10 02:40:36 5207 [Note] Server hostname (bind-address): '*'; port: 3306
2017-02-10 02:40:36 5207 [Note] IPv6 is available.
2017-02-10 02:40:36 5207 [Note]   - '::' resolves to '::';
2017-02-10 02:40:36 5207 [Note] Server socket created on IP: '::'.
2017-02-10 02:40:37 5207 [Note] Event Scheduler: Loaded 1 event
2017-02-10 02:40:37 5207 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.29'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
2017-02-10 02:40:37 5207 [Note] Event Scheduler: scheduler thread started with id 1


I ran the Percona Config Wizard to generate most of the configuration file. Not entirely sure why it contains both innodb_file_per_table and innodb-file-per-table but I've left it for now.

innodb_file_per_table = 1
max_allowed_packet = 256M

key-buffer-size = 32M

# Caches/limits
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 300
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 10240

innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 64M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 128M

Also, down below's the rule for security/limits.conf. The number is higher than open-files-limit to give it some headroom, just in case.

mysql            -       nofile          81920

Any ideas on how to resolve this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.