Backport "InnoDB shutdown hangs if innodb_force_recovery >= 3 skipped any rollback" from 5.7
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Won't Fix
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
High
|
Laurynas Biveinis | |||
5.7 |
Invalid
|
Undecided
|
Laurynas Biveinis |
Bug Description
On 5.6 trunk, innodb.
innodb.
Test ended at 2016-12-02 15:20:31
CURRENT_TEST: innodb.
mysqltest: In included file "./include/
included from ./include/
At line 25: Server failed to restart
The result from queries just before the failure was:
call mtr.add_
call mtr.add_
call mtr.add_
call mtr.add_
call mtr.add_
# Stop server
# Restart server.
# Restart server.
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
BEGIN;
INSERT INTO t1 VALUES(1), (2), (3), (4);
SET SESSION debug="
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
SELECT COUNT(*) IN (0,4) yes FROM t1;
yes
1
safe_process[
...
2016-12-02 18:12:07 30206 [Note] InnoDB: Starting shutdown...
2016-12-02 18:13:07 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:14:07 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:15:12 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:16:13 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:17:13 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:18:13 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:19:13 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
2016-12-02 18:20:13 30206 [Note] InnoDB: Waiting for 1 active transactions to finish
The fix appears to backport
commit b7a0c7f5527647e
Author: Marko M<C3><A4>
Date: Tue Apr 14 09:25:23 2015 +0300
Bug#20874411 INNODB SHUTDOWN HANGS IF INNODB_
SKIPPED ANY ROLLBACK
trx_
exist, and their rollback was prevented by innodb_
convert these transactions to XA PREPARE state in the main-memory
data structures, so that shutdown will proceed normally. These transactions
will again recover as ACTIVE on the next restart, and they will be rolled
back unless innodb_
trx_
PREPARED state.
RB: 8610
Reviewed-by: Jimmy Yang <email address hidden>
https:/ /github. com/percona/ percona- server/ pull/1227 /github. com/percona/ percona- server/ pull/1228
https:/