Merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1108613-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 486
Proposed branch: lp:~laurynas-biveinis/percona-server/BT-16274-bug1108613-5.5
Merge into: lp:percona-server/5.5
Prerequisite: lp:~laurynas-biveinis/percona-server/BT-16274-bug1083669-5.5
Diff against target: 128 lines (+67/-6)
6 files modified
Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp.result (+13/-1)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp-master.opt (+1/-1)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp.test (+40/-1)
Percona-Server/storage/innobase/log/log0log.c (+4/-1)
Percona-Server/storage/innobase/log/log0online.c (+4/-2)
Percona-Server/storage/innobase/srv/srv0start.c (+5/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/BT-16274-bug1108613-5.5
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
George Ormond Lorch III (community) g2 Approve
Review via email: mp+146593@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Please ignore diff lines 38--63 and srv0start.c, or better yet, review the commit 415. The MP diff contains extra changes because I can set only one prerequisite branch.

Revision history for this message
George Ormond Lorch III (gl-az) wrote :

Laurynas, can you offer some detail how to recover from this situation if/when it occurs? If this happens I assume that the next attempt at an incremental backup will use a slow incremental. Is there any possibility of a race between XB and PS from the point of detecting srv_track_changed_pages=TRUE, hitting this error, which stops change tracking, then XB attempting to access/use the bitmap which is no longer being updated?

review: Needs Information (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

George -

The situation is not recoverable from the bitmap backup point of view for the overwritten LSNs. So it will have to use the slow incremental backup for that time.

I don't see a possibility for a race condition. XB uses the bitmaps only if it has the full data for the required LSN interval and is not concerned with the current tracking state or anything like that. So what would happen is that tracking stops with the resulting bitmap data not covering the desired interval, XB detects this, switches to slow incrementals.

Revision history for this message
George Ormond Lorch III (gl-az) wrote :

OK. By 'recovery' I mean making it clear how to get 'back on track' WRT incrementals and bitmap tracking. If it is possible to simply re-enable bitmap tracking after this error and a slow incremental is done, then we should make that process clear. I just want to make sure that if/when this is encountered, it is easily recognized and can be worked around to get the feature functioning again. If though, once this error occurs, one can _never_ use changed page bitmaps again, then I think we have a bigger issue and need to address it somehow.

review: Needs Information (g2)
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The current limitation will be documented by Hrvoje and might be lifted by implementing https://blueprints.launchpad.net/percona-server/+spec/online-log-tracking-restart .

Revision history for this message
George Ormond Lorch III (gl-az) wrote :

OK, sounds good.

review: Approve (g2)
Revision history for this message
Stewart Smith (stewart) :
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.result'
2--- Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp.result 2013-01-31 11:52:07 +0000
3+++ Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp.result 2013-02-05 09:53:25 +0000
4@@ -44,4 +44,16 @@
5 ib_modified_log_1
6 ib_modified_log_2
7 7th restart
8-DROP TABLE t1, t2;
9+ib_modified_log_1
10+ib_modified_log_2
11+ib_modified_log_3
12+8th restart
13+RESET CHANGED_PAGE_BITMAPS;
14+call mtr.add_suppression("InnoDB: Error: page [0-9]* log sequence number [0-9]*");
15+9th restart
16+CREATE TABLE t3 (a MEDIUMBLOB) ENGINE=InnoDB;
17+call mtr.add_suppression("InnoDB: Error: the age of the oldest untracked record exceeds the log group capacity!");
18+call mtr.add_suppression("InnoDB: Error: stopping the log tracking thread at LSN");
19+INSERT INTO t3 VALUES (REPEAT('a', 12582912));
20+10th restart
21+DROP TABLE t1, t2, t3;
22
23=== modified file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp-master.opt'
24--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp-master.opt 2013-01-31 11:52:07 +0000
25+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp-master.opt 2013-02-05 09:53:25 +0000
26@@ -1,1 +1,1 @@
27---innodb_track_changed_pages=TRUE --innodb_log_file_size=5M --innodb_file_per_table
28+--innodb_track_changed_pages=TRUE --innodb_log_file_size=5M --innodb_file_per_table --max_allowed_packet=13631488
29
30=== modified file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp.test'
31--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp.test 2013-01-31 11:52:07 +0000
32+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp.test 2013-02-05 09:53:25 +0000
33@@ -198,4 +198,43 @@
34 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
35 --source include/wait_until_connected_again.inc
36
37-DROP TABLE t1, t2;
38+# TODO: check the tracked LSN range continuity once this info is exposed through
39+# INFORMATION_SCHEMA.
40+
41+file_exists $BITMAP_FILE;
42+--replace_regex /_[[:digit:]]+\.xdb$//
43+list_files $MYSQLD_DATADIR ib_modified_log*;
44+
45+#
46+# Test for log tracking compatibility with innodb_force_recovery (bug 1083596).
47+#
48+
49+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
50+--shutdown_server 10
51+--source include/wait_until_disconnected.inc
52+--enable_reconnect
53+--echo 8th restart
54+--exec echo "restart:--innodb-force-recovery=6" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
55+--source include/wait_until_connected_again.inc
56+
57+# innodb_force_recovery desyncs bitmap data and logs
58+RESET CHANGED_PAGE_BITMAPS;
59+
60+call mtr.add_suppression("InnoDB: Error: page [0-9]* log sequence number [0-9]*");
61+--echo 9th restart
62+--source include/restart_mysqld.inc
63+
64+#
65+# Test that impossible to track log is handled gracefully (bug 1108613)
66+#
67+CREATE TABLE t3 (a MEDIUMBLOB) ENGINE=InnoDB;
68+
69+call mtr.add_suppression("InnoDB: Error: the age of the oldest untracked record exceeds the log group capacity!");
70+call mtr.add_suppression("InnoDB: Error: stopping the log tracking thread at LSN");
71+
72+INSERT INTO t3 VALUES (REPEAT('a', 12582912));
73+
74+--echo 10th restart
75+--source include/restart_mysqld.inc
76+
77+DROP TABLE t1, t2, t3;
78
79=== modified file 'Percona-Server/storage/innobase/log/log0log.c'
80--- Percona-Server/storage/innobase/log/log0log.c 2013-01-04 15:24:45 +0000
81+++ Percona-Server/storage/innobase/log/log0log.c 2013-02-05 09:53:25 +0000
82@@ -492,9 +492,12 @@
83
84 if (tracked_lsn_age >= log->log_group_capacity) {
85
86- fprintf(stderr, " InnoDB: Error: the age of the "
87+ fprintf(stderr, "InnoDB: Error: the age of the "
88 "oldest untracked record exceeds the log "
89 "group capacity!\n");
90+ fprintf(stderr, "InnoDB: Error: stopping the log "
91+ "tracking thread at LSN %llu\n", tracked_lsn);
92+ srv_track_changed_pages = FALSE;
93 }
94 }
95
96
97=== modified file 'Percona-Server/storage/innobase/log/log0online.c'
98--- Percona-Server/storage/innobase/log/log0online.c 2013-02-05 09:53:25 +0000
99+++ Percona-Server/storage/innobase/log/log0online.c 2013-02-05 09:53:25 +0000
100@@ -413,8 +413,10 @@
101
102 if (last_tracked_lsn > tracking_start_lsn) {
103 fprintf(stderr,
104- "InnoDB: Error: last tracked LSN is in future. This "
105- "can be caused by mismatched bitmap files.\n");
106+ "InnoDB: Error: last tracked LSN %llu is ahead of "
107+ "tracking start LSN %llu. This can be caused by "
108+ "mismatched bitmap files.\n", last_tracked_lsn,
109+ tracking_start_lsn);
110 exit(1);
111 }
112
113
114=== modified file 'Percona-Server/storage/innobase/srv/srv0start.c'
115--- Percona-Server/storage/innobase/srv/srv0start.c 2012-11-25 09:30:58 +0000
116+++ Percona-Server/storage/innobase/srv/srv0start.c 2013-02-05 09:53:25 +0000
117@@ -1155,6 +1155,11 @@
118 init_log_online(void)
119 /*=================*/
120 {
121+ if (UNIV_UNLIKELY(srv_force_recovery > 0)) {
122+ srv_track_changed_pages = FALSE;
123+ return;
124+ }
125+
126 if (srv_track_changed_pages) {
127
128 log_online_read_init();

Subscribers

People subscribed via source and target branches