Merge lp:~akopytov/percona-xtrabackup/bug1410339-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: 5062
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1410339-2.2
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 92 lines (+63/-0)
2 files modified
storage/innobase/xtrabackup/innobackupex.pl (+10/-0)
storage/innobase/xtrabackup/test/t/bug1410339.sh (+53/-0)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1410339-2.2
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+246810@code.launchpad.net

Description of the change

jenkins.percona.com/view/PXB 2.2/job/percona-xtrabackup-2.2-param/279/

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'storage/innobase/xtrabackup/innobackupex.pl'
--- storage/innobase/xtrabackup/innobackupex.pl 2014-12-08 06:52:10 +0000
+++ storage/innobase/xtrabackup/innobackupex.pl 2015-01-17 09:05:19 +0000
@@ -79,6 +79,7 @@
79my $have_flush_engine_logs = 0;79my $have_flush_engine_logs = 0;
80my $have_multi_threaded_slave = 0;80my $have_multi_threaded_slave = 0;
81my $have_gtid_slave = 0;81my $have_gtid_slave = 0;
82my $have_lock_wait_timeout = 0;
8283
83# command line options84# command line options
84my $option_help = '';85my $option_help = '';
@@ -3444,6 +3445,13 @@
3444 my $con = shift;3445 my $con = shift;
3445 my $queries_hash_ref;3446 my $queries_hash_ref;
34463447
3448 if ($have_lock_wait_timeout) {
3449 # Set the maximum supported session value for lock_wait_timeout to
3450 # prevent unnecessary timeouts when the global value is changed from the
3451 # default
3452 mysql_query($con, "SET SESSION lock_wait_timeout=31536000");
3453 }
3454
3447 if ($have_backup_locks) {3455 if ($have_backup_locks) {
3448 $now = current_time();3456 $now = current_time();
3449 print STDERR "$now $prefix Executing LOCK TABLES FOR BACKUP...\n";3457 print STDERR "$now $prefix Executing LOCK TABLES FOR BACKUP...\n";
@@ -5005,6 +5013,8 @@
5005 (defined($gtid_slave_pos) and $gtid_slave_pos ne '')) {5013 (defined($gtid_slave_pos) and $gtid_slave_pos ne '')) {
5006 $have_gtid_slave = 1;5014 $have_gtid_slave = 1;
5007 }5015 }
5016
5017 $have_lock_wait_timeout = defined($con->{vars}->{lock_wait_timeout});
5008}5018}
50095019
5010#5020#
50115021
=== added file 'storage/innobase/xtrabackup/test/t/bug1410339.sh'
--- storage/innobase/xtrabackup/test/t/bug1410339.sh 1970-01-01 00:00:00 +0000
+++ storage/innobase/xtrabackup/test/t/bug1410339.sh 2015-01-17 09:05:19 +0000
@@ -0,0 +1,53 @@
1###############################################################################
2# Bug #1410339: Set session lock_wait_timeout value to its default value before
3# executing FTWRL
4###############################################################################
5
6MYSQLD_EXTRA_MY_CNF_OPTS="
7loose-lock_wait_timeout=1
8"
9
10start_server
11
12function blocking_statement()
13{
14 $MYSQL $MYSQL_ARGS test -e "INSERT INTO t VALUES (SLEEP(10000))"
15}
16
17function start_innobackupex()
18{
19 innobackupex --no-timestamp $topdir/backup
20}
21
22$MYSQL $MYSQL_ARGS test <<EOF
23CREATE TABLE t (a INT) ENGINE=MyISAM;
24EOF
25
26blocking_statement &
27job1=$!
28
29while ! $MYSQL $MYSQL_ARGS -e "SHOW PROCESSLIST" | grep "INSERT"
30do
31 sleep 1
32done
33
34conn_id=`$MYSQL $MYSQL_ARGS -e "SHOW PROCESSLIST" | grep "INSERT" | awk '{print $1;}'`
35
36start_innobackupex &
37job2=$!
38
39while ! $MYSQL $MYSQL_ARGS -e "SHOW PROCESSLIST" | grep "LOCK"
40do
41 sleep 1
42done
43
44# Make sure we wait longer than lock_wait_timeout
45sleep 1
46
47$MYSQL $MYSQL_ARGS -e "KILL $conn_id"
48
49kill -SIGKILL $job1
50
51# Test that FTWRL / LOCK TABLES FOR BACKUP succeeds
52
53wait $job2

Subscribers

People subscribed via source and target branches

to all changes: