1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup while rolling back recovered incomplete transactions

trx_rollback_resurrected(): If shutdown was initiated, fake all
remaining active transactions to XA PREPARE state, so that shutdown
can proceed. Also, make the parameter "all" an output that will be
assigned to FALSE in this case.

trx_rollback_or_clean_recovered(): Remove the shutdown check
(it was moved to trx_rollback_resurrected()).

trx_undo_free_prepared(): Relax assertions.
This commit is contained in:
Marko Mäkelä
2017-12-13 16:18:08 +02:00
parent 622466644d
commit 6559ba71a5
6 changed files with 166 additions and 42 deletions

View File

@ -0,0 +1,51 @@
--source include/have_innodb.inc
--source include/not_embedded.inc
--echo #
--echo # MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup
--echo # while rolling back recovered incomplete transactions
--echo #
CREATE TABLE t (a INT) ENGINE=InnoDB;
let $size = 100;
let $trx = 8;
let $c = $size;
BEGIN;
--disable_query_log
while ($c) {
INSERT INTO t VALUES();
dec $c;
}
--enable_query_log
COMMIT;
let $c = $trx;
while ($c)
{
connect (con$c,localhost,root,,);
eval CREATE TABLE t$c (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
eval INSERT INTO t$c (a) SELECT NULL FROM t;
eval UPDATE t$c SET a=a+$size, b=a;
eval DELETE FROM t$c;
dec $c;
}
--connection default
SET GLOBAL innodb_flush_log_at_trx_commit=1;
CREATE TABLE u(a SERIAL) ENGINE=INNODB;
--source include/kill_and_restart_mysqld.inc
--source include/restart_mysqld.inc
--disable_query_log
let $c = $trx;
while ($c)
{
disconnect con$c;
eval DROP TABLE t$c;
dec $c;
}
--enable_query_log
DROP TABLE t,u;