Merge lp:~akopytov/percona-xtrabackup/bug1410339-2.3 into lp:percona-xtrabackup/2.3

Proposed by Alexey Kopytov on 2015-01-17
Status: Merged
Approved by: Alexey Kopytov on 2015-01-17
Approved revision: 5064
Merged at revision: 5064
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1410339-2.3
Merge into: lp:percona-xtrabackup/2.3
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.3
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve on 2015-01-17
Review via email: mp+246811@code.launchpad.net
To post a comment you must log in.
Alexey Kopytov (akopytov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'storage/innobase/xtrabackup/innobackupex.pl'
2--- storage/innobase/xtrabackup/innobackupex.pl 2015-01-16 17:52:02 +0000
3+++ storage/innobase/xtrabackup/innobackupex.pl 2015-01-17 09:05:22 +0000
4@@ -79,6 +79,7 @@
5 my $have_flush_engine_logs = 0;
6 my $have_multi_threaded_slave = 0;
7 my $have_gtid_slave = 0;
8+my $have_lock_wait_timeout = 0;
9
10 # command line options
11 my $option_help = '';
12@@ -3444,6 +3445,13 @@
13 my $con = shift;
14 my $queries_hash_ref;
15
16+ if ($have_lock_wait_timeout) {
17+ # Set the maximum supported session value for lock_wait_timeout to
18+ # prevent unnecessary timeouts when the global value is changed from the
19+ # default
20+ mysql_query($con, "SET SESSION lock_wait_timeout=31536000");
21+ }
22+
23 if ($have_backup_locks) {
24 $now = current_time();
25 print STDERR "$now $prefix Executing LOCK TABLES FOR BACKUP...\n";
26@@ -5005,6 +5013,8 @@
27 (defined($gtid_slave_pos) and $gtid_slave_pos ne '')) {
28 $have_gtid_slave = 1;
29 }
30+
31+ $have_lock_wait_timeout = defined($con->{vars}->{lock_wait_timeout});
32 }
33
34 #
35
36=== added file 'storage/innobase/xtrabackup/test/t/bug1410339.sh'
37--- storage/innobase/xtrabackup/test/t/bug1410339.sh 1970-01-01 00:00:00 +0000
38+++ storage/innobase/xtrabackup/test/t/bug1410339.sh 2015-01-17 09:05:22 +0000
39@@ -0,0 +1,53 @@
40+###############################################################################
41+# Bug #1410339: Set session lock_wait_timeout value to its default value before
42+# executing FTWRL
43+###############################################################################
44+
45+MYSQLD_EXTRA_MY_CNF_OPTS="
46+loose-lock_wait_timeout=1
47+"
48+
49+start_server
50+
51+function blocking_statement()
52+{
53+ $MYSQL $MYSQL_ARGS test -e "INSERT INTO t VALUES (SLEEP(10000))"
54+}
55+
56+function start_innobackupex()
57+{
58+ innobackupex --no-timestamp $topdir/backup
59+}
60+
61+$MYSQL $MYSQL_ARGS test <<EOF
62+CREATE TABLE t (a INT) ENGINE=MyISAM;
63+EOF
64+
65+blocking_statement &
66+job1=$!
67+
68+while ! $MYSQL $MYSQL_ARGS -e "SHOW PROCESSLIST" | grep "INSERT"
69+do
70+ sleep 1
71+done
72+
73+conn_id=`$MYSQL $MYSQL_ARGS -e "SHOW PROCESSLIST" | grep "INSERT" | awk '{print $1;}'`
74+
75+start_innobackupex &
76+job2=$!
77+
78+while ! $MYSQL $MYSQL_ARGS -e "SHOW PROCESSLIST" | grep "LOCK"
79+do
80+ sleep 1
81+done
82+
83+# Make sure we wait longer than lock_wait_timeout
84+sleep 1
85+
86+$MYSQL $MYSQL_ARGS -e "KILL $conn_id"
87+
88+kill -SIGKILL $job1
89+
90+# Test that FTWRL / LOCK TABLES FOR BACKUP succeeds
91+
92+wait $job2

Subscribers

People subscribed via source and target branches

to all changes: