Shutdown hangs if redo log tracker thread stopped

Bug #1606821 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
Fix Released
Medium
Laurynas Biveinis
5.6
Fix Released
Medium
Laurynas Biveinis
5.7
Fix Released
Medium
Laurynas Biveinis

Bug Description

The following bit of percona_changed_page_bmp

#
# Test that impossible to track log is handled gracefully (bug 1108613)
#
CREATE TABLE t3 (a MEDIUMBLOB) ENGINE=InnoDB;

call mtr.add_suppression("InnoDB: Error: the age of the oldest untracked record exceeds the log group capacity!");
call mtr.add_suppression("InnoDB: Error: stopping the log tracking thread at LSN");

INSERT INTO t3 VALUES (REPEAT('a', 12582912));

--echo 10th restart
--source include/restart_mysqld.inc

always results in server shutdown hanging and MTR issuing kill -9.

This is caused by the tracking margin code setting srv_track_changed_pages = FALSE as tracking cannot continue, and then never raising the tracking event so that the tracker thread can wake up and quit.

The root cause is srv_track_changed_pages attempting to handle two different purposes: 1) whether the tracking is currently active; 2) whether the tracker thread has been started.

By code review this mismatch could cause issues elsewhere too, e.g. in log_online_purge_changed_page_bitmaps, which handles PURGE CHANGED_PAGE_BITMAPS:

        if (srv_track_changed_pages) {
                /* User requests might happen with both enabled and disabled
                tracking */
                mutex_enter(&log_bmp_sys->mutex);
        }
...
        if (srv_track_changed_pages) {
...
                mutex_exit(&log_bmp_sys->mutex);
        }

If srv_track_changed_pages would be reset from TRUE to FALSE in parallel, this would result in an unreleased mutex.

Tags: bitmap xtradb
tags: added: bitmap xtradb
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
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-1730

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.