Backport "InnoDB shutdown hangs if innodb_force_recovery >= 3 skipped any rollback" from 5.7

Bug #1647741 reported by Laurynas Biveinis
8
This bug affects 1 person
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_bug-13628249 fails intermittently with

innodb.innodb_bug-13628249 w4 [ fail ]
        Test ended at 2016-12-02 15:20:31

CURRENT_TEST: innodb.innodb_bug-13628249
mysqltest: In included file "./include/wait_until_connected_again.inc":
included from ./include/wait_until_connected_again.inc at line 25:
At line 25: Server failed to restart

The result from queries just before the failure was:
call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'"mysql"."slave_master_info"\' in the cache');
call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'"mysql"."slave_relay_log_info"\' in the cache');
call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'"mysql"."slave_worker_info"\' in the cache');
call mtr.add_suppression('InnoDB: Failed to find tablespace for table \'"test"."t1"\' in the cache');
call mtr.add_suppression('InnoDB: Allocated tablespace [0-9]+, old maximum was [0-9]+');
# 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="+d,crash_commit_before";
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
SELECT COUNT(*) IN (0,4) yes FROM t1;
yes
1
safe_process[30106]: Child process: 30107, exit: 1
...
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 b7a0c7f5527647e8e3bdae9c7bbef922f8a1b5e4
Author: Marko M<C3><A4>kel<C3><A4> <email address hidden>
Date: Tue Apr 14 09:25:23 2015 +0300

    Bug#20874411 INNODB SHUTDOWN HANGS IF INNODB_FORCE_RECOVERY>=3
    SKIPPED ANY ROLLBACK

    trx_sys_any_active_transactions(): If any prepared ACTIVE transactions
    exist, and their rollback was prevented by innodb_force_recovery,
    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_force_recovery>=3 again.

    trx_undo_fake_prepared(): An auxiliary function to set an undo log to
    PREPARED state.

    RB: 8610
    Reviewed-by: Jimmy Yang <email address hidden>

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
tags: added: ci innodb upstream
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3615

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.