Merge lp:~akopytov/percona-xtrabackup/bug1255476 into lp:percona-xtrabackup/2.2

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4977
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1255476
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 15 lines (+4/-1)
1 file modified
storage/innobase/page/page0cur.cc (+4/-1)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1255476
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+221983@code.launchpad.net

Description of the change

Bug #1255476: InnoDB redo log incompatibility with 5.1/5.5 server and
              compressed tables

An upstream fix in MySQL 5.6.11 introduced a change that can make
InnoDB crash on recovery when replaying redo logs created on earlier
versions.

The fix changed page_cur_insert_rec_zip() to force page reorganization
even if enough space is available in the modification log on a
compressed page when an insert to the corresponding uncompressed page
would not succeed.

What the fix did not take into account is compatibility with earlier
server versions which do not perform such operation (i.e. 5.1, 5.5 and
pre-5.6.11).

When replaying such an insert (i.e. the one when page_zip_available()
returned ‘true’ but reorg_before_insert is also ‘true’), no page
reorganization is performed in assumption that it has already been
covered by the previous redo log entries (which is the case when
replaying a redo log created with 5.6.11+):

  if (recv_recovery_is_on()) {
   /* Insert into the uncompressed page only.
   The page reorganization or creation that we
   would attempt outside crash recovery would
   have been covered by a previous redo log record. */
                }

However, there are no corresponding previous records in redo logs
created by 5.1/5.5/5.6.10-. Which led to inconsistencies between
compressed and uncompressed page images and release/debug assertion
failures on subsequent page operations.

Fixed by changing page_cur_insert_rec_zip() to not attempt page
reorganization before insert on recovery. It is never required when
replaying a 5.6.11+ log anyway, and for previous versions it breaks
backward compatibility.

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/page/page0cur.cc'
2--- storage/innobase/page/page0cur.cc 2014-03-20 12:24:00 +0000
3+++ storage/innobase/page/page0cur.cc 2014-06-04 06:17:09 +0000
4@@ -1235,7 +1235,10 @@
5 }
6 #endif /* UNIV_DEBUG_VALGRIND */
7
8- const bool reorg_before_insert = page_has_garbage(page)
9+ /* For recovery do not attempt to reorganize pages before insert.
10+ Otherwise we break compatibility with 5.1/5.5 and early 5.6. */
11+ const bool reorg_before_insert = !recv_recovery_is_on()
12+ && page_has_garbage(page)
13 && rec_size > page_get_max_insert_size(page, 1)
14 && rec_size <= page_get_max_insert_size_after_reorganize(
15 page, 1);

Subscribers

People subscribed via source and target branches

to all changes: