mariadb/mysql-test/suite/innodb/t/drop_table_background.test
Marko Mäkelä 449a88e1c6 MDEV-12052 Shutdown crash presumably due to master thread activity
InnoDB shutdown assumes that once the server has entered
SRV_SHUTDOWN_FLUSH_PHASE, no change to persistent data is allowed.
It was possible for the master thread to wake up while shutdown
is executing in SRV_SHUTDOWN_FLUSH_PHASE or
even in SRV_SHUTDOWN_LAST_PHASE.

We do not yet know if further crashes at shutdown are possible.
Also, we do not know if all the observed crashes could be explained
by the race conditions that we are now fixing.

srv_shutdown_print_master_pending(): Remove a redundant ut_time() call.

srv_shutdown(): Renamed from srv_master_do_shutdown_tasks().

srv_master_thread(): Do not resume after shutdown has been initiated.
2017-05-26 15:08:35 +03:00

30 lines
743 B
Text

--source include/have_innodb.inc
--source include/have_debug.inc
# Embedded server does not support restarting
--source include/not_embedded.inc
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT,
KEY(c1), KEY(c2), KEY(c2,c1),
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1),
KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1),
KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB;
let $n= 10;
SET DEBUG_DBUG='+d,row_drop_table_add_to_background';
--disable_query_log
let $i= $n;
while ($i) {
eval CREATE TABLE t$i LIKE t;
dec $i;
}
let $i= $n;
while ($i) {
eval DROP TABLE t$i;
dec $i;
}
--enable_query_log
DROP TABLE t;
--source include/restart_mysqld.inc
CREATE TABLE t (a INT) ENGINE=InnoDB;
DROP TABLE t;