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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: 590
Merged at revision: 610
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1260035-5.5
Merge into: lp:percona-server/5.5
Diff against target: 184 lines (+73/-10)
3 files modified
Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result (+23/-1)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test (+34/-6)
Percona-Server/storage/innobase/log/log0online.c (+16/-3)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1260035-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
George Ormond Lorch III g2 Pending
Review via email: mp+199041@code.launchpad.net

This proposal supersedes a proposal from 2013-12-12.

To post a comment you must log in.
Revision history for this message
George Ormond Lorch III (gl-az) : Posted in a previous version of this proposal
review: Approve (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result'
2--- Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result 2013-01-22 16:32:44 +0000
3+++ Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result 2013-12-15 13:05:00 +0000
4@@ -19,11 +19,13 @@
5 ib_modified_log_2
6 PURGE CHANGED_PAGE_BITMAPS BEFORE 1;
7 After PURGE ... BEFORE 1:
8+ib_modified_log_1
9 ib_modified_log_2
10 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
11 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
12 INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
13 After PURGE ... BEFORE 100000000 and restart:
14+ib_modified_log_3
15 ib_modified_log_4
16 ib_modified_log_5
17 PURGE CHANGED_PAGE_BITMAPS BEFORE 5+5;
18@@ -55,22 +57,42 @@
19 0
20 FLUSH CHANGED_PAGE_BITMAPS;
21 Before the PURGE with tracking disabled
22+ib_modified_log_3
23 ib_modified_log_4
24 ib_modified_log_5
25 PURGE CHANGED_PAGE_BITMAPS BEFORE 1;
26 After the PURGE that deletes nothing:
27+ib_modified_log_3
28 ib_modified_log_4
29 ib_modified_log_5
30 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
31-After the PURGE that deletes everything:
32+After the PURGE that deletes everything but the last file:
33+ib_modified_log_5
34 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
35 After the repeated PURGE:
36+ib_modified_log_5
37 INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
38 Before the RESET while tracking disabled:
39 ib_modified_log_1
40 ib_modified_log_2
41+ib_modified_log_5
42 RESET CHANGED_PAGE_BITMAPS;
43 After the RESET with tracking disabled:
44+Created dummy bitmap files
45+ib_modified_log_1_0.xdb
46+ib_modified_log_2_100.xdb
47+ib_modified_log_3_200.xdb
48+ib_modified_log_4_300.xdb
49+PURGE CHANGED_PAGE_BITMAPS BEFORE 99;
50+ib_modified_log_1_0.xdb
51+ib_modified_log_2_100.xdb
52+ib_modified_log_3_200.xdb
53+ib_modified_log_4_300.xdb
54+PURGE CHANGED_PAGE_BITMAPS BEFORE 200;
55+ib_modified_log_3_200.xdb
56+ib_modified_log_4_300.xdb
57+PURGE CHANGED_PAGE_BITMAPS BEFORE 500;
58+ib_modified_log_4_300.xdb
59 DROP TABLE t1;
60 CREATE TABLE CHANGED_PAGE_BITMAPS (a INT);
61 DROP TABLE CHANGED_PAGE_BITMAPS;
62
63=== modified file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test'
64--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test 2013-01-22 16:32:44 +0000
65+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test 2013-12-15 13:05:00 +0000
66@@ -4,7 +4,7 @@
67 --source include/have_innodb.inc
68
69 # Delete any existing bitmaps
70---source include/restart_mysqld.inc
71+
72 RESET CHANGED_PAGE_BITMAPS;
73
74 --source include/count_sessions.inc
75@@ -57,8 +57,7 @@
76 list_files $MYSQLD_DATADIR ib_modified_log*;
77
78 #
79-# Test that PURGE CHANGED_PAGE_BITMAPS BEFORE works. We don't test partial PURGE
80-# because it's hard to extract good LSN value for that.
81+# Test that PURGE CHANGED_PAGE_BITMAPS BEFORE works.
82 #
83
84 # PURGE that deletes nothing
85@@ -67,7 +66,7 @@
86 --replace_regex /_[[:digit:]]+\.xdb$//
87 list_files $MYSQLD_DATADIR ib_modified_log*;
88
89-# PURGE that deletes everything
90+# PURGE that deletes everything but the last file
91 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
92 # Test consecutive PURGE
93 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
94@@ -155,7 +154,7 @@
95
96 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
97
98---echo After the PURGE that deletes everything:
99+--echo After the PURGE that deletes everything but the last file:
100 --replace_regex /_[[:digit:]]+\.xdb$//
101 list_files $MYSQLD_DATADIR ib_modified_log*;
102
103@@ -166,7 +165,7 @@
104 list_files $MYSQLD_DATADIR ib_modified_log*;
105
106 #
107-# Test RESET request with log tracking disabled
108+# Test requests with log tracking disabled
109 #
110
111 # Generate some bitmap data again
112@@ -191,6 +190,35 @@
113 --replace_regex /_[[:digit:]]+\.xdb$//
114 list_files $MYSQLD_DATADIR ib_modified_log*;
115
116+#
117+# Bug 1260035: test PURGE with a range end in a middle of a file.
118+#
119+
120+# Create some dummy bitmaps
121+write_file $MYSQLD_DATADIR/ib_modified_log_1_0.xdb;
122+EOF
123+write_file $MYSQLD_DATADIR/ib_modified_log_2_100.xdb;
124+EOF
125+write_file $MYSQLD_DATADIR/ib_modified_log_3_200.xdb;
126+EOF
127+write_file $MYSQLD_DATADIR/ib_modified_log_4_300.xdb;
128+EOF
129+
130+--echo Created dummy bitmap files
131+list_files $MYSQLD_DATADIR ib_modified_log*;
132+
133+PURGE CHANGED_PAGE_BITMAPS BEFORE 99;
134+list_files $MYSQLD_DATADIR ib_modified_log*;
135+
136+PURGE CHANGED_PAGE_BITMAPS BEFORE 200;
137+list_files $MYSQLD_DATADIR ib_modified_log*;
138+
139+PURGE CHANGED_PAGE_BITMAPS BEFORE 500;
140+list_files $MYSQLD_DATADIR ib_modified_log*;
141+
142+# Cleanup
143+remove_file $MYSQLD_DATADIR/ib_modified_log_4_300.xdb;
144+
145 DROP TABLE t1;
146
147 #
148
149=== modified file 'Percona-Server/storage/innobase/log/log0online.c'
150--- Percona-Server/storage/innobase/log/log0online.c 2013-09-25 05:52:09 +0000
151+++ Percona-Server/storage/innobase/log/log0online.c 2013-12-15 13:05:00 +0000
152@@ -1790,7 +1790,8 @@
153 mutex_enter(&log_bmp_sys->mutex);
154 }
155
156- if (!log_online_setup_bitmap_file_range(&bitmap_files, 0, lsn)) {
157+ if (!log_online_setup_bitmap_file_range(&bitmap_files, 0,
158+ IB_ULONGLONG_MAX)) {
159 if (srv_track_changed_pages) {
160 mutex_exit(&log_bmp_sys->mutex);
161 }
162@@ -1805,8 +1806,20 @@
163 }
164
165 for (i = 0; i < bitmap_files.count; i++) {
166- if (bitmap_files.files[i].seq_num == 0
167- || bitmap_files.files[i].start_lsn >= lsn) {
168+
169+ /* We consider the end LSN of the current bitmap, derived from
170+ the start LSN of the subsequent bitmap file, to determine
171+ whether to remove the current bitmap. Note that bitmap_files
172+ does not contain an entry for the bitmap past the given LSN so
173+ we must check the boundary conditions as well. For example,
174+ consider 1_0.xdb and 2_10.xdb and querying LSN 5. bitmap_files
175+ will only contain 1_0.xdb and we must not delete it since it
176+ represents LSNs 0-9. */
177+ if ((i + 1 == bitmap_files.count
178+ || bitmap_files.files[i + 1].seq_num == 0
179+ || bitmap_files.files[i + 1].start_lsn > lsn)
180+ && (lsn != IB_ULONGLONG_MAX)) {
181+
182 break;
183 }
184 if (!os_file_delete_if_exists(bitmap_files.files[i].name)) {

Subscribers

People subscribed via source and target branches