summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-31 13:16:31 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-31 13:16:31 +0300
commitf693170c75a1f39f3f06aca683fe4a1998785008 (patch)
tree1459a2cbaadc0a7a34b0ffb51e326be69597f93f
parent3b5d3cd68e4acceb613822adc66b87f396920e59 (diff)
downloadmariadb-git-f693170c75a1f39f3f06aca683fe4a1998785008.tar.gz
MDEV-16647 InnoDB fails to drop large temporary table on disconnect
This regression was introduced in MDEV-16515. We would fail to drop a temporary table on client disconnect, because trx_is_interrupted() would hold. To add insult to injury, in MariaDB 10.1, InnoDB temporary tables are actually persistent, so the garbage temporary tables will never be dropped. row_drop_table_for_mysql(): If several iterations of buf_LRU_drop_page_hash_for_tablespace() are needed, do not interrupt dropping a temporary table even after the transaction was marked as killed. Server shutdown will still terminate the loop, and also DROP TABLE of persistent tables will keep checking if the execution was aborted.
-rw-r--r--storage/innobase/row/row0mysql.cc3
-rw-r--r--storage/xtradb/row/row0mysql.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index c6e038448cd..abee3386039 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -4222,7 +4222,8 @@ row_drop_table_for_mysql(
hold the InnoDB dictionary lock, we will drop any
adaptive hash index entries upfront. */
while (buf_LRU_drop_page_hash_for_tablespace(table)) {
- if (trx_is_interrupted(trx)
+ if ((!dict_table_is_temporary(table)
+ && trx_is_interrupted(trx))
|| srv_shutdown_state != SRV_SHUTDOWN_NONE) {
err = DB_INTERRUPTED;
goto funct_exit;
diff --git a/storage/xtradb/row/row0mysql.cc b/storage/xtradb/row/row0mysql.cc
index c9684d49167..e4a6cd39699 100644
--- a/storage/xtradb/row/row0mysql.cc
+++ b/storage/xtradb/row/row0mysql.cc
@@ -4233,7 +4233,8 @@ row_drop_table_for_mysql(
hold the InnoDB dictionary lock, we will drop any
adaptive hash index entries upfront. */
while (buf_LRU_drop_page_hash_for_tablespace(table)) {
- if (trx_is_interrupted(trx)
+ if ((!dict_table_is_temporary(table)
+ && trx_is_interrupted(trx))
|| srv_shutdown_state != SRV_SHUTDOWN_NONE) {
err = DB_INTERRUPTED;
goto funct_exit;