[MDEV-13407] innodb.drop_table_background failed in buildbot with "Tablespace for table exists" Created: 2017-07-30 Updated: 2018-12-10 Resolved: 2017-12-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB, Tests |
| Affects Version/s: | 10.0 |
| Fix Version/s: | 10.0.34, 10.1.30, 10.2.12, 10.3.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Note: The failure happened on the valgrind builder. Either because it's valgrind, or on some other reason, but the server didn't shutdown properly on restart before running the failed command – possibly it is the reason. |
| Comments |
| Comment by Marko Mäkelä [ 2017-12-18 ] |
|
The background DROP TABLE queue is not persistent and thus not crash-safe. I think that the likely explanation is that with Valgrind, the shutdown_server timeout was exceeded and the server process was killed before the DROP TABLE queue was persistently emptied. Or the test was run multiple times, and the process was killed before table t from the previous test was actually dropped. A fix would be to rename the table to an intermediate name before adding it to the queue, and on server startup, drop the tables that match the intermediate name pattern. That is what I am going to do in bb-10.2-ext and 10.3. The intermediate name prefix that I am going to use is #sql-ib, which starting with A more comprehensive fix would be to remove the background DROP TABLE queue and the concept of "DDL transactions" from InnoDB altogether. This would require replacing the dict_operation_lock with meta-data locks (MDL), also in internal InnoDB operations. |
| Comment by Marko Mäkelä [ 2017-12-18 ] |
|
I plan to implement the following solution:
It seems to me that there could be cases where the background DROP TABLE gives up on the first failed attempt when it is trying to drop a table. I would rather keep the tables in the queue until they are dropped. And I will identify the tables by id, not name. |
| Comment by Marko Mäkelä [ 2017-12-18 ] |
|
My fix depends on |
| Comment by Elena Stepanova [ 2017-12-18 ] |
|
The test failure still needs to be fixed in previous versions, even if it's by disabling the test or parts of it. |
| Comment by Marko Mäkelä [ 2017-12-18 ] |
|
In 10.0, 10.1, 10.2 we can make the background DROP TABLE queue more robust, by using table IDs instead of names, and by ensuring that tables will never be removed from the queue until they have been dropped. (That is, do not implement the renaming or the dropping on startup.) |
| Comment by Marko Mäkelä [ 2017-12-18 ] |
|
I ported a minimal version of the fix to 10.0. In GA versions (before MariaDB 10.3) we will not rename tables before adding them to the background drop queue. But we should keep tables in the queue until dropping them has succeeded. |
| Comment by Marko Mäkelä [ 2018-09-26 ] |
|
As part of |