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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: 509
Merged at revision: 518
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1260035-5.6
Merge into: lp:percona-server/5.6
Diff against target: 189 lines (+75/-12)
3 files modified
Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result (+26/-3)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test (+35/-6)
Percona-Server/storage/innobase/log/log0online.cc (+14/-3)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1260035-5.6
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
George Ormond Lorch III g2 Pending
Review via email: mp+199042@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:06:21 +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,43 @@
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+call mtr.add_suppression("last tracked LSN");
38 INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
39 Before the RESET while tracking disabled:
40-ib_modified_log_1
41-ib_modified_log_2
42+ib_modified_log_5
43+ib_modified_log_6
44+ib_modified_log_7
45 RESET CHANGED_PAGE_BITMAPS;
46 After the RESET with tracking disabled:
47+Created dummy bitmap files
48+ib_modified_log_1_0.xdb
49+ib_modified_log_2_100.xdb
50+ib_modified_log_3_200.xdb
51+ib_modified_log_4_300.xdb
52+PURGE CHANGED_PAGE_BITMAPS BEFORE 99;
53+ib_modified_log_1_0.xdb
54+ib_modified_log_2_100.xdb
55+ib_modified_log_3_200.xdb
56+ib_modified_log_4_300.xdb
57+PURGE CHANGED_PAGE_BITMAPS BEFORE 200;
58+ib_modified_log_3_200.xdb
59+ib_modified_log_4_300.xdb
60+PURGE CHANGED_PAGE_BITMAPS BEFORE 500;
61+ib_modified_log_4_300.xdb
62 DROP TABLE t1;
63 CREATE TABLE CHANGED_PAGE_BITMAPS (a INT);
64 DROP TABLE CHANGED_PAGE_BITMAPS;
65
66=== modified file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test'
67--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test 2013-01-22 16:32:44 +0000
68+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test 2013-12-15 13:06:21 +0000
69@@ -4,7 +4,7 @@
70 --source include/have_innodb.inc
71
72 # Delete any existing bitmaps
73---source include/restart_mysqld.inc
74+
75 RESET CHANGED_PAGE_BITMAPS;
76
77 --source include/count_sessions.inc
78@@ -57,8 +57,7 @@
79 list_files $MYSQLD_DATADIR ib_modified_log*;
80
81 #
82-# Test that PURGE CHANGED_PAGE_BITMAPS BEFORE works. We don't test partial PURGE
83-# because it's hard to extract good LSN value for that.
84+# Test that PURGE CHANGED_PAGE_BITMAPS BEFORE works.
85 #
86
87 # PURGE that deletes nothing
88@@ -67,7 +66,7 @@
89 --replace_regex /_[[:digit:]]+\.xdb$//
90 list_files $MYSQLD_DATADIR ib_modified_log*;
91
92-# PURGE that deletes everything
93+# PURGE that deletes everything but the last file
94 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
95 # Test consecutive PURGE
96 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
97@@ -155,7 +154,7 @@
98
99 PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
100
101---echo After the PURGE that deletes everything:
102+--echo After the PURGE that deletes everything but the last file:
103 --replace_regex /_[[:digit:]]+\.xdb$//
104 list_files $MYSQLD_DATADIR ib_modified_log*;
105
106@@ -166,10 +165,11 @@
107 list_files $MYSQLD_DATADIR ib_modified_log*;
108
109 #
110-# Test RESET request with log tracking disabled
111+# Test requests with log tracking disabled
112 #
113
114 # Generate some bitmap data again
115+call mtr.add_suppression("last tracked LSN");
116 --source include/restart_mysqld.inc
117 INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
118 --source include/restart_mysqld.inc
119@@ -191,6 +191,35 @@
120 --replace_regex /_[[:digit:]]+\.xdb$//
121 list_files $MYSQLD_DATADIR ib_modified_log*;
122
123+#
124+# Bug 1260035: test PURGE with a range end in a middle of a file.
125+#
126+
127+# Create some dummy bitmaps
128+write_file $MYSQLD_DATADIR/ib_modified_log_1_0.xdb;
129+EOF
130+write_file $MYSQLD_DATADIR/ib_modified_log_2_100.xdb;
131+EOF
132+write_file $MYSQLD_DATADIR/ib_modified_log_3_200.xdb;
133+EOF
134+write_file $MYSQLD_DATADIR/ib_modified_log_4_300.xdb;
135+EOF
136+
137+--echo Created dummy bitmap files
138+list_files $MYSQLD_DATADIR ib_modified_log*;
139+
140+PURGE CHANGED_PAGE_BITMAPS BEFORE 99;
141+list_files $MYSQLD_DATADIR ib_modified_log*;
142+
143+PURGE CHANGED_PAGE_BITMAPS BEFORE 200;
144+list_files $MYSQLD_DATADIR ib_modified_log*;
145+
146+PURGE CHANGED_PAGE_BITMAPS BEFORE 500;
147+list_files $MYSQLD_DATADIR ib_modified_log*;
148+
149+# Cleanup
150+remove_file $MYSQLD_DATADIR/ib_modified_log_4_300.xdb;
151+
152 DROP TABLE t1;
153
154 #
155
156=== modified file 'Percona-Server/storage/innobase/log/log0online.cc'
157--- Percona-Server/storage/innobase/log/log0online.cc 2013-09-25 06:04:21 +0000
158+++ Percona-Server/storage/innobase/log/log0online.cc 2013-12-15 13:06:21 +0000
159@@ -1782,7 +1782,7 @@
160 mutex_enter(&log_bmp_sys->mutex);
161 }
162
163- if (!log_online_setup_bitmap_file_range(&bitmap_files, 0, lsn)) {
164+ if (!log_online_setup_bitmap_file_range(&bitmap_files, 0, LSN_MAX)) {
165 if (srv_track_changed_pages) {
166 mutex_exit(&log_bmp_sys->mutex);
167 }
168@@ -1797,8 +1797,19 @@
169 }
170
171 for (i = 0; i < bitmap_files.count; i++) {
172- if (bitmap_files.files[i].seq_num == 0
173- || bitmap_files.files[i].start_lsn >= lsn) {
174+
175+ /* We consider the end LSN of the current bitmap, derived from
176+ the start LSN of the subsequent bitmap file, to determine
177+ whether to remove the current bitmap. Note that bitmap_files
178+ does not contain an entry for the bitmap past the given LSN so
179+ we must check the boundary conditions as well. For example,
180+ consider 1_0.xdb and 2_10.xdb and querying LSN 5. bitmap_files
181+ will only contain 1_0.xdb and we must not delete it since it
182+ represents LSNs 0-9. */
183+ if ((i + 1 == bitmap_files.count
184+ || bitmap_files.files[i + 1].seq_num == 0
185+ || bitmap_files.files[i + 1].start_lsn > lsn)
186+ && (lsn != LSN_MAX)) {
187
188 break;
189 }

Subscribers

People subscribed via source and target branches