Merge lp:~akopytov/percona-xtrabackup/bug1177201-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 730
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1177201-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 59 lines (+43/-0)
2 files modified
src/fil_cur.cc (+21/-0)
test/t/bug1177201.sh (+22/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1177201-2.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Sergei Glushchenko (community) g2 Approve
Review via email: mp+208779@code.launchpad.net

This proposal supersedes a proposal from 2014-02-28.

Description of the change

    Bug #1177201: Assertion "to_read % cursor->page_size == 0" failed at
                  fil_cur.cc:218

    Allow junk at the end of data files, i.e. when there’s a block less than
    the page size at the end of the file. It is apparently a server-side
    problem with unknown root cause, but it’s ok to ignore that as long as
    InnoDB itself ignores such datafiles.

http://jenkins.percona.com/view/PXB%202.1/job/percona-xtrabackup-2.1-param/553/

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote : Posted in a previous version of this proposal

Hi Alexey,

Looks good, but please resubmit to lp:percona-xtrabackup/2.1

review: Needs Resubmitting (g2)
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve

review: Approve (g2)
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Hm, there's a problem: if to_read is not a multiple of the page size, but is more than the page size (i.e. there are still some full pages in the requested block), we are going to lose some data by not copying the entire block.

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 'src/fil_cur.cc'
2--- src/fil_cur.cc 2013-08-18 06:54:14 +0000
3+++ src/fil_cur.cc 2014-03-01 13:06:22 +0000
4@@ -289,7 +289,28 @@
5 if (to_read > (ib_int64_t) cursor->buf_size) {
6 to_read = (ib_int64_t) cursor->buf_size;
7 }
8+
9 xb_a(to_read > 0 && to_read <= 0xFFFFFFFFLL);
10+
11+ if (to_read % cursor->page_size != 0 &&
12+ offset + to_read == cursor->statinfo.st_size) {
13+
14+ if (to_read < (ib_int64_t) cursor->page_size) {
15+ msg("[%02u] xtrabackup: Warning: junk at the end of "
16+ "%s:\n", cursor->thread_n, cursor->abs_path);
17+ msg("[%02u] xtrabackup: Warning: offset = %llu, "
18+ "to_read = %llu\n",
19+ cursor->thread_n,
20+ (unsigned long long) offset,
21+ (unsigned long long) to_read);
22+
23+ return(XB_FIL_CUR_EOF);
24+ }
25+
26+ to_read = (ib_int64_t) (((ulint) to_read) &
27+ ~(cursor->page_size - 1));
28+ }
29+
30 xb_a(to_read % cursor->page_size == 0);
31
32 npages = (ulint) (to_read >> cursor->page_size_shift);
33
34=== added file 'test/t/bug1177201.sh'
35--- test/t/bug1177201.sh 1970-01-01 00:00:00 +0000
36+++ test/t/bug1177201.sh 2014-03-01 13:06:22 +0000
37@@ -0,0 +1,22 @@
38+########################################################################
39+# Bug #1177201: Assertion "to_read % cursor->page_size == 0" failed at
40+# fil_cur.cc:218
41+########################################################################
42+
43+start_server
44+
45+dd if=/dev/zero of=$topdir/zeroes bs=1 count=4096
46+
47+cat $topdir/zeroes >>$MYSQLD_DATADIR/ibdata1
48+
49+innobackupex --no-timestamp $topdir/backup
50+
51+stop_server
52+
53+rm -rf $MYSQLD_DATADIR/*
54+
55+innobackupex --apply-log $topdir/backup
56+
57+innobackupex --copy-back $topdir/backup
58+
59+start_server

Subscribers

People subscribed via source and target branches

to all changes: