In this blog post, I’ll review how a hung MySQL transaction can
cause the InnoDB history length to grow and negatively affect
MySQL performance.
Recently I was helping a customer discover why SELECT queries
were running slower and slower until the server restarts (which
got things back to normal). It took some time to get from that
symptom to a final diagnosis. Please follow me on the journey of
chasing this strange MySQL behavior!
Symptoms
Changes in the query response time can mean tons of things. We
can check everything from the query plan to the disk performance.
However, fixing it with a restart is less common. After looking
at “show engine innodb status”, I noticed some strange lines:
Trx read view will not see trx with id >= 41271309593, sees < 41268384363
---TRANSACTION 41271309586, ACTIVE 766132 sec
2 lock struct(s), heap size 376, 0 row lock(s), undo log entries 1 …
[Read more]