Once a day or two we get the bellow error and the mysql crashingt:
[ERROR] [MY-012872] [InnoDB] [FATAL] Semaphore wait has lasted > 600 seconds. We intentionally crash the server because it appears to be hung.
And before are alot of those:
Mutex at 0x7fde903975e8, Mutex TRX_SYS created trx0sys.cc:565, locked by 140504716736256
--Thread 140504724723456 has waited at trx0sys.h line 598 for 240 seconds the semaphore:
2024-07-13T04:43:26.039036Z 0 [Warning] [MY-012985] [InnoDB] A long semaphore wait:
{}
I also see a lot of those warnings in the logs (I think mostly after the restart):
[Warning] [MY-013865] [InnoDB] Redo log writer is waiting for a new redo log file. Consider increasing innodb_redo_log_capacity.
I couldn't figure out what is the cause of this problem. I increased the innodb_redo_log_capacity
by a lot but it happened anyway. I also tried turning off innodb_adaptive_hash_index
but it didn't help. I thought of increasing innodb_log_buffer_size
which is currently set to 1M because I thouth maybe its causing a transaction to be to slow.
Its important to say that MySQL seems like it stops doing anything in those 600 seconds. I can't connect to the server at this time, CPU is down to nothing and then we get this error and a crush.
Since it is not possible to connect to DB during the downtime, I thought running a Scheduled Event from MySQL itself writing running queries to the disk should do the trick - but I was wrong. Even using a Scheduled Event stopped writing the same time downtime started.
Another thing that I tried is to enable innodb_status_output
which logs SHOW ENGINE INNODB STATUS;
to stderr
every 15 seconds, even this stopped writing to stderr
the same time downtime started.
We use MySQL version 8.0.34