Merge lp:~sergei.glushchenko/percona-server/ST28246-bug1092593-5.5 into lp:percona-server/5.5

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 515
Proposed branch: lp:~sergei.glushchenko/percona-server/ST28246-bug1092593-5.5
Merge into: lp:percona-server/5.5
Diff against target: 138 lines (+114/-0)
4 files modified
Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result (+20/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt (+1/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test (+81/-0)
Percona-Server/storage/innobase/trx/trx0trx.c (+12/-0)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/ST28246-bug1092593-5.5
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+160070@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Same comments as for 5.1.

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

Same comments as for 5.1.

review: Needs Fixing
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Same comments as for 5.1.

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

Same comment as for 5.1.

review: Needs Fixing
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
1=== added file 'Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result'
2--- Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result 1970-01-01 00:00:00 +0000
3+++ Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result 2013-05-10 10:15:37 +0000
4@@ -0,0 +1,20 @@
5+include/master-slave.inc
6+[connection master]
7+DROP TABLE IF EXISTS x;
8+CREATE TABLE x (a INT) engine=InnoDB;
9+INSERT INTO x VALUES (1);
10+include/rpl_restart_server.inc [server_number=2 parameters: --log-slave-updates=FALSE]
11+include/start_slave.inc
12+INSERT INTO x VALUES (2);
13+SELECT a FROM x ORDER BY a;
14+a
15+1
16+2
17+include/rpl_start_server.inc [server_number=2 parameters: --log-slave-updates=FALSE]
18+include/start_slave.inc
19+SELECT a FROM x ORDER BY a;
20+a
21+1
22+2
23+DROP TABLE x;
24+include/rpl_end.inc
25
26=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt'
27--- Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt 1970-01-01 00:00:00 +0000
28+++ Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt 2013-05-10 10:15:37 +0000
29@@ -0,0 +1,1 @@
30+--innodb-recovery-update-relay-log --skip-core-file --skip-stack-trace --log-bin --log-slave-updates
31
32=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test'
33--- Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test 1970-01-01 00:00:00 +0000
34+++ Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test 2013-05-10 10:15:37 +0000
35@@ -0,0 +1,81 @@
36+###########################################################################
37+# Bug 1092593: crash-resistant replication doesn't work when InnoDB
38+# operates with binary log disabled
39+#
40+# Test the slave running with --log-slave-updates first, then
41+# restarting without this option, and crashing. With the bug
42+# present, crash recovery will restore binlog position that was
43+# written before the restart and thus is outdated
44+###########################################################################
45+
46+--source include/have_innodb.inc
47+--source include/not_valgrind.inc
48+--source include/not_crashrep.inc
49+--source include/master-slave.inc
50+
51+--disable_query_log
52+call mtr.add_suppression("InnoDB: Warning: innodb_overwrite_relay_log_info is enabled.");
53+--enable_query_log
54+
55+connection master;
56+
57+# InnoDB and binlog are operating using two-phase commit protocol
58+# at slave, both "prepare" and "commit" points are updated with
59+# binlog coordinates
60+
61+--disable_warnings
62+DROP TABLE IF EXISTS x;
63+--enable_warnings
64+
65+CREATE TABLE x (a INT) engine=InnoDB;
66+
67+INSERT INTO x VALUES (1);
68+
69+sync_slave_with_master;
70+
71+# Restart the slave.
72+# Now InnoDB is operating using one-phase commit protocol at
73+# slave. Before the fix, only the "commit" point was being
74+# updated.
75+--let $rpl_server_number= 2
76+--let $rpl_server_parameters= --log-slave-updates=FALSE
77+--source include/rpl_restart_server.inc
78+--source include/start_slave.inc
79+
80+connection master;
81+
82+INSERT INTO x VALUES (2);
83+
84+sync_slave_with_master;
85+
86+SELECT a FROM x ORDER BY a;
87+
88+# Kill the slave to trigger binlog position recovery from
89+# "prepare" point on the next startup
90+-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
91+-- shutdown_server 0
92+-- source include/wait_until_disconnected.inc
93+
94+--let $rpl_server_number= 2
95+--let $rpl_server_parameters= --log-slave-updates=FALSE
96+--source include/rpl_start_server.inc
97+
98+# This will fail if the bug is present: the binlog coordinates
99+# at "prepare" point have been last updated before the server
100+# restart. After the restart the slave was running without
101+# --log-slave-updates, skipping the "prepare" point update. Thus
102+# on startup slave will read the obsolete position and fail.
103+# After the fix the "prepare" point will be current.
104+--source include/start_slave.inc
105+
106+connection master;
107+
108+sync_slave_with_master;
109+
110+SELECT a FROM x ORDER BY a;
111+
112+connection master;
113+
114+DROP TABLE x;
115+
116+--source include/rpl_end.inc
117
118=== modified file 'Percona-Server/storage/innobase/trx/trx0trx.c'
119--- Percona-Server/storage/innobase/trx/trx0trx.c 2013-03-26 01:40:02 +0000
120+++ Percona-Server/storage/innobase/trx/trx0trx.c 2013-05-10 10:15:37 +0000
121@@ -1092,6 +1092,18 @@
122 trx->mysql_master_log_pos,
123 TRX_SYS_COMMIT_MASTER_LOG_INFO, &mtr);
124
125+ trx_sys_update_mysql_binlog_offset(
126+ sys_header,
127+ trx->mysql_relay_log_file_name,
128+ trx->mysql_relay_log_pos,
129+ TRX_SYS_MYSQL_RELAY_LOG_INFO, &mtr);
130+
131+ trx_sys_update_mysql_binlog_offset(
132+ sys_header,
133+ trx->mysql_master_log_file_name,
134+ trx->mysql_master_log_pos,
135+ TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr);
136+
137 trx->mysql_master_log_file_name = "";
138 }
139

Subscribers

People subscribed via source and target branches