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
=== added file 'Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result'
--- Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/rpl/r/rpl_percona_bug1092593.result 2013-05-10 10:15:37 +0000
@@ -0,0 +1,20 @@
1include/master-slave.inc
2[connection master]
3DROP TABLE IF EXISTS x;
4CREATE TABLE x (a INT) engine=InnoDB;
5INSERT INTO x VALUES (1);
6include/rpl_restart_server.inc [server_number=2 parameters: --log-slave-updates=FALSE]
7include/start_slave.inc
8INSERT INTO x VALUES (2);
9SELECT a FROM x ORDER BY a;
10a
111
122
13include/rpl_start_server.inc [server_number=2 parameters: --log-slave-updates=FALSE]
14include/start_slave.inc
15SELECT a FROM x ORDER BY a;
16a
171
182
19DROP TABLE x;
20include/rpl_end.inc
021
=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt'
--- Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593-slave.opt 2013-05-10 10:15:37 +0000
@@ -0,0 +1,1 @@
1--innodb-recovery-update-relay-log --skip-core-file --skip-stack-trace --log-bin --log-slave-updates
02
=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test'
--- Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/rpl/t/rpl_percona_bug1092593.test 2013-05-10 10:15:37 +0000
@@ -0,0 +1,81 @@
1###########################################################################
2# Bug 1092593: crash-resistant replication doesn't work when InnoDB
3# operates with binary log disabled
4#
5# Test the slave running with --log-slave-updates first, then
6# restarting without this option, and crashing. With the bug
7# present, crash recovery will restore binlog position that was
8# written before the restart and thus is outdated
9###########################################################################
10
11--source include/have_innodb.inc
12--source include/not_valgrind.inc
13--source include/not_crashrep.inc
14--source include/master-slave.inc
15
16--disable_query_log
17call mtr.add_suppression("InnoDB: Warning: innodb_overwrite_relay_log_info is enabled.");
18--enable_query_log
19
20connection master;
21
22# InnoDB and binlog are operating using two-phase commit protocol
23# at slave, both "prepare" and "commit" points are updated with
24# binlog coordinates
25
26--disable_warnings
27DROP TABLE IF EXISTS x;
28--enable_warnings
29
30CREATE TABLE x (a INT) engine=InnoDB;
31
32INSERT INTO x VALUES (1);
33
34sync_slave_with_master;
35
36# Restart the slave.
37# Now InnoDB is operating using one-phase commit protocol at
38# slave. Before the fix, only the "commit" point was being
39# updated.
40--let $rpl_server_number= 2
41--let $rpl_server_parameters= --log-slave-updates=FALSE
42--source include/rpl_restart_server.inc
43--source include/start_slave.inc
44
45connection master;
46
47INSERT INTO x VALUES (2);
48
49sync_slave_with_master;
50
51SELECT a FROM x ORDER BY a;
52
53# Kill the slave to trigger binlog position recovery from
54# "prepare" point on the next startup
55-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
56-- shutdown_server 0
57-- source include/wait_until_disconnected.inc
58
59--let $rpl_server_number= 2
60--let $rpl_server_parameters= --log-slave-updates=FALSE
61--source include/rpl_start_server.inc
62
63# This will fail if the bug is present: the binlog coordinates
64# at "prepare" point have been last updated before the server
65# restart. After the restart the slave was running without
66# --log-slave-updates, skipping the "prepare" point update. Thus
67# on startup slave will read the obsolete position and fail.
68# After the fix the "prepare" point will be current.
69--source include/start_slave.inc
70
71connection master;
72
73sync_slave_with_master;
74
75SELECT a FROM x ORDER BY a;
76
77connection master;
78
79DROP TABLE x;
80
81--source include/rpl_end.inc
082
=== modified file 'Percona-Server/storage/innobase/trx/trx0trx.c'
--- Percona-Server/storage/innobase/trx/trx0trx.c 2013-03-26 01:40:02 +0000
+++ Percona-Server/storage/innobase/trx/trx0trx.c 2013-05-10 10:15:37 +0000
@@ -1092,6 +1092,18 @@
1092 trx->mysql_master_log_pos,1092 trx->mysql_master_log_pos,
1093 TRX_SYS_COMMIT_MASTER_LOG_INFO, &mtr);1093 TRX_SYS_COMMIT_MASTER_LOG_INFO, &mtr);
10941094
1095 trx_sys_update_mysql_binlog_offset(
1096 sys_header,
1097 trx->mysql_relay_log_file_name,
1098 trx->mysql_relay_log_pos,
1099 TRX_SYS_MYSQL_RELAY_LOG_INFO, &mtr);
1100
1101 trx_sys_update_mysql_binlog_offset(
1102 sys_header,
1103 trx->mysql_master_log_file_name,
1104 trx->mysql_master_log_pos,
1105 TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr);
1106
1095 trx->mysql_master_log_file_name = "";1107 trx->mysql_master_log_file_name = "";
1096 }1108 }
10971109

Subscribers

People subscribed via source and target branches