diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-21 18:23:28 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-01-22 08:58:47 +0200 |
commit | 4f8555f1f68a22f33db57c31547df4f0832d78d2 (patch) | |
tree | af13676ed38bd9c515fa23d42769ca16ab422611 /mysql-test | |
parent | 6b7dcefdc83c4444ac8a4623b46810ff940528db (diff) | |
download | mariadb-git-4f8555f1f68a22f33db57c31547df4f0832d78d2.tar.gz |
MDEV-14941 Timeouts on persistent statistics tables caused by MDEV-14511
MDEV-14511 tried to avoid some consistency problems related to InnoDB
persistent statistics. The persistent statistics are being written by
an InnoDB internal SQL interpreter that requires the InnoDB data dictionary
cache to be locked.
Before MDEV-14511, the statistics were written during DDL in separate
transactions, which could unnecessarily reduce performance (each commit
would require a redo log flush) and break atomicity, because the statistics
would be updated separately from the dictionary transaction.
However, because it is unacceptable to hold the InnoDB data dictionary
cache locked while suspending the execution for waiting for a
transactional lock (in the mysql.innodb_index_stats or
mysql.innodb_table_stats tables) to be released, any lock conflict
was immediately be reported as "lock wait timeout".
To fix MDEV-14941, an attempt to reduce these lock conflicts by acquiring
transactional locks on the user tables in both the statistics and DDL
operations was made, but it would still not entirely prevent lock conflicts
on the mysql.innodb_index_stats and mysql.innodb_table_stats tables.
Fixing the remaining problems would require a change that is too intrusive
for a GA release series, such as MariaDB 10.2.
Thefefore, we revert the change MDEV-14511. To silence the
MDEV-13201 assertion, we use the pre-existing flag trx_t::internal.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/innodb/r/innodb_stats_debug.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_stats_debug.test | 13 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_stats_drop_locked.test | 2 |
3 files changed, 1 insertions, 26 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_stats_debug.result b/mysql-test/suite/innodb/r/innodb_stats_debug.result deleted file mode 100644 index 8f599acc08c..00000000000 --- a/mysql-test/suite/innodb/r/innodb_stats_debug.result +++ /dev/null @@ -1,12 +0,0 @@ -call mtr.add_suppression("InnoDB: Cannot save (table|index) statistics for table `test`\\.`t1`.*: Persistent statistics do not exist"); -CREATE TABLE t1 (a INT, KEY(a)) ENGINE=INNODB STATS_PERSISTENT=1; -SET @save_debug= @@SESSION.debug_dbug; -SET debug_dbug= '+d,stats_index_error'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze status Operation failed -SET debug_dbug= @save_debug; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_stats_debug.test b/mysql-test/suite/innodb/t/innodb_stats_debug.test deleted file mode 100644 index cd41c0b8fb0..00000000000 --- a/mysql-test/suite/innodb/t/innodb_stats_debug.test +++ /dev/null @@ -1,13 +0,0 @@ ---source include/have_innodb.inc ---source include/have_debug.inc - -call mtr.add_suppression("InnoDB: Cannot save (table|index) statistics for table `test`\\.`t1`.*: Persistent statistics do not exist"); - -CREATE TABLE t1 (a INT, KEY(a)) ENGINE=INNODB STATS_PERSISTENT=1; -SET @save_debug= @@SESSION.debug_dbug; -SET debug_dbug= '+d,stats_index_error'; -ANALYZE TABLE t1; -SET debug_dbug= @save_debug; -ANALYZE TABLE t1; - -DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb_stats_drop_locked.test b/mysql-test/suite/innodb/t/innodb_stats_drop_locked.test index 47f363a4bb6..26367b8e6ae 100644 --- a/mysql-test/suite/innodb/t/innodb_stats_drop_locked.test +++ b/mysql-test/suite/innodb/t/innodb_stats_drop_locked.test @@ -57,5 +57,5 @@ SELECT table_name FROM mysql.innodb_index_stats WHERE table_name='innodb_stats_drop_locked'; --disable_query_log -call mtr.add_suppression("Unable to delete statistics for table test\\.innodb_stats_drop_locked: Lock wait"); +call mtr.add_suppression("Unable to delete statistics for table test.innodb_stats_drop_locked: Lock wait timeout. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name"); --enable_query_log |