MySQL Forums
Forum List  »  Newbie

MySQL CHECKSUM causes permanent metadata lock
Posted by: Erwin Rossen
Date: March 10, 2015 02:29AM

I am using Python's pymysql to communicate with my MySQL server. I perform a CHECKSUM TABLE operation, receive the result, and immediately after perform a DROP TABLE operation on this Table. However, the program freezes, and I see in the MySQL Workbench (Client Connections) the message Waiting for table metadata lock. This must come from the CHECKSUM TABLE operation, since this was the last locking operation on the table, however, that operation was completed (no explicit commit).

Furthermore, when I type SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS; or SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;, I find no information about any current locks or waiting for locks. Why is the DROP TABLE operation not proceeding?

If it helps, this is the output of SHOW ENGINE INNODB STATUS;, but it is abracadabra to me.

=====================================
2015-03-09 12:25:25 2ba8c47cd700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 11 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 5698 srv_active, 0 srv_shutdown, 1014272 srv_idle
srv_master_thread log flush and writes: 1019961
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 10704
OS WAIT ARRAY INFO: signal count 10648
Mutex spin waits 1393, rounds 41820, OS waits 1210
RW-shared spins 6094, rounds 219420, OS waits 7202
RW-excl spins 302, rounds 68768, OS waits 2112
Spin rounds per wait: 30.02 mutex, 36.01 RW-shared, 227.71 RW-excl
------------
TRANSACTIONS
------------
Trx id counter 154357
Purge done for trx's n:o < 154336 undo n:o < 0 state: running but idle
History list length 2851
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 154316, not started
MySQL thread id 3511, OS thread handle 0x2ba8c4ebf700, query id 1077780 a83-161-215-203.adsl.xs4all.nl 83.161.215.203 root Waiting for table metadata lock
DROP TABLE IF EXISTS pred_orders_table
---TRANSACTION 0, not started
MySQL thread id 3472, OS thread handle 0x2ba8c47cd700, query id 1078727 a83-161-215-203.adsl.xs4all.nl 83.161.215.203 root init
SHOW ENGINE INNODB STATUS
---TRANSACTION 0, not started
MySQL thread id 3471, OS thread handle 0x2ba8c396d700, query id 1078711 a83-161-215-203.adsl.xs4all.nl 83.161.215.203 root cleaning up
---TRANSACTION 154356, not started
MySQL thread id 19, OS thread handle 0x2ba8c480e700, query id 1078723 localhost 127.0.0.1 rdsadmin cleaning up
---TRANSACTION 154315, ACTIVE 362 sec
MySQL thread id 3510, OS thread handle 0x2ba8c39ae700, query id 1077727 a83-161-215-203.adsl.xs4all.nl 83.161.215.203 root cleaning up
Trx read view will not see trx with id >= 154316, sees < 154316
--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
3518 OS file reads, 277189 OS file writes, 53029 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 1241027, node heap has 641 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 3540323193
Log flushed up to 3540323193
Pages flushed up to 3540323193
Last checkpoint at 3540323193
0 pending log writes, 0 pending chkp writes
22078 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 641744896; in additional pool allocated 0
Dictionary memory allocated 375795
Buffer pool size 38271
Free buffers 1024
Database pages 36606
Old database pages 13492
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 4963, not young 71320
0.00 youngs/s, 0.00 non-youngs/s
Pages read 828, created 147394, written 231750
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 36606, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 2623, id 48003835676416, state: sleeping
Number of rows inserted 4916344, updated 1990981, deleted 284273, read 64132683
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.18 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================

Options: ReplyQuote


Subject
Written By
Posted
MySQL CHECKSUM causes permanent metadata lock
March 10, 2015 02:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.