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

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 4928
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1254227-2.2
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 74 lines (+48/-4)
2 files modified
storage/innobase/trx/trx0trx.cc (+6/-4)
storage/innobase/xtrabackup/test/t/bug1254227.sh (+42/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1254227-2.2
Reviewer Review Type Date Requested Status
Vlad Lesin (community) g2 Approve
Review via email: mp+200534@code.launchpad.net
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 'storage/innobase/trx/trx0trx.cc'
2--- storage/innobase/trx/trx0trx.cc 2013-11-27 08:36:11 +0000
3+++ storage/innobase/trx/trx0trx.cc 2014-01-06 14:04:46 +0000
4@@ -520,9 +520,9 @@
5
6 if (srv_force_recovery == 0) {
7
8- trx->state = TRX_STATE_PREPARED;
9- trx_sys->n_prepared_trx++;
10- trx_sys->n_prepared_recovered_trx++;
11+ /* XtraBackup should rollback prepared XA
12+ transactions */
13+ trx->state = TRX_STATE_ACTIVE;
14 } else {
15 fprintf(stderr,
16 "InnoDB: Since innodb_force_recovery"
17@@ -588,7 +588,9 @@
18 ut_ad(trx_state_eq(trx, TRX_STATE_PREPARED));
19 }
20
21- trx->state = TRX_STATE_PREPARED;
22+ /* XtraBackup should rollback prepared XA
23+ transactions */
24+ trx->state = TRX_STATE_ACTIVE;
25 } else {
26 fprintf(stderr,
27 "InnoDB: Since innodb_force_recovery"
28
29=== added file 'storage/innobase/xtrabackup/test/t/bug1254227.sh'
30--- storage/innobase/xtrabackup/test/t/bug1254227.sh 1970-01-01 00:00:00 +0000
31+++ storage/innobase/xtrabackup/test/t/bug1254227.sh 2014-01-06 14:04:46 +0000
32@@ -0,0 +1,42 @@
33+#########################################################################
34+# Bug #1254227: xtrabackup_56 does not roll back prepared XA transactions
35+#########################################################################
36+
37+start_server
38+
39+mkfifo $topdir/fifo
40+
41+$MYSQL $MYSQL_ARGS <$topdir/fifo &
42+
43+client_pid=$!
44+
45+# Open the pipe for writing. This is required to prevent cat from closing the
46+# pipe when stdout is redirected to it
47+
48+exec 3>$topdir/fifo
49+
50+cat >&3 <<EOF
51+CREATE TABLE test.t(a INT) ENGINE=InnoDB;
52+XA START 'xatrx';
53+INSERT INTO test.t VALUES(1);
54+XA END 'xatrx';
55+XA PREPARE 'xatrx';
56+EOF
57+
58+innobackupex --no-timestamp $topdir/full
59+
60+# Terminate the background client
61+echo "exit" >&3
62+exec 3>&-
63+wait $client_pid
64+
65+innobackupex --apply-log $topdir/full
66+
67+stop_server
68+
69+rm -rf $MYSQLD_DATADIR/*
70+
71+innobackupex --copy-back $topdir/full
72+
73+# The server will fail to start if it has MySQL bug #47134 fixed.
74+start_server

Subscribers

People subscribed via source and target branches

to all changes: