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
=== modified file 'innobackupex'
--- innobackupex 2013-04-24 12:46:07 +0000
+++ innobackupex 2013-04-24 14:16:35 +0000
@@ -1461,6 +1461,7 @@
1461 # from the SHOW MASTER STATUS output1461 # from the SHOW MASTER STATUS output
1462 my $filename = $con->{master_status}->{File};1462 my $filename = $con->{master_status}->{File};
1463 my $position = $con->{master_status}->{Position};1463 my $position = $con->{master_status}->{Position};
1464 my $gtid = $con->{master_status}->{Executed_Gtid_Set} || '';
14641465
1465 # Do not create xtrabackup_binlog_info if binary log is disabled1466 # Do not create xtrabackup_binlog_info if binary log is disabled
1466 if (!defined($filename) or !defined($position)) {1467 if (!defined($filename) or !defined($position)) {
@@ -1469,7 +1470,7 @@
14691470
1470 # write binlog info file1471 # write binlog info file
1471 open(FILE, ">$binlog_info") || Die "Failed to open file '$binlog_info': $!";1472 open(FILE, ">$binlog_info") || Die "Failed to open file '$binlog_info': $!";
1472 print FILE "$filename\t$position\t\t\n";1473 print FILE "$filename\t$position\t\t$gtid\n";
1473 close(FILE);1474 close(FILE);
14741475
1475 if ($option_stream) {1476 if ($option_stream) {
@@ -1479,6 +1480,9 @@
1479 }1480 }
14801481
1481 $mysql_binlog_position = "filename '$filename', position $position";1482 $mysql_binlog_position = "filename '$filename', position $position";
1483 if ($gtid) {
1484 $mysql_binlog_position .= ", gtid_executed $gtid";
1485 }
1482}1486}
14831487
1484#1488#
14851489
=== added file 'test/t/gtid.sh'
--- test/t/gtid.sh 1970-01-01 00:00:00 +0000
+++ test/t/gtid.sh 2013-04-24 14:16:35 +0000
@@ -0,0 +1,41 @@
1########################################################################
2# Test support for GTID
3########################################################################
4
5. inc/common.sh
6
7if [ ${MYSQL_VERSION:0:3} != "5.6" ]
8then
9 echo "Requires a 5.6 server" > $SKIPPED_REASON
10 exit $SKIPPED_EXIT_CODE
11fi
12
13MYSQLD_EXTRA_MY_CNF_OPTS="
14gtid_mode=on
15log_slave_updates=on
16enforce_gtid_consistency=on
17"
18start_server
19
20$MYSQL $MYSQL_ARGS test <<EOF
21CREATE TABLE t(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c INT);
22INSERT INTO t(c) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
23SET AUTOCOMMIT=0;
24INSERT INTO t(c) SELECT c FROM t;
25INSERT INTO t(c) SELECT c FROM t;
26INSERT INTO t(c) SELECT c FROM t;
27INSERT INTO t(c) SELECT c FROM t;
28INSERT INTO t(c) SELECT c FROM t;
29INSERT INTO t(c) SELECT c FROM t;
30INSERT INTO t(c) SELECT c FROM t;
31COMMIT;
32EOF
33
34innobackupex --no-timestamp $topdir/backup
35
36# Check that the value of gtid_executed is in xtrabackup_binlog_info
37if ! egrep -q '^mysql-bin.[0-9]+[[:space:]]+[0-9]+[[:space:]]+[a-f0-9:-]+$' \
38 $topdir/backup/xtrabackup_binlog_info
39then
40 die "Cannot find GTID coordinates in xtrabackup_binlog_info"
41fi

Subscribers

People subscribed via source and target branches

to all changes: