diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-12-18 13:38:36 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-12-18 14:46:59 +0200 |
commit | 97c4bdfb2c69c19e42e58e3162f3662d72425760 (patch) | |
tree | 2a8b359c1b553c5106f7a42e4b9c9caa3c810f70 /mysql-test/include/check-testcase.test | |
parent | 8ed78cf7f93f6129c11ee979500971c11e15f6f9 (diff) | |
download | mariadb-git-bb-10.2-ext-marko.tar.gz |
MDEV-13407 innodb.drop_table_background failed in buildbot with "Tablespace for table exists"bb-10.2-ext-marko
The InnoDB background DROP TABLE queue is something that we should
really remove, but are unable to until we remove dict_operation_lock
so that DDL and DML operations can be combined in a single transaction.
Because the queue is not persistent, it is not crash-safe. We should
in some way ensure that the deferred-dropped tables will be dropped
after server restart.
The existence of two separate transactions complicates the error handling
of CREATE TABLE...SELECT. We should really not break locks in DROP TABLE.
Our solution to these problems is to rename the table to a temporary
name, and to drop such-named tables on InnoDB startup. Also, the
queue will use table IDs instead of names from now on.
check-testcase.test: Ignore #sql-ib*.ibd files, because tables may enter
the background DROP TABLE queue shortly before the test finishes.
innodb.drop_table_background: Test CREATE...SELECT and the creation of
tables whose file name starts with #sql-ib.
innodb.alter_crash: Adjust the recovery, now that the #sql-ib tables
will be dropped on InnoDB startup.
row_mysql_drop_garbage_tables(): New function, to drop all #sql-ib tables
on InnoDB startup.
row_mysql_drop_t::table_id: Replaces table_name.
row_drop_table_for_mysql_in_background(): Remove an unnecessary and
misplaced call to log_buffer_flush_to_disk(). (The call should have been
after the transaction commit. We do not care about flushing the redo log
here, because the table would be dropped again at server startup.)
If server shutdown has been initiated, empty the list without actually
dropping the tables. They will be dropped again on startup.
Remove the entry from the list before attempting drop, and re-add the
entry in case of failure. In this way, the table should eventually be
dropped.
row_drop_table_for_mysql(): Do not call lock_remove_all_on_table().
Instead, if locks exist, defer the DROP TABLE until they do not exist.
If the table name does not start with #sql-ib, rename it to that prefix
before adding it to the background DROP TABLE queue.
Diffstat (limited to 'mysql-test/include/check-testcase.test')
-rw-r--r-- | mysql-test/include/check-testcase.test | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test index a282201857e..4ca53989d06 100644 --- a/mysql-test/include/check-testcase.test +++ b/mysql-test/include/check-testcase.test @@ -82,7 +82,10 @@ call mtr.check_testcase(); let $datadir=`select @@datadir`; list_files $datadir mysql_upgrade_info; -list_files $datadir/test #sql*; +list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*; +--replace_regex /#sql-ib[0-9a-f]+-[0-9a-f]+\.ibd\n// +cat_file $datadir.tempfiles.txt; +remove_file $datadir.tempfiles.txt; list_files $datadir/mysql #sql*; --enable_query_log |