Merge lp:~laurynas-biveinis/percona-server/bug1089265-5.1 into lp:percona-server/5.1

Proposed by Laurynas Biveinis on 2013-02-15
Status: Merged
Approved by: Stewart Smith on 2013-02-20
Approved revision: 533
Merged at revision: 533
Proposed branch: lp:~laurynas-biveinis/percona-server/bug1089265-5.1
Merge into: lp:percona-server/5.1
Diff against target: 186 lines (+51/-31)
2 files modified
Percona-Server/mysql-test/suite/rpl/r/rpl_percona_crash_resistant_rpl.result (+18/-9)
Percona-Server/mysql-test/suite/rpl/t/rpl_percona_crash_resistant_rpl.test (+33/-22)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug1089265-5.1
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve on 2013-02-20
Registry Administrators 2013-02-15 Pending
Review via email: mp+148610@code.launchpad.net

Description of the change

Fix bug 1089265.
http://jenkins.percona.com/job/percona-server-5.1-param/522/

Fix bug 1089265 (Unstable rpl_percona_crash_resistant_rpl test).

The problem is that the crashes injected by the test might leave
slave's master.info corrupted, leaving it unable to start. As the
purpose of the test is to test relay-log.info and not master.info
corruption recovery, restructure the test so that the slave I/O thread
is stopped by the time the slave SQL thread runs and crashes, so that
master.info file is closed at that time.

To post a comment you must log in.
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/rpl/r/rpl_percona_crash_resistant_rpl.result'
2--- Percona-Server/mysql-test/suite/rpl/r/rpl_percona_crash_resistant_rpl.result 2012-08-16 13:36:42 +0000
3+++ Percona-Server/mysql-test/suite/rpl/r/rpl_percona_crash_resistant_rpl.result 2013-02-15 05:12:24 +0000
4@@ -11,40 +11,49 @@
5 SELECT COUNT(*) FROM t1;
6 COUNT(*)
7 1
8-STOP SLAVE;
9-include/wait_for_slave_to_stop.inc
10+include/stop_slave.inc
11 INSERT INTO t1 VALUES();
12 SELECT COUNT(*) FROM t1;
13 COUNT(*)
14 2
15+START SLAVE IO_THREAD;
16+include/wait_for_slave_io_to_start.inc
17+include/sync_slave_io_with_master.inc
18+include/stop_slave_io.inc
19 SET GLOBAL debug="+d,crash_commit_before";
20-START SLAVE;
21+START SLAVE SQL_THREAD;
22 include/rpl_start_server.inc [server_number=2]
23 include/start_slave.inc
24 SELECT COUNT(*) FROM t1;
25 COUNT(*)
26 2
27-STOP SLAVE;
28-include/wait_for_slave_to_stop.inc
29+include/stop_slave.inc
30 INSERT INTO t1 VALUES();
31 SELECT COUNT(*) FROM t1;
32 COUNT(*)
33 3
34+START SLAVE IO_THREAD;
35+include/wait_for_slave_io_to_start.inc
36+include/sync_slave_io_with_master.inc
37+include/stop_slave_io.inc
38 SET GLOBAL debug="+d,crash_innodb_after_prepare";
39-START SLAVE;
40+START SLAVE SQL_THREAD;
41 include/rpl_start_server.inc [server_number=2]
42 include/start_slave.inc
43 SELECT COUNT(*) FROM t1;
44 COUNT(*)
45 3
46-STOP SLAVE;
47-include/wait_for_slave_to_stop.inc
48+include/stop_slave.inc
49 INSERT INTO t1 VALUES();
50 SELECT COUNT(*) FROM t1;
51 COUNT(*)
52 4
53+START SLAVE IO_THREAD;
54+include/wait_for_slave_io_to_start.inc
55+include/sync_slave_io_with_master.inc
56+include/stop_slave_io.inc
57 SET GLOBAL debug="+d,crash_innodb_before_commit";
58-START SLAVE;
59+START SLAVE SQL_THREAD;
60 include/rpl_start_server.inc [server_number=2]
61 include/start_slave.inc
62 SELECT COUNT(*) FROM t1;
63
64=== modified file 'Percona-Server/mysql-test/suite/rpl/t/rpl_percona_crash_resistant_rpl.test'
65--- Percona-Server/mysql-test/suite/rpl/t/rpl_percona_crash_resistant_rpl.test 2012-08-16 13:36:42 +0000
66+++ Percona-Server/mysql-test/suite/rpl/t/rpl_percona_crash_resistant_rpl.test 2013-02-15 05:12:24 +0000
67@@ -1,6 +1,5 @@
68 # Tests for Percona crash-resistant replication feature
69 --source include/have_innodb_plugin.inc
70---source include/master-slave.inc
71 --source include/not_valgrind.inc
72 --source include/not_crashrep.inc
73 --source include/have_debug.inc
74@@ -8,17 +7,16 @@
75 #
76 # Setup
77 #
78+--source include/master-slave.inc
79+
80+--disable_warnings
81+DROP TABLE IF EXISTS t1;
82+--enable_warnings
83
84 --disable_query_log
85 call mtr.add_suppression("InnoDB: Warning: innodb_overwrite_relay_log_info is enabled.");
86 --enable_query_log
87
88-connection master;
89-
90---disable_warnings
91-DROP TABLE IF EXISTS t1;
92---enable_warnings
93-
94 CREATE TABLE t1 (id INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)) ENGINE=InnoDB;
95
96 #
97@@ -38,20 +36,25 @@
98 # Test the crashing case where relay-log.info needs not to be overwritten
99 #
100
101-STOP SLAVE;
102---source include/wait_for_slave_to_stop.inc
103+--source include/stop_slave.inc
104
105 connection master;
106 INSERT INTO t1 VALUES();
107 SELECT COUNT(*) FROM t1;
108
109 connection slave;
110+# Get the master.info written to the disk before the SQL thread starts and crashes
111+START SLAVE IO_THREAD;
112+--source include/wait_for_slave_io_to_start.inc
113+connection master;
114+--source include/sync_slave_io_with_master.inc
115+--source include/stop_slave_io.inc
116+
117 SET GLOBAL debug="+d,crash_commit_before";
118---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
119+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
120 --error 0,2013
121-START SLAVE;
122+START SLAVE SQL_THREAD;
123 --source include/wait_until_disconnected.inc
124---enable_reconnect
125
126 --let $rpl_server_number= 2
127 --source include/rpl_start_server.inc
128@@ -63,20 +66,24 @@
129 #
130 # Test the rollback of slave position stored in the InnoDB trx header.
131 #
132-STOP SLAVE;
133---source include/wait_for_slave_to_stop.inc
134+--source include/stop_slave.inc
135
136 connection master;
137 INSERT INTO t1 VALUES();
138 SELECT COUNT(*) FROM t1;
139
140 connection slave;
141+# Get the master.info written to the disk before the SQL thread starts and crashes
142+START SLAVE IO_THREAD;
143+--source include/wait_for_slave_io_to_start.inc
144+connection master;
145+--source include/sync_slave_io_with_master.inc
146+--source include/stop_slave_io.inc
147 SET GLOBAL debug="+d,crash_innodb_after_prepare";
148---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
149+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
150 --error 0,2013
151-START SLAVE;
152+START SLAVE SQL_THREAD;
153 --source include/wait_until_disconnected.inc
154---enable_reconnect
155
156 --let $rpl_server_number= 2
157 --source include/rpl_start_server.inc
158@@ -88,19 +95,23 @@
159 #
160 # Test crash with XA transaction recovery (bug 1012715)
161 #
162-STOP SLAVE;
163---source include/wait_for_slave_to_stop.inc
164+--source include/stop_slave.inc
165 connection master;
166 INSERT INTO t1 VALUES();
167 SELECT COUNT(*) FROM t1;
168
169 connection slave;
170+# Get the master.info written to the disk before the SQL thread starts and crashes
171+START SLAVE IO_THREAD;
172+--source include/wait_for_slave_io_to_start.inc
173+connection master;
174+--source include/sync_slave_io_with_master.inc
175+--source include/stop_slave_io.inc
176 SET GLOBAL debug="+d,crash_innodb_before_commit";
177---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
178+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
179 --error 0,2013
180-START SLAVE;
181+START SLAVE SQL_THREAD;
182 --source include/wait_until_disconnected.inc
183---enable_reconnect
184
185 --let $rpl_server_number= 2
186 --source include/rpl_start_server.inc

Subscribers

People subscribed via source and target branches