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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Sergei Glushchenko
Approved revision: 620
Merged at revision: 626
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1202252-5.6
Merge into: lp:percona-server/5.6
Diff against target: 216 lines (+142/-1)
3 files modified
mysql-test/suite/innodb/r/percona_changed_pages.result (+66/-0)
mysql-test/suite/innodb/t/percona_changed_pages.test (+65/-1)
storage/innobase/log/log0online.cc (+11/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1202252-5.6
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 Approve
Review via email: mp+226020@code.launchpad.net

Description of the change

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

Approve

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mysql-test/suite/innodb/r/percona_changed_pages.result'
2--- mysql-test/suite/innodb/r/percona_changed_pages.result 2013-05-29 10:06:41 +0000
3+++ mysql-test/suite/innodb/r/percona_changed_pages.result 2014-07-08 18:35:23 +0000
4@@ -48,6 +48,9 @@
5 WHERE START_LSN >= END_LSN;
6 COUNT(*)
7 0
8+SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
9+WHERE START_LSN < 10 AND END_LSN > 20;
10+space_id page_id start_lsn end_lsn
11 ICP tests (all should be 1):
12 SELECT COUNT(*) = @cond_test_pages_count
13 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
14@@ -104,6 +107,20 @@
15 SELECT COUNT(*) = @cond_test_pages_count
16 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
17 WHERE
18+START_LSN > (@cond_test_max_start_lsn - 1) AND
19+END_LSN <= @max_end_lsn;
20+COUNT(*) = @cond_test_pages_count
21+1
22+SELECT COUNT(*) = @cond_test_pages_count
23+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
24+WHERE
25+START_LSN >= @cond_test_max_start_lsn AND
26+END_LSN < (@max_end_lsn + 1);
27+COUNT(*) = @cond_test_pages_count
28+1
29+SELECT COUNT(*) = @cond_test_pages_count
30+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
31+WHERE
32 START_LSN >= @cond_test_max_start_lsn AND
33 END_LSN >= @cond_test_max_start_lsn;
34 COUNT(*) = @cond_test_pages_count
35@@ -129,6 +146,55 @@
36 END_LSN < @cond_test_max_lsn - 10;
37 COUNT(*)
38 0
39+SELECT COUNT(*)
40+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
41+WHERE
42+START_LSN <= (@min_start_lsn - 1);
43+COUNT(*)
44+0
45+SELECT COUNT(*)
46+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
47+WHERE
48+START_LSN < @min_start_lsn;
49+COUNT(*)
50+0
51+SELECT COUNT(*)
52+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
53+WHERE
54+END_LSN > @max_end_lsn;
55+COUNT(*)
56+0
57+SELECT COUNT(*)
58+FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
59+WHERE
60+END_LSN >= (@max_end_lsn + 1);
61+COUNT(*)
62+0
63+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
64+WHERE START_LSN = (@min_start_lsn - 1);
65+COUNT(*)
66+0
67+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
68+WHERE START_LSN < @min_start_lsn OR END_LSN > @max_end_lsn;
69+COUNT(*)
70+0
71+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
72+WHERE START_LSN <= (@min_start_lsn - 1) OR END_LSN > @max_end_lsn;
73+COUNT(*)
74+0
75+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
76+WHERE START_LSN < @min_start_lsn OR END_LSN >= (@max_end_lsn + 1);
77+COUNT(*)
78+0
79+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
80+WHERE START_LSN <= (@min_start_lsn - 1) OR END_LSN >= (@max_end_lsn + 1);
81+COUNT(*)
82+0
83+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
84+WHERE (START_LSN > @cond_test_max_lsn AND END_LSN < @cond_test_max_lsn)
85+OR (START_LSN > @cond_test_max_lsn + 10 AND END_LSN < @cond_test_max_lsn - 10);
86+COUNT(*)
87+0
88 SELECT @total_pages=@r1_r4_pages AS should_be_1;
89 should_be_1
90 1
91
92=== modified file 'mysql-test/suite/innodb/t/percona_changed_pages.test'
93--- mysql-test/suite/innodb/t/percona_changed_pages.test 2013-05-29 10:06:41 +0000
94+++ mysql-test/suite/innodb/t/percona_changed_pages.test 2014-07-08 18:35:23 +0000
95@@ -102,6 +102,10 @@
96 # Gather data for condition pushdown testing not using conditions #
97 ###################################################################
98 --disable_result_log
99+SET @min_start_lsn=
100+ (SELECT MIN(start_lsn)
101+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES);
102+
103 SET @max_end_lsn=
104 (SELECT MAX(end_lsn)
105 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES);
106@@ -142,6 +146,12 @@
107 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
108 WHERE START_LSN >= END_LSN;
109
110+# Test for https://bugs.launchpad.net/percona-server/+bug/1202252
111+# and https://mariadb.atlassian.net/browse/MDEV-4791: ICP crashes for
112+# start_lsn < X AND end_lsn > Y, if X < Y
113+SELECT * FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
114+ WHERE START_LSN < 10 AND END_LSN > 20;
115+
116 ######################################################
117 # Check if condition pushdown doesn't break anything #
118 ######################################################
119@@ -195,6 +205,18 @@
120 SELECT COUNT(*) = @cond_test_pages_count
121 FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
122 WHERE
123+ START_LSN > (@cond_test_max_start_lsn - 1) AND
124+ END_LSN <= @max_end_lsn;
125+
126+SELECT COUNT(*) = @cond_test_pages_count
127+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
128+ WHERE
129+ START_LSN >= @cond_test_max_start_lsn AND
130+ END_LSN < (@max_end_lsn + 1);
131+
132+SELECT COUNT(*) = @cond_test_pages_count
133+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
134+ WHERE
135 START_LSN >= @cond_test_max_start_lsn AND
136 END_LSN >= @cond_test_max_start_lsn;
137
138@@ -216,6 +238,48 @@
139 WHERE
140 START_LSN > @cond_test_max_lsn + 10 AND
141 END_LSN < @cond_test_max_lsn - 10;
142+
143+SELECT COUNT(*)
144+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
145+ WHERE
146+ START_LSN <= (@min_start_lsn - 1);
147+
148+SELECT COUNT(*)
149+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
150+ WHERE
151+ START_LSN < @min_start_lsn;
152+
153+SELECT COUNT(*)
154+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
155+ WHERE
156+ END_LSN > @max_end_lsn;
157+
158+SELECT COUNT(*)
159+ FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
160+ WHERE
161+ END_LSN >= (@max_end_lsn + 1);
162+
163+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
164+ WHERE START_LSN = (@min_start_lsn - 1);
165+
166+# Queries from a MariaDB patch for https://mariadb.atlassian.net/browse/MDEV-4791
167+# with various conditions that are not supported by ICP
168+# All must return empty set
169+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
170+ WHERE START_LSN < @min_start_lsn OR END_LSN > @max_end_lsn;
171+
172+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
173+ WHERE START_LSN <= (@min_start_lsn - 1) OR END_LSN > @max_end_lsn;
174+
175+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
176+ WHERE START_LSN < @min_start_lsn OR END_LSN >= (@max_end_lsn + 1);
177+
178+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
179+ WHERE START_LSN <= (@min_start_lsn - 1) OR END_LSN >= (@max_end_lsn + 1);
180+
181+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES
182+ WHERE (START_LSN > @cond_test_max_lsn AND END_LSN < @cond_test_max_lsn)
183+ OR (START_LSN > @cond_test_max_lsn + 10 AND END_LSN < @cond_test_max_lsn - 10);
184
185 # Test the combination of ICP and bitmap file selection
186 --disable_query_log
187@@ -246,7 +310,7 @@
188 SELECT @r1_r2_pages+@r2_r3_pages+@r3_r4_pages=@r1_r4_pages AS should_be_1;
189 SELECT @r1_r2_pages+@r2_r3_pages=@r1_r3_pages AS should_be_1;
190 SELECT @r2_r3_pages+@r3_r4_pages=@r2_r4_pages AS should_be_1;
191-
192+
193 ################################################
194 # Check how limit for maximum rows count works #
195 ################################################
196
197=== modified file 'storage/innobase/log/log0online.cc'
198--- storage/innobase/log/log0online.cc 2014-04-25 10:55:01 +0000
199+++ storage/innobase/log/log0online.cc 2014-07-08 18:35:23 +0000
200@@ -1584,6 +1584,17 @@
201 {
202 ut_a(i);
203
204+ if (UNIV_UNLIKELY(min_lsn > max_lsn)) {
205+
206+ /* Empty range */
207+ i->in_files.count = 0;
208+ i->in_files.files = NULL;
209+ i->in.file = os_file_invalid;
210+ i->page = NULL;
211+ i->failed = FALSE;
212+ return TRUE;
213+ }
214+
215 if (!log_online_setup_bitmap_file_range(&i->in_files, min_lsn,
216 max_lsn)) {
217

Subscribers

People subscribed via source and target branches