Merge lp:~akopytov/percona-xtrabackup/bug1250738-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: 4901
Proposed branch: lp:~akopytov/percona-xtrabackup/bug1250738-2.2
Merge into: lp:percona-xtrabackup/2.2
Diff against target: 153 lines (+33/-40)
6 files modified
xtrabackup/test/inc/common.sh (+16/-0)
xtrabackup/test/run.sh (+10/-1)
xtrabackup/test/t/bug1192347.sh (+1/-8)
xtrabackup/test/t/bug983720_galerainfo.sh (+2/-10)
xtrabackup/test/t/xb_galera_info.sh (+2/-10)
xtrabackup/test/t/xb_galera_sst.sh (+2/-11)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/bug1250738-2.2
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+195010@code.launchpad.net

Description of the change

    Bug #1250738: Galera tests are skipped on some Jenkins slaves with
                  galera55 configuration

    The problem was that Galera tests checked for Galera support by starting
    temporary mysqld instances without specifying a configuration file. On
    some Jenkins slaves (e.g. Ubuntu ones in our cluster) there was a
    default configuration file at /etc/mysql/my.cnf which had query_cache
    enabled. Since query_cache is not supported by Galera, the server
    refused to start, so Galera support checks in tests assumed it there is
    no support and skipped the tests.

    Fixed by changing the way Galera support is being detected by the test
    suite. Instead of each tests having to roll its own check with a
    temporary mysqld instance, run.sh performs this check on startup by
    checking the wsrep_ready status variable (along with other
    version-specific variables). The value of that variable is then
    exported to subshells, so it is available to tests. As an extra safety,
    run.sh will also abort with an error, if Galera testing was explicitly
    requested via -c galera55.

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.2-param/41/

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
1=== modified file 'xtrabackup/test/inc/common.sh'
2--- xtrabackup/test/inc/common.sh 2013-11-07 12:23:43 +0000
3+++ xtrabackup/test/inc/common.sh 2013-11-13 09:16:46 +0000
4@@ -713,6 +713,22 @@
5 }
6
7 ########################################################################
8+# Return 0 if the server has Galera support
9+########################################################################
10+function is_galera()
11+{
12+ [ -n "$WSREP_READY" ]
13+}
14+
15+########################################################################
16+# Skip the test if not running against a Galera-enabled server
17+########################################################################
18+function require_galera()
19+{
20+ is_galera || skip_test "Requires Galera support"
21+}
22+
23+########################################################################
24 # Skip the test if qpress binary is not available
25 ########################################################################
26 function require_qpress()
27
28=== modified file 'xtrabackup/test/run.sh'
29--- xtrabackup/test/run.sh 2013-09-23 05:21:56 +0000
30+++ xtrabackup/test/run.sh 2013-11-13 09:16:46 +0000
31@@ -379,6 +379,15 @@
32 INNODB_VERSION=${INNODB_VERSION#"innodb_version "}
33 XTRADB_VERSION="`echo $INNODB_VERSION | sed 's/[0-9]\.[0-9]\.[0-9][0-9]*\(-[0-9][0-9]*\.[0-9][0-9]*\)*$/\1/'`"
34
35+ WSREP_READY=`$MYSQL ${MYSQL_ARGS} -Nsf -e "SHOW STATUS LIKE 'wsrep_ready'"`
36+ WSREP_READY=${WSREP_READY#"wsrep_ready "}
37+
38+ if [ "$XB_BUILD" = "galera55" -a -z "$WSREP_READY" ]
39+ then
40+ die "Galera configuration is enabled via -c galera55, but the server \
41+doesn't have Galera support."
42+ fi
43+
44 # Version-specific defaults
45 DEFAULT_IBDATA_SIZE="10M"
46
47@@ -455,7 +464,7 @@
48 export MYSQL_VERSION MYSQL_VERSION_COMMENT MYSQL_FLAVOR \
49 INNODB_VERSION XTRADB_VERSION INNODB_FLAVOR \
50 XB_BIN IB_BIN IB_ARGS XB_ARGS MYSQLD_EXTRA_ARGS \
51- DEFAULT_IBDATA_SIZE XB_BUILD
52+ DEFAULT_IBDATA_SIZE XB_BUILD WSREP_READY
53 }
54
55 ###########################################################################
56
57=== modified file 'xtrabackup/test/t/bug1192347.sh'
58--- xtrabackup/test/t/bug1192347.sh 2013-07-25 15:04:49 +0000
59+++ xtrabackup/test/t/bug1192347.sh 2013-11-13 09:16:46 +0000
60@@ -5,14 +5,7 @@
61
62 . inc/common.sh
63
64-set +e
65-${MYSQLD} --basedir=$MYSQL_BASEDIR --user=$USER --help --verbose --wsrep-sst-method=rsync| grep -q wsrep
66-probe_result=$?
67-if [[ "$probe_result" == "0" ]]
68-then
69- skip_test "Server supports wsrep"
70-fi
71-set -e
72+is_galera && skip_test "Requires a server without Galera support"
73
74 start_server
75
76
77=== modified file 'xtrabackup/test/t/bug983720_galerainfo.sh'
78--- xtrabackup/test/t/bug983720_galerainfo.sh 2013-08-28 11:52:26 +0000
79+++ xtrabackup/test/t/bug983720_galerainfo.sh 2013-11-13 09:16:46 +0000
80@@ -4,17 +4,9 @@
81
82 . inc/common.sh
83
84+require_galera
85+
86 ADDR=127.0.0.1
87-set +e
88-${MYSQLD} --basedir=$MYSQL_BASEDIR --user=$USER --help --verbose --wsrep-sst-method=rsync| grep -q wsrep
89-probe_result=$?
90-if [[ "$probe_result" == "0" ]]
91- then
92- vlog "Server supports wsrep"
93- else
94- skip_test "Requires WSREP enabled"
95-fi
96-set -e
97
98 debug=""
99 pdebug=""
100
101=== modified file 'xtrabackup/test/t/xb_galera_info.sh'
102--- xtrabackup/test/t/xb_galera_info.sh 2013-08-28 11:52:26 +0000
103+++ xtrabackup/test/t/xb_galera_info.sh 2013-11-13 09:16:46 +0000
104@@ -1,16 +1,8 @@
105 . inc/common.sh
106
107+require_galera
108+
109 ADDR=127.0.0.1
110-set +e
111-${MYSQLD} --basedir=$MYSQL_BASEDIR --user=$USER --help --verbose --wsrep-sst-method=rsync| grep -q wsrep
112-probe_result=$?
113-if [[ "$probe_result" == "0" ]]
114- then
115- vlog "Server supports wsrep"
116- else
117- skip_test "Requires WSREP enabled"
118-fi
119-set -e
120
121 if [[ -n ${WSREP_DEBUG:-} ]];then
122 start_server --log-bin=`hostname`-bin --binlog-format=ROW --wsrep-provider=${MYSQL_BASEDIR}/lib/libgalera_smm.so --wsrep_cluster_address=gcomm:// --wsrep-debug=1 --wsrep_provider_options="debug=1" --wsrep_node_address=$ADDR
123
124=== modified file 'xtrabackup/test/t/xb_galera_sst.sh'
125--- xtrabackup/test/t/xb_galera_sst.sh 2013-08-28 11:52:26 +0000
126+++ xtrabackup/test/t/xb_galera_sst.sh 2013-11-13 09:16:46 +0000
127@@ -4,6 +4,8 @@
128
129 . inc/common.sh
130
131+require_galera
132+
133 node1=1
134 # node2 will be getting SST
135 node2=901
136@@ -12,17 +14,6 @@
137 SUSER="root"
138 SMDSUM="9f6f3edb78f9a5957ecaf8f99953b5af"
139
140-set +e
141-${MYSQLD} --basedir=$MYSQL_BASEDIR --help --verbose --wsrep-sst-method=rsync| grep -q wsrep
142-probe_result=$?
143-if [[ "$probe_result" == "0" ]]
144- then
145- vlog "Server supports wsrep"
146- else
147- skip_test "Requires WSREP enabled"
148-fi
149-set -e
150-
151 debug=""
152 pdebug=""
153 if [[ -n ${WSREP_DEBUG:-} ]];then

Subscribers

People subscribed via source and target branches

to all changes: