Merge lp:~akopytov/percona-xtrabackup/support-gtid-2.1 into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 560
Proposed branch: lp:~akopytov/percona-xtrabackup/support-gtid-2.1
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 76 lines (+46/-1)
2 files modified
innobackupex (+5/-1)
test/t/gtid.sh (+41/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/support-gtid-2.1
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Registry Administrators Pending
Review via email: mp+160654@code.launchpad.net

Description of the change

    Implementation of
    https://blueprints.launchpad.net/percona-xtrabackup/+spec/support-gtid

    Include the value of gtid_executed (or its Executed_Gtid_Set
    equivalent from SHOW MASTER STATUS) into xtrabackup_binlog_info. The
    value (when available) is also printed by innobackupex along with the
    binary log position, e.g.:

    "
    innobackupex: MySQL binlog position: filename 'mysql-bin.000003',
    position 1781, gtid_executed bf9000c0-acc2-11e2-a411-ae6a09f09722:1-3
    "
http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.1-param/271/

To post a comment you must log in.
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=== modified file 'innobackupex'
2--- innobackupex 2013-04-24 12:46:07 +0000
3+++ innobackupex 2013-04-24 14:16:35 +0000
4@@ -1461,6 +1461,7 @@
5 # from the SHOW MASTER STATUS output
6 my $filename = $con->{master_status}->{File};
7 my $position = $con->{master_status}->{Position};
8+ my $gtid = $con->{master_status}->{Executed_Gtid_Set} || '';
9
10 # Do not create xtrabackup_binlog_info if binary log is disabled
11 if (!defined($filename) or !defined($position)) {
12@@ -1469,7 +1470,7 @@
13
14 # write binlog info file
15 open(FILE, ">$binlog_info") || Die "Failed to open file '$binlog_info': $!";
16- print FILE "$filename\t$position\t\t\n";
17+ print FILE "$filename\t$position\t\t$gtid\n";
18 close(FILE);
19
20 if ($option_stream) {
21@@ -1479,6 +1480,9 @@
22 }
23
24 $mysql_binlog_position = "filename '$filename', position $position";
25+ if ($gtid) {
26+ $mysql_binlog_position .= ", gtid_executed $gtid";
27+ }
28 }
29
30 #
31
32=== added file 'test/t/gtid.sh'
33--- test/t/gtid.sh 1970-01-01 00:00:00 +0000
34+++ test/t/gtid.sh 2013-04-24 14:16:35 +0000
35@@ -0,0 +1,41 @@
36+########################################################################
37+# Test support for GTID
38+########################################################################
39+
40+. inc/common.sh
41+
42+if [ ${MYSQL_VERSION:0:3} != "5.6" ]
43+then
44+ echo "Requires a 5.6 server" > $SKIPPED_REASON
45+ exit $SKIPPED_EXIT_CODE
46+fi
47+
48+MYSQLD_EXTRA_MY_CNF_OPTS="
49+gtid_mode=on
50+log_slave_updates=on
51+enforce_gtid_consistency=on
52+"
53+start_server
54+
55+$MYSQL $MYSQL_ARGS test <<EOF
56+CREATE TABLE t(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c INT);
57+INSERT INTO t(c) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
58+SET AUTOCOMMIT=0;
59+INSERT INTO t(c) SELECT c FROM t;
60+INSERT INTO t(c) SELECT c FROM t;
61+INSERT INTO t(c) SELECT c FROM t;
62+INSERT INTO t(c) SELECT c FROM t;
63+INSERT INTO t(c) SELECT c FROM t;
64+INSERT INTO t(c) SELECT c FROM t;
65+INSERT INTO t(c) SELECT c FROM t;
66+COMMIT;
67+EOF
68+
69+innobackupex --no-timestamp $topdir/backup
70+
71+# Check that the value of gtid_executed is in xtrabackup_binlog_info
72+if ! egrep -q '^mysql-bin.[0-9]+[[:space:]]+[0-9]+[[:space:]]+[a-f0-9:-]+$' \
73+ $topdir/backup/xtrabackup_binlog_info
74+then
75+ die "Cannot find GTID coordinates in xtrabackup_binlog_info"
76+fi

Subscribers

People subscribed via source and target branches

to all changes: