This is one of the exciting troubleshooting related to XA transactions let’s dive in. Let me provide a few backgrounds.
For one of our clients, when we try to drop a table, it is waiting for metadata lock. On debugging it is one of the XA transactions is holding the shared write lock and causing metadata lock on all the other local transactions.
Let us view the metadata locks from the Performance Schema.
mysql> select OBJECT_TYPE,OBJECT_SCHEMA,OBJECT_NAME,
LOCK_TYPE,LOCK_STATUS,SOURCE from
performance_schema.metadata_locks\G |