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: no longer in the source branch.
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
=== modified file 'Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result'
--- Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result 2013-01-22 16:32:44 +0000
+++ Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_requests.result 2013-12-15 13:06:21 +0000
@@ -19,11 +19,13 @@
19ib_modified_log_219ib_modified_log_2
20PURGE CHANGED_PAGE_BITMAPS BEFORE 1;20PURGE CHANGED_PAGE_BITMAPS BEFORE 1;
21After PURGE ... BEFORE 1:21After PURGE ... BEFORE 1:
22ib_modified_log_1
22ib_modified_log_223ib_modified_log_2
23PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;24PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
24PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;25PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
25INSERT INTO t1 VALUES (1),(2),(3),(4),(5);26INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
26After PURGE ... BEFORE 100000000 and restart:27After PURGE ... BEFORE 100000000 and restart:
28ib_modified_log_3
27ib_modified_log_429ib_modified_log_4
28ib_modified_log_530ib_modified_log_5
29PURGE CHANGED_PAGE_BITMAPS BEFORE 5+5;31PURGE CHANGED_PAGE_BITMAPS BEFORE 5+5;
@@ -55,22 +57,43 @@
550570
56FLUSH CHANGED_PAGE_BITMAPS;58FLUSH CHANGED_PAGE_BITMAPS;
57Before the PURGE with tracking disabled59Before the PURGE with tracking disabled
60ib_modified_log_3
58ib_modified_log_461ib_modified_log_4
59ib_modified_log_562ib_modified_log_5
60PURGE CHANGED_PAGE_BITMAPS BEFORE 1;63PURGE CHANGED_PAGE_BITMAPS BEFORE 1;
61After the PURGE that deletes nothing:64After the PURGE that deletes nothing:
65ib_modified_log_3
62ib_modified_log_466ib_modified_log_4
63ib_modified_log_567ib_modified_log_5
64PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;68PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
65After the PURGE that deletes everything:69After the PURGE that deletes everything but the last file:
70ib_modified_log_5
66PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;71PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
67After the repeated PURGE:72After the repeated PURGE:
73ib_modified_log_5
74call mtr.add_suppression("last tracked LSN");
68INSERT INTO t1 VALUES (1),(2),(3),(4),(5);75INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
69Before the RESET while tracking disabled:76Before the RESET while tracking disabled:
70ib_modified_log_177ib_modified_log_5
71ib_modified_log_278ib_modified_log_6
79ib_modified_log_7
72RESET CHANGED_PAGE_BITMAPS;80RESET CHANGED_PAGE_BITMAPS;
73After the RESET with tracking disabled:81After the RESET with tracking disabled:
82Created dummy bitmap files
83ib_modified_log_1_0.xdb
84ib_modified_log_2_100.xdb
85ib_modified_log_3_200.xdb
86ib_modified_log_4_300.xdb
87PURGE CHANGED_PAGE_BITMAPS BEFORE 99;
88ib_modified_log_1_0.xdb
89ib_modified_log_2_100.xdb
90ib_modified_log_3_200.xdb
91ib_modified_log_4_300.xdb
92PURGE CHANGED_PAGE_BITMAPS BEFORE 200;
93ib_modified_log_3_200.xdb
94ib_modified_log_4_300.xdb
95PURGE CHANGED_PAGE_BITMAPS BEFORE 500;
96ib_modified_log_4_300.xdb
74DROP TABLE t1;97DROP TABLE t1;
75CREATE TABLE CHANGED_PAGE_BITMAPS (a INT);98CREATE TABLE CHANGED_PAGE_BITMAPS (a INT);
76DROP TABLE CHANGED_PAGE_BITMAPS;99DROP TABLE CHANGED_PAGE_BITMAPS;
77100
=== modified file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test'
--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test 2013-01-22 16:32:44 +0000
+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_requests.test 2013-12-15 13:06:21 +0000
@@ -4,7 +4,7 @@
4--source include/have_innodb.inc4--source include/have_innodb.inc
55
6# Delete any existing bitmaps6# Delete any existing bitmaps
7--source include/restart_mysqld.inc7
8RESET CHANGED_PAGE_BITMAPS;8RESET CHANGED_PAGE_BITMAPS;
99
10--source include/count_sessions.inc10--source include/count_sessions.inc
@@ -57,8 +57,7 @@
57list_files $MYSQLD_DATADIR ib_modified_log*;57list_files $MYSQLD_DATADIR ib_modified_log*;
5858
59#59#
60# Test that PURGE CHANGED_PAGE_BITMAPS BEFORE works. We don't test partial PURGE60# Test that PURGE CHANGED_PAGE_BITMAPS BEFORE works.
61# because it's hard to extract good LSN value for that.
62#61#
6362
64# PURGE that deletes nothing63# PURGE that deletes nothing
@@ -67,7 +66,7 @@
67--replace_regex /_[[:digit:]]+\.xdb$//66--replace_regex /_[[:digit:]]+\.xdb$//
68list_files $MYSQLD_DATADIR ib_modified_log*;67list_files $MYSQLD_DATADIR ib_modified_log*;
6968
70# PURGE that deletes everything69# PURGE that deletes everything but the last file
71PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;70PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
72# Test consecutive PURGE71# Test consecutive PURGE
73PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;72PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
@@ -155,7 +154,7 @@
155154
156PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;155PURGE CHANGED_PAGE_BITMAPS BEFORE 100000000;
157156
158--echo After the PURGE that deletes everything:157--echo After the PURGE that deletes everything but the last file:
159--replace_regex /_[[:digit:]]+\.xdb$//158--replace_regex /_[[:digit:]]+\.xdb$//
160list_files $MYSQLD_DATADIR ib_modified_log*;159list_files $MYSQLD_DATADIR ib_modified_log*;
161160
@@ -166,10 +165,11 @@
166list_files $MYSQLD_DATADIR ib_modified_log*;165list_files $MYSQLD_DATADIR ib_modified_log*;
167166
168#167#
169# Test RESET request with log tracking disabled168# Test requests with log tracking disabled
170#169#
171170
172# Generate some bitmap data again171# Generate some bitmap data again
172call mtr.add_suppression("last tracked LSN");
173--source include/restart_mysqld.inc173--source include/restart_mysqld.inc
174INSERT INTO t1 VALUES (1),(2),(3),(4),(5);174INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
175--source include/restart_mysqld.inc175--source include/restart_mysqld.inc
@@ -191,6 +191,35 @@
191--replace_regex /_[[:digit:]]+\.xdb$//191--replace_regex /_[[:digit:]]+\.xdb$//
192list_files $MYSQLD_DATADIR ib_modified_log*;192list_files $MYSQLD_DATADIR ib_modified_log*;
193193
194#
195# Bug 1260035: test PURGE with a range end in a middle of a file.
196#
197
198# Create some dummy bitmaps
199write_file $MYSQLD_DATADIR/ib_modified_log_1_0.xdb;
200EOF
201write_file $MYSQLD_DATADIR/ib_modified_log_2_100.xdb;
202EOF
203write_file $MYSQLD_DATADIR/ib_modified_log_3_200.xdb;
204EOF
205write_file $MYSQLD_DATADIR/ib_modified_log_4_300.xdb;
206EOF
207
208--echo Created dummy bitmap files
209list_files $MYSQLD_DATADIR ib_modified_log*;
210
211PURGE CHANGED_PAGE_BITMAPS BEFORE 99;
212list_files $MYSQLD_DATADIR ib_modified_log*;
213
214PURGE CHANGED_PAGE_BITMAPS BEFORE 200;
215list_files $MYSQLD_DATADIR ib_modified_log*;
216
217PURGE CHANGED_PAGE_BITMAPS BEFORE 500;
218list_files $MYSQLD_DATADIR ib_modified_log*;
219
220# Cleanup
221remove_file $MYSQLD_DATADIR/ib_modified_log_4_300.xdb;
222
194DROP TABLE t1;223DROP TABLE t1;
195224
196#225#
197226
=== modified file 'Percona-Server/storage/innobase/log/log0online.cc'
--- Percona-Server/storage/innobase/log/log0online.cc 2013-09-25 06:04:21 +0000
+++ Percona-Server/storage/innobase/log/log0online.cc 2013-12-15 13:06:21 +0000
@@ -1782,7 +1782,7 @@
1782 mutex_enter(&log_bmp_sys->mutex);1782 mutex_enter(&log_bmp_sys->mutex);
1783 }1783 }
17841784
1785 if (!log_online_setup_bitmap_file_range(&bitmap_files, 0, lsn)) {1785 if (!log_online_setup_bitmap_file_range(&bitmap_files, 0, LSN_MAX)) {
1786 if (srv_track_changed_pages) {1786 if (srv_track_changed_pages) {
1787 mutex_exit(&log_bmp_sys->mutex);1787 mutex_exit(&log_bmp_sys->mutex);
1788 }1788 }
@@ -1797,8 +1797,19 @@
1797 }1797 }
17981798
1799 for (i = 0; i < bitmap_files.count; i++) {1799 for (i = 0; i < bitmap_files.count; i++) {
1800 if (bitmap_files.files[i].seq_num == 01800
1801 || bitmap_files.files[i].start_lsn >= lsn) {1801 /* We consider the end LSN of the current bitmap, derived from
1802 the start LSN of the subsequent bitmap file, to determine
1803 whether to remove the current bitmap. Note that bitmap_files
1804 does not contain an entry for the bitmap past the given LSN so
1805 we must check the boundary conditions as well. For example,
1806 consider 1_0.xdb and 2_10.xdb and querying LSN 5. bitmap_files
1807 will only contain 1_0.xdb and we must not delete it since it
1808 represents LSNs 0-9. */
1809 if ((i + 1 == bitmap_files.count
1810 || bitmap_files.files[i + 1].seq_num == 0
1811 || bitmap_files.files[i + 1].start_lsn > lsn)
1812 && (lsn != LSN_MAX)) {
18021813
1803 break;1814 break;
1804 }1815 }

Subscribers

People subscribed via source and target branches