Bug #87222 slow down on the spam! InnoDB: Trying to close/delete/truncate tablespace
Submitted: 27 Jul 2017 12:52
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.19 OS:Windows
Assigned to: CPU Architecture:Any

[27 Jul 2017 12:52] Shane Bester
Description:
on a 5.7.19 just started up, I dropped a database containing some fairly large tables.  Here is the partial spam from the error log :

2017-07-27T12:24:19.993357Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.024557Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.045157Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.065159Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.085160Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.105161Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.125162Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.145163Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.165164Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.185166Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.210766Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.231366Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.260967Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.292167Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.323367Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.354567Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.385767Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.416968Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.448168Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.479368Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.510568Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.541768Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.572968Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.604168Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.635368Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.666568Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.697768Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.728968Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.760168Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.791368Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.822568Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.853768Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.884968Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.917168Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.948369Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:20.979569Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:21.010769Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:21.041969Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:21.074169Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.
2017-07-27T12:24:21.105369Z 3 [Warning] InnoDB: Trying to close/delete/truncate tablespace 'test/2017' but there are 1 pending operations on it.

How to repeat:
o) code inspection.
o) drop database with a few large tables on a slow hard disk.

Suggested fix:
Please,  no need to spam 35 times per second!
Slow down,  put a sleep/throttle in there....

This is just a request to throttle the outputs.  If you want to fix the long semaphore waits,  that can be a WL or new bug.
[27 Jul 2017 12:54] MySQL Verification Team
caught a snapshot of stack traces FYI during the outputs...

Attachment: stacks1.txt (text/plain), 45.90 KiB.

[27 Jul 2017 14:01] MySQL Verification Team
just a note.  to drop a large table straight after startup, the buffer pool is still loading and thus reading from disk many gigabytes of .ibd files.
It is best to cancel that, and the symptoms go away:

set global innodb_buffer_pool_load_abort=1;
drop database if exists test;
[2 Apr 2019 6:39] MySQL Verification Team
BTW,  I do not believe InnoDB should invoke it's killer watchdog here.
Server is slow not stuck.

See:  https://bugs.mysql.com/bug.php?id=92044