Merge lp:~sergei.glushchenko/percona-xtrabackup/2.1-xb-bug1326224 into lp:percona-xtrabackup/2.1

Proposed by Sergei Glushchenko
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 752
Proposed branch: lp:~sergei.glushchenko/percona-xtrabackup/2.1-xb-bug1326224
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 86 lines (+21/-13)
1 file modified
test/t/kill_long_selects.sh (+21/-13)
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-xtrabackup/2.1-xb-bug1326224
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+224532@code.launchpad.net

This proposal supersedes a proposal from 2014-06-25.

Description of the change

Introduce better synchronization for kill_long_selects test based on querying SHOW PROCESSLIST to determine that queries started executed as needed.

http://jenkins.percona.com/view/PXB%202.1/job/percona-xtrabackup-2.1-param/580/

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

Do we really need a busy loop in wait_for_connection_count(), i.e. spinning the query without any delays? Also, can we also have some timeout, so we abort the test when it expires?

Both shouldn't be a problem under normal conditions, but could potentially create problems on Jenkins slaves when something goes wrong.

review: Needs Information
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Limit maximum processlist querying by 1 minute.

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
1=== modified file 'test/t/kill_long_selects.sh'
2--- test/t/kill_long_selects.sh 2013-10-21 10:32:46 +0000
3+++ test/t/kill_long_selects.sh 2014-06-27 14:00:29 +0000
4@@ -79,6 +79,16 @@
5 rm -f $MYSQLD_TMPDIR/killall.sql
6 }
7
8+function wait_for_connection_count()
9+{
10+ n=$(($1 + 1))
11+ for i in {1..200} ; do
12+ count=`${MYSQL} ${MYSQL_ARGS} -N -e "SHOW PROCESSLIST" test | wc -l`
13+ [ $count != $n ] || break
14+ sleep 0.3
15+ done
16+}
17+
18 start_server --innodb_file_per_table
19
20 run_cmd $MYSQL $MYSQL_ARGS test <<EOF
21@@ -91,11 +101,9 @@
22 # ==============================================================
23 vlog "===================== case 1 ====================="
24 bg_run bg_select_pid "mysql_select 3"
25-bg_run bg_update_pid "sleep 1" "mysql_update 3"
26-
27-sleep 8
28-
29-innobackupex $topdir/full --kill-long-queries-timeout=10 \
30+bg_run bg_update_pid "mysql_update 3"
31+
32+innobackupex $topdir/full --kill-long-queries-timeout=50 \
33 --kill-long-query-type=all
34
35 bg_wait_ok $bg_select_pid
36@@ -111,7 +119,8 @@
37 # it. then it may be still alive by the time of kill_all_queries
38 vlog "===================== case 2 ====================="
39 bg_run bg_select_pid "mysql_select 200"
40-bg_run bg_update_pid "sleep 1" "mysql_update 5"
41+bg_run bg_update_pid "mysql_update 5"
42+wait_for_connection_count 2
43
44 innobackupex $topdir/full --kill-long-queries-timeout=3 \
45 --kill-long-query-type=select
46@@ -125,6 +134,7 @@
47 vlog "===================== case 3 ====================="
48 bg_run bg_select_pid "mysql_select 200"
49 bg_run bg_update_pid "mysql_update 200"
50+wait_for_connection_count 2
51
52 innobackupex $topdir/full --kill-long-queries-timeout=3 \
53 --kill-long-query-type=all
54@@ -138,8 +148,7 @@
55 vlog "===================== case 4 ====================="
56 bg_run bg_select_pid "mysql_select 200"
57 bg_run bg_update_pid "mysql_update 200"
58-
59-sleep 1
60+wait_for_connection_count 2
61
62 run_cmd_expect_failure ${IB_BIN} ${IB_ARGS} $topdir/full \
63 --lock-wait-timeout=3 \
64@@ -157,8 +166,7 @@
65 vlog "===================== case 5 ====================="
66 bg_run bg_select_pid "mysql_select 200"
67 bg_run bg_update_pid "mysql_update 200"
68-
69-sleep 2
70+wait_for_connection_count 2
71
72 run_cmd_expect_failure ${IB_BIN} ${IB_ARGS} $topdir/full \
73 --lock-wait-timeout=3 \
74@@ -175,9 +183,9 @@
75 # ==============================================================
76 vlog "===================== case 6 ====================="
77 bg_run bg_update_pid "mysql_update 5"
78-bg_run bg_select_pid "sleep 1" "mysql_select 200"
79-
80-sleep 2
81+wait_for_connection_count 1
82+bg_run bg_select_pid "mysql_select 200"
83+wait_for_connection_count 2
84
85 innobackupex $topdir/full \
86 --lock-wait-timeout=6 \

Subscribers

People subscribed via source and target branches