Bug #91434 InnoDB: Trying to do I/O to a tablespace which does not exist.
Submitted: 27 Jun 2018 8:55 Modified: 13 Jul 2018 12:57
Reporter: long jian Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.22 OS:CentOS (CentOS Linux release 7.2 (Final))
Assigned to: CPU Architecture:x86 (Intel(R) Xeon(R) CPU @ 2.50GHz)
Tags: InnoDB,I/O,tablespace,drop table

[27 Jun 2018 8:55] long jian
Description:
When I do a Performance Test using sysbench on a SSD storage, I found warnings in mysql log:[ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=32, page number=57890], I/O length: 16384 bytes.The stack show that background thread is doing ibuf merge when sysbench is deleteing the same tablespace.As we do not hold any mutexes, buf_read_page_low()->fil_io() can be called after the same space be marked as stopped in fil_delete_tablespace()->fil_check_pending_operations(). This naturally leads seen error
message on log.

How to repeat:
1.Use a SSD storage,my storage Model is INTEL SSDPE2KX040T8.
2.Enough data, about 100g。
3.execute sysbench cleanup as quick as possible after sysbench run.use a shell script to execute these two commands.
my script like this:
sysbench --tables=100 --table-size=4000000 --threads=50 --mysql-db=sbtest --mysql-user=root --mysql-socket=/mnt/mysql_data/mysql.sock --time=300 oltp_delete prepare
sysbench --tables=100 --table-size=4000000 --threads=50 --mysql-db=sbtest --mysql-user=root --mysql-socket=/mnt/mysql_data/mysql.sock --time=300 oltp_delete run
sysbench --tables=100 --table-size=4000000 --threads=50 --mysql-db=sbtest --mysql-user=root --mysql-socket=/mnt/mysql_data/mysql.sock --time=300 oltp_delete cleanup

Suggested fix:
Do not print error message about trying to do I/0 for missing space in fil_io(), just return correct error code that is handled later.
if We have deleted or are deleting the single-table tablespace: remove the entries for that space in buf_read_ibuf_merge_pages().
[11 Jul 2018 12:35] MySQL Verification Team
Hello long jian,

Thank you for the report.
This is duplicate of internally reported  BUG 24388498 which was
fixed in 8.0.0 release, and here's the changelog entry: 
An asynchronous read operation on a deleted tablespace raised an error. 
- https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-0.html

Please try with latest GA 8.0.11 and let us know if you are still seeing this issue at your end.
  
Thanks,
Umesh
[13 Jul 2018 12:36] long jian
it is gone at 8.0.11. thank you.
[13 Jul 2018 12:57] MySQL Verification Team
Thank you for confirming!

regards,
Umesh
[11 Oct 2019 7:12] Sudalai Muthukumar
We got similar error in MySQL 5.7.18 server, but it is related to Bug#24388498.  
The mysql server crashed with assertion failure, 

2019-10-07T02:00:36.191001-08:00 48699433 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191010-08:00 48699433 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191016-08:00 48699433 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191021-08:00 48699433 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191032-08:00 48699433 [ERROR] [FATAL] InnoDB: Unable to read page [page id: space=775042354, page number=859255605] into the buffer pool after 100 attempts. The most probable cause of this error may be that the table has been corrupted. Or, the table was compressed with with an algorithm that is not supported by this instance. If it is not a decompress failure, you can try to fix this problem by using innodb_force_recovery. Please see http://dev.mysql.com/doc/refman/5.7/en/ for more details. Aborting...
2019-10-07 02:00:36 0x7f0172fe4700  InnoDB: Assertion failure in thread 139644200961792 in file ut0ut.cc line 916
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2019-10-07T02:00:36.191535-08:00 48685296 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191561-08:00 48685296 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191569-08:00 48685296 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191575-08:00 48685296 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191584-08:00 48685296 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191589-08:00 48685296 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191595-08:00 48685296 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191600-08:00 48685296 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191606-08:00 48685296 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07T02:00:36.191611-08:00 48685296 [ERROR] InnoDB: trying to read page [page id: space=775042354, page number=859255605] in nonexisting or being-dropped tablespace
2019-10-07T02:00:36.191617-08:00 48685296 [ERROR] InnoDB: Trying to do I/O to a tablespace which does not exist. I/O type: read, page: [page id: space=775042354, page number=859255605], I/O length: 16384 bytes
2019-10-07 02:00:36 0x7f016f600700  InnoDB: Assertion failure in thread 139644140259072 in file buf0lru.cc line 2213
InnoDB: Failing assertion: bpage->buf_fix_count == 0
09:00:36 UTC - mysqld got signal 6 ;
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.
key_buffer_size=8384512
read_buffer_size=2097152
max_used_connections=876
max_threads=1500
thread_count=537
connection_count=537
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 52252203 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x4c7ede000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...

Please help us resolve it.
[11 Oct 2019 7:20] Sudalai Muthukumar
We are getting this error in MySQL 5.7.18 and MySQL crashed with assertion failure . Its looks different from Bug #24388498. 
[Sorry by mistake mentioned "It is related to Bug#24388498. " in previous comment.]

Please help us resolve this. 

Thanks.
[18 Dec 2020 7:37] Manikandan K
Have anyone fixed this issue?