Merge lp:~akopytov/percona-xtrabackup/bug1254227-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 714
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1254227-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 83 lines (+67/-1)
2 files modified
patches/innodb56.patch (+25/-1)
test/t/bug1254227.sh (+42/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1254227-2.1
Reviewer Review Type Date Requested Status
Vlad Lesin (community) g2 Approve
Review via email: mp+200533@code.launchpad.net

Description of the change

    Bug #1254227: xtrabackup_56 does not roll back prepared XA transactions

    The problem was that XtraBackup did not roll back prepared XA
    transactions when applying the log. Which was a regression introduced
    with the original port of XtraBackup patches to 5.6.

    Fixed by restoring code that has been lost in the port.

http://jenkins.percona.com/view/PXB%202.1/job/percona-xtrabackup-2.1-param/509/

To post a comment you must log in.
Revision history for this message
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 'patches/innodb56.patch'
2--- patches/innodb56.patch 2013-11-12 08:56:58 +0000
3+++ patches/innodb56.patch 2014-01-06 14:04:16 +0000
4@@ -2635,7 +2635,31 @@
5 total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list)
6 --- a/storage/innobase/trx/trx0trx.cc
7 +++ b/storage/innobase/trx/trx0trx.cc
8-@@ -2084,7 +2084,8 @@
9+@@ -421,9 +421,9 @@
10+
11+ if (srv_force_recovery == 0) {
12+
13+- trx->state = TRX_STATE_PREPARED;
14+- trx_sys->n_prepared_trx++;
15+- trx_sys->n_prepared_recovered_trx++;
16++ /* XtraBackup should rollback prepared XA
17++ transactions */
18++ trx->state = TRX_STATE_ACTIVE;
19+ } else {
20+ fprintf(stderr,
21+ "InnoDB: Since innodb_force_recovery"
22+@@ -489,7 +489,9 @@
23+ ut_ad(trx_state_eq(trx, TRX_STATE_PREPARED));
24+ }
25+
26+- trx->state = TRX_STATE_PREPARED;
27++ /* XtraBackup should rollback prepared XA
28++ transactions */
29++ trx->state = TRX_STATE_ACTIVE;
30+ } else {
31+ fprintf(stderr,
32+ "InnoDB: Since innodb_force_recovery"
33+@@ -2084,7 +2086,8 @@
34 scenario where some undo generated by a transaction,
35 has XA stuff, and other undo, generated by the same
36 transaction, doesn't. */
37
38=== added file 'test/t/bug1254227.sh'
39--- test/t/bug1254227.sh 1970-01-01 00:00:00 +0000
40+++ test/t/bug1254227.sh 2014-01-06 14:04:16 +0000
41@@ -0,0 +1,42 @@
42+#########################################################################
43+# Bug #1254227: xtrabackup_56 does not roll back prepared XA transactions
44+#########################################################################
45+
46+start_server
47+
48+mkfifo $topdir/fifo
49+
50+$MYSQL $MYSQL_ARGS <$topdir/fifo &
51+
52+client_pid=$!
53+
54+# Open the pipe for writing. This is required to prevent cat from closing the
55+# pipe when stdout is redirected to it
56+
57+exec 3>$topdir/fifo
58+
59+cat >&3 <<EOF
60+CREATE TABLE test.t(a INT) ENGINE=InnoDB;
61+XA START 'xatrx';
62+INSERT INTO test.t VALUES(1);
63+XA END 'xatrx';
64+XA PREPARE 'xatrx';
65+EOF
66+
67+innobackupex --no-timestamp $topdir/full
68+
69+# Terminate the background client
70+echo "exit" >&3
71+exec 3>&-
72+wait $client_pid
73+
74+innobackupex --apply-log $topdir/full
75+
76+stop_server
77+
78+rm -rf $MYSQLD_DATADIR/*
79+
80+innobackupex --copy-back $topdir/full
81+
82+# The server will fail to start if it has MySQL bug #47134 fixed.
83+start_server

Subscribers

People subscribed via source and target branches

to all changes: