Merge lp:~laurynas-biveinis/percona-server/bug1342494-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis on 2014-07-18
Status: Merged
Approved by: Laurynas Biveinis on 2014-07-18
Approved revision: 671
Merged at revision: 682
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1342494-5.5
Merge into: lp:percona-server/5.5
Diff against target: 92 lines (+40/-8)
4 files modified
mysql-test/suite/innodb/r/percona_changed_pages_log_tracking_off.result (+4/-0)
mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off-master.opt (+1/-0)
mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off.test (+22/-0)
storage/innobase/log/log0online.c (+13/-8)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1342494-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve on 2014-07-18
Review via email: mp+227327@code.launchpad.net

Description of the change

Fix bug 1342494 (InnoDB: Failing assertion:
bitmap_files->files[i].start_lsn >= bitmap_files->files[i -
1].start_lsn on inconsistent bitmap file directory).

If the bitmap directory has a bitmap file sequence with a start LSN of
one file less than a start LSN of the previous file, a debug build
will assert on a corresponding consistency check.

Fix by replacing the debug asserts with regular checks in
log_online_setup_bitmap_file_range.

Add a testcase percona_changed_pages_log_tracking_off.

http://jenkins.percona.com/job/percona-server-5.5-param/1026/

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'mysql-test/suite/innodb/r/percona_changed_pages_log_tracking_off.result'
2--- mysql-test/suite/innodb/r/percona_changed_pages_log_tracking_off.result 1970-01-01 00:00:00 +0000
3+++ mysql-test/suite/innodb/r/percona_changed_pages_log_tracking_off.result 2014-07-18 13:49:18 +0000
4@@ -0,0 +1,4 @@
5+creating inconsistent bitmap dir: start LSN of 3rd file < start LSN of 2nd file
6+call mtr.add_suppression("inconsistent bitmap file directory");
7+SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
8+ERROR HY000: Can't read record in system table
9
10=== added file 'mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off-master.opt'
11--- mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off-master.opt 1970-01-01 00:00:00 +0000
12+++ mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off-master.opt 2014-07-18 13:49:18 +0000
13@@ -0,0 +1,1 @@
14+--innodb-track-changed-pages=0
15
16=== added file 'mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off.test'
17--- mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off.test 1970-01-01 00:00:00 +0000
18+++ mysql-test/suite/innodb/t/percona_changed_pages_log_tracking_off.test 2014-07-18 13:49:18 +0000
19@@ -0,0 +1,22 @@
20+# Tests for queries from INFORMATION_SCHEMA.INNODB_CHANGED_PAGES that don't require
21+# a running log tracker
22+
23+let $MYSQLD_DATADIR= `select @@datadir`;
24+
25+# Test for bug 1342494: InnoDB: Failing assertion: bitmap_files->files[i].start_lsn
26+# >= bitmap_files->files[i - 1].start_lsn on inconsistent bitmap file directory
27+
28+--echo creating inconsistent bitmap dir: start LSN of 3rd file < start LSN of 2nd file
29+write_file $MYSQLD_DATADIR/ib_modified_log_1_0.xdb;
30+EOF
31+write_file $MYSQLD_DATADIR/ib_modified_log_2_10.xdb;
32+EOF
33+write_file $MYSQLD_DATADIR/ib_modified_log_3_5.xdb;
34+EOF
35+
36+call mtr.add_suppression("inconsistent bitmap file directory");
37+
38+--error ER_CANT_FIND_SYSTEM_REC
39+SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
40+
41+remove_files_wildcard $MYSQLD_DATADIR ib_modified_log*;
42
43=== modified file 'storage/innobase/log/log0online.c'
44--- storage/innobase/log/log0online.c 2014-07-16 09:04:59 +0000
45+++ storage/innobase/log/log0online.c 2014-07-18 13:49:18 +0000
46@@ -1268,6 +1268,7 @@
47 /*********************************************************************//**
48 Diagnose a bitmap file range setup failure and free the partially-initialized
49 bitmap file range. */
50+UNIV_COLD
51 static
52 void
53 log_online_diagnose_inconsistent_dir(
54@@ -1447,26 +1448,30 @@
55 return FALSE;
56 }
57
58-#ifdef UNIV_DEBUG
59- if (!bitmap_files->files[0].seq_num) {
60+ if (!bitmap_files->files[0].seq_num
61+ || bitmap_files->files[0].seq_num != first_file_seq_num) {
62
63 log_online_diagnose_inconsistent_dir(bitmap_files);
64 return FALSE;
65 }
66- ut_ad(bitmap_files->files[0].seq_num == first_file_seq_num);
67+
68 {
69 size_t i;
70 for (i = 1; i < bitmap_files->count; i++) {
71 if (!bitmap_files->files[i].seq_num) {
72 break;
73 }
74- ut_ad(bitmap_files->files[i].seq_num
75- > bitmap_files->files[i - 1].seq_num);
76- ut_ad(bitmap_files->files[i].start_lsn
77- >= bitmap_files->files[i - 1].start_lsn);
78+ if ((bitmap_files->files[i].seq_num
79+ <= bitmap_files->files[i - 1].seq_num)
80+ || (bitmap_files->files[i].start_lsn
81+ < bitmap_files->files[i - 1].start_lsn)) {
82+
83+ log_online_diagnose_inconsistent_dir(
84+ bitmap_files);
85+ return FALSE;
86+ }
87 }
88 }
89-#endif
90
91 return TRUE;
92 }

Subscribers

People subscribed via source and target branches