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

Proposed by Laurynas Biveinis on 2013-09-25
Status: Merged
Approved by: Vlad Lesin on 2013-09-26
Approved revision: 560
Merged at revision: 574
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1191580-1191589-5.5
Merge into: lp:percona-server/5.5
Prerequisite: lp:~laurynas-biveinis/percona-server/bug1217002-5.5
Diff against target: 158 lines (+73/-7)
4 files modified
Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_debug.result (+6/-0)
Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug.test (+31/-0)
Percona-Server/storage/innobase/handler/i_s.cc (+2/-0)
Percona-Server/storage/innobase/log/log0online.c (+34/-7)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1191580-1191589-5.5
Reviewer Review Type Date Requested Status
Vlad Lesin (community) g2 2013-09-25 Approve on 2013-09-26
Registry Administrators 2013-09-25 Pending
Review via email: mp+187457@code.launchpad.net

This proposal supersedes a proposal from 2013-09-20.

Description of the change

To post a comment you must log in.
Vlad Lesin (vlad-lesin) :
review: Approve (g2)

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_debug.result'
2--- Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_debug.result 2013-09-09 13:23:00 +0000
3+++ Percona-Server/mysql-test/suite/innodb/r/percona_changed_page_bmp_debug.result 2013-09-25 08:01:43 +0000
4@@ -34,5 +34,11 @@
5 SET @@GLOBAL.innodb_track_changed_pages=TRUE;
6 SET @@GLOBAL.innodb_track_redo_log_now=TRUE;
7 SET DEBUG_SYNC="now SIGNAL finish_alter_table";
8+SET DEBUG_SYNC="setup_bitmap_range_middle SIGNAL changed_pages_query_ready WAIT_FOR finish_changed_pages_query";
9+SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
10+SET DEBUG_SYNC="now WAIT_FOR changed_pages_query_ready";
11+call mtr.add_suppression("InnoDB: Warning: inconsistent bitmap file directory");
12+SET DEBUG_SYNC="now SIGNAL finish_changed_pages_query";
13+ERROR HY000: Can't read record in system table
14 SET DEBUG_SYNC="RESET";
15 DROP TABLE t2;
16
17=== modified file 'Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug.test'
18--- Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug.test 2013-09-09 13:23:00 +0000
19+++ Percona-Server/mysql-test/suite/innodb/t/percona_changed_page_bmp_debug.test 2013-09-25 08:01:43 +0000
20@@ -94,6 +94,37 @@
21
22 --connection default
23 reap;
24+
25+#
26+# Test for
27+# - bug 1191580 (InnoDB: Failing assertion: bitmap_files->files[0].seq_num
28+# == first_file_seq_num in file log0online.cc line 1423 | abort in
29+# log_online_setup_bitmap_file_range)
30+# - bug 1191589 (mysqld-debug: .../sql/protocol.cc:518: void
31+# Protocol::end_statement(): Assertion `0' failed on a
32+# INFORMATION_SCHEMA.INNODB_CHANGED_PAGES query)
33+#
34+
35+SET DEBUG_SYNC="setup_bitmap_range_middle SIGNAL changed_pages_query_ready WAIT_FOR finish_changed_pages_query";
36+
37+send SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_CHANGED_PAGES;
38+
39+--connection con2
40+
41+SET DEBUG_SYNC="now WAIT_FOR changed_pages_query_ready";
42+
43+# Remove the first bitmap file in the range after it has been enumerated
44+remove_files_wildcard $MYSQLD_DATADIR ib_modified_log_1_*.xdb;
45+
46+call mtr.add_suppression("InnoDB: Warning: inconsistent bitmap file directory");
47+
48+SET DEBUG_SYNC="now SIGNAL finish_changed_pages_query";
49+
50+--connection default
51+
52+--error ER_CANT_FIND_SYSTEM_REC
53+reap;
54+
55 SET DEBUG_SYNC="RESET";
56
57 disconnect con2;
58
59=== modified file 'Percona-Server/storage/innobase/handler/i_s.cc'
60--- Percona-Server/storage/innobase/handler/i_s.cc 2013-08-14 03:52:04 +0000
61+++ Percona-Server/storage/innobase/handler/i_s.cc 2013-09-25 08:01:43 +0000
62@@ -7509,6 +7509,7 @@
63 }
64
65 if (!log_online_bitmap_iterator_init(&i, min_lsn, max_lsn)) {
66+ my_error(ER_CANT_FIND_SYSTEM_REC, MYF(0));
67 DBUG_RETURN(1);
68 }
69
70@@ -7572,6 +7573,7 @@
71 if (schema_table_store_record(thd, table))
72 {
73 log_online_bitmap_iterator_release(&i);
74+ my_error(ER_CANT_FIND_SYSTEM_REC, MYF(0));
75 DBUG_RETURN(1);
76 }
77
78
79=== modified file 'Percona-Server/storage/innobase/log/log0online.c'
80--- Percona-Server/storage/innobase/log/log0online.c 2013-06-01 15:04:43 +0000
81+++ Percona-Server/storage/innobase/log/log0online.c 2013-09-25 08:01:43 +0000
82@@ -34,6 +34,14 @@
83 #include "trx0sys.h"
84 #include "ut0rbt.h"
85
86+#ifdef __WIN__
87+/* error LNK2001: unresolved external symbol _debug_sync_C_callback_ptr */
88+# define DEBUG_SYNC_C(dummy) ((void) 0)
89+#else
90+# include "m_string.h" /* for my_sys.h */
91+# include "my_sys.h" /* DEBUG_SYNC_C */
92+#endif
93+
94 enum { FOLLOW_SCAN_SIZE = 4 * (UNIV_PAGE_SIZE_MAX) };
95
96 #ifdef UNIV_PFS_MUTEX
97@@ -1255,6 +1263,24 @@
98 }
99
100 /*********************************************************************//**
101+Diagnose a bitmap file range setup failure and free the partially-initialized
102+bitmap file range. */
103+static
104+void
105+log_online_diagnose_inconsistent_dir(
106+/*=================================*/
107+ log_online_bitmap_file_range_t *bitmap_files) /*!<in/out: bitmap file
108+ range */
109+{
110+ fprintf(stderr,
111+ "InnoDB: Warning: inconsistent bitmap file "
112+ "directory for a "
113+ "INFORMATION_SCHEMA.INNODB_CHANGED_PAGES query"
114+ "\n");
115+ free(bitmap_files->files);
116+}
117+
118+/*********************************************************************//**
119 List the bitmap files in srv_data_home and setup their range that contains the
120 specified LSN interval. This range, if non-empty, will start with a file that
121 has the greatest LSN equal to or less than the start LSN and will include all
122@@ -1355,6 +1381,8 @@
123
124 bitmap_files->count = last_file_seq_num - first_file_seq_num + 1;
125
126+ DEBUG_SYNC_C("setup_bitmap_range_middle");
127+
128 /* 2nd pass: get the file names in the file_seq_num order */
129
130 bitmap_dir = os_file_opendir(srv_data_home, FALSE);
131@@ -1390,12 +1418,7 @@
132 array_pos = file_seq_num - first_file_seq_num;
133 if (UNIV_UNLIKELY(array_pos >= bitmap_files->count)) {
134
135- fprintf(stderr,
136- "InnoDB: Error: inconsistent bitmap file "
137- "directory for a "
138- "INFORMATION_SCHEMA.INNODB_CHANGED_PAGES query"
139- "\n");
140- free(bitmap_files->files);
141+ log_online_diagnose_inconsistent_dir(bitmap_files);
142 return FALSE;
143 }
144
145@@ -1422,8 +1445,12 @@
146 }
147
148 #ifdef UNIV_DEBUG
149+ if (!bitmap_files->files[0].seq_num) {
150+
151+ log_online_diagnose_inconsistent_dir(bitmap_files);
152+ return FALSE;
153+ }
154 ut_ad(bitmap_files->files[0].seq_num == first_file_seq_num);
155- ut_ad(bitmap_files->files[0].start_lsn == first_file_start_lsn);
156 {
157 size_t i;
158 for (i = 1; i < bitmap_files->count; i++) {

Subscribers

People subscribed via source and target branches