I recently blogged about tracking metadata locks in the latest MySQL, and now I want to discuss how to track these metadata locks in MariaDB.
In MySQL 5.7, there is a table named `metadata_locks` added to the performance_schema (performance_schema must be enabled *and* the metadata_locks instrument must be specifically enabled as well.
In the MariaDB 10.0 implementation (as of 10.0.7), there is a table named METADATA_LOCK_INFO added to the *information_schema*. This is a new plugin, so the plugin must be installed, but that is very simple with:
INSTALL SONAME 'metadata_lock_info';
Then, you will have the table.
To see it in action:
Connection #1:
mysql> create table t (id int) engine=myisam; mysql> begin; mysql> select * from t;
Connection #2:
mysql> alter table t add index …[Read more]