With MySQL 8.0, engineers improved the
visibility of data locking. Usually it was not that easy to deal
with the output of SHOW ENGINE INNODB STATUS
and
mixing Information_Schema tables like INNODB_LOCKS
and INNODB_LOCK_WAITS
.
So in MySQL 8.0 we instrument data locks in
Performance_Schema
and we changed the SYS
Schema
view related to the InnoDB Locks Wait too.
This means that when a transaction A is locking row R, and transaction B is waiting on this very same row, B is effectively blocked by A. What we added is extra instrumentation to expose which data is locked (R), who owns the lock (A), and who is waiting for the data (B).
Testing
Let’s have a look at this simple scenario in MySQL 5.7.21 and 8.0.4 to compare:
2 clients starting a …
[Read more]