Skip to content
Permalink
Browse files
MDEV-13201 Assertion srv_undo_sources || ... failed on shutdown dur…
…ing DDL operation

dict_stats_exec_sql(): Refuse the operation if shutdown has been
initiated.

The real fix would be to update the persistent statistics as part
of the data dictionary transactions. To do this, we should move the
storage of InnoDB persistent statistics to the InnoDB data files,
and maybe also remove the InnoDB data dictionary.
  • Loading branch information
dr-m committed Nov 21, 2017
1 parent 18cdc25 commit 9405fde
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
@@ -0,0 +1,13 @@
call mtr.add_suppression("InnoDB: Cannot save table statistics for table `test`\\.`t1`: Persistent statistics do not exist");
SET GLOBAL innodb_stats_persistent= ON;
CREATE TABLE t1 (t TEXT) ENGINE=InnoDB;
connect con1,localhost,root,,test;
SET DEBUG_SYNC='ib_trunc_table_trunc_completing SIGNAL committed WAIT_FOR ever';
TRUNCATE TABLE t1;
connection default;
SET DEBUG_SYNC='now WAIT_FOR committed';
disconnect con1;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
DROP TABLE t1;
@@ -0,0 +1,18 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

call mtr.add_suppression("InnoDB: Cannot save table statistics for table `test`\\.`t1`: Persistent statistics do not exist");

SET GLOBAL innodb_stats_persistent= ON;
CREATE TABLE t1 (t TEXT) ENGINE=InnoDB;
--connect (con1,localhost,root,,test)
SET DEBUG_SYNC='ib_trunc_table_trunc_completing SIGNAL committed WAIT_FOR ever';
--send
TRUNCATE TABLE t1;
--connection default
SET DEBUG_SYNC='now WAIT_FOR committed';
--source include/restart_mysqld.inc
--disconnect con1
SELECT COUNT(*) FROM t1;
DROP TABLE t1;
@@ -293,7 +293,10 @@ dict_stats_exec_sql(
ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X));
ut_ad(mutex_own(&dict_sys->mutex));

if (!dict_stats_persistent_storage_check(true)) {
extern bool dict_stats_start_shutdown;

if (dict_stats_start_shutdown
|| !dict_stats_persistent_storage_check(true)) {
pars_info_free(pinfo);
return(DB_STATS_DO_NOT_EXIST);
}

0 comments on commit 9405fde

Please sign in to comment.