Merge lp:~gl-az/percona-xtrabackup/2.0-valgrind into lp:percona-xtrabackup/2.0

Proposed by George Ormond Lorch III on 2013-05-29
Status: Rejected
Rejected by: Alexey Kopytov on 2013-07-08
Proposed branch: lp:~gl-az/percona-xtrabackup/2.0-valgrind
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 265 lines (+116/-72)
2 files modified
innobackupex (+17/-2)
utils/build.sh (+99/-70)
To merge this branch: bzr merge lp:~gl-az/percona-xtrabackup/2.0-valgrind
Reviewer Review Type Date Requested Status
Registry Administrators 2013-05-29 Pending
Review via email: mp+166405@code.launchpad.net

Description of the change

Added new environment variables to control build:
  MAKE_ONLY - Set this to 1 to only re 'make' the server and xtrabackup. Nothing will be downloaded, unpacked or patched. This is not advised if any compiler or other flags are being changed from previous builds.
  RELWITHDEBINFO - Set this to 1 to eliminate optimizations by changing C/CXXFLAGS to -g -O0 and pass CMAKE_BUILD_TYPE=RelWithDebInfo to PS or MySQL 5.5+ cmake.
  WITH_VALGRIND - Set this to 1 to perform Valgrind compatible build. Eliminates optimizations just like RELWITHDEBINFO and also passes WITH_VALGRIND=ON to PS or MySQL 5.5+ cmake.
Added innobackupex option --use-valgrind which will prefix backup and apply-log calls to xtrabackup with "valgrind".
The valgrind binary must be within path and valgrind options may be set by either using the ~/.valgrindrc file or setting the environment variable VALGRIND_OPTS.

To post a comment you must log in.
Alexey Kopytov (akopytov) wrote :

As the 2.1 MP needs rebasing on trunk, let's not implement this in 2.0 (just to not put efforts at maintaining 2 different implementations).

Unmerged revisions

561. By George Ormond Lorch III on 2013-05-29

Added new environment variables to control build:
  MAKE_ONLY - Set this to 1 to only re 'make' the server and xtrabackup. Nothing will be downloaded, unpacked or patched. This is not advised if any compiler or other flags are being changed from previous builds.
  RELWITHDEBINFO - Set this to 1 to eliminate optimizations by changing C/CXXFLAGS to -g -O0 and pass CMAKE_BUILD_TYPE=RelWithDebInfo to PS or MySQL 5.5+ cmake.
  WITH_VALGRIND - Set this to 1 to perform Valgrind compatible build. Eliminates optimizations just like RELWITHDEBINFO and also passes WITH_VALGRIND=ON to PS or MySQL 5.5+ cmake.
Added innobackupex option --use-valgrind which will prefix backup and apply-log calls to xtrabackup with "valgrind".
The valgrind binary must be within path and valgrind options may be set by either using the ~/.valgrindrc file or setting the environment variable VALGRIND_OPTS.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'innobackupex'
2--- innobackupex 2013-05-03 10:40:03 +0000
3+++ innobackupex 2013-05-29 22:46:37 +0000
4@@ -121,6 +121,8 @@
5 my $option_safe_slave_backup = '';
6 my $option_safe_slave_backup_timeout = 300;
7
8+my $option_use_valgrind = '';
9+
10 # name of the my.cnf configuration file
11 #my $config_file = '';
12
13@@ -989,7 +991,11 @@
14 get_option(\%config, $option_defaults_group, 'innodb_data_file_path');
15
16 # run ibbackup as a child process
17- $cmdline = "$option_ibbackup_binary $options";
18+ if ($option_use_valgrind) {
19+ $cmdline = "valgrind $option_ibbackup_binary $options";
20+ } else {
21+ $cmdline = "$option_ibbackup_binary $options";
22+ }
23 $now = current_time();
24 print STDERR "\n$now $prefix Starting ibbackup with command: $cmdline\n\n";
25 $rcode = system("$cmdline");
26@@ -1195,7 +1201,11 @@
27 if ($option_stream) {
28 $options = $options . " --stream=$option_stream";
29 }
30- $cmdline = "$option_ibbackup_binary $options";
31+ if ($option_use_valgrind) {
32+ $cmdline = "valgrind $option_ibbackup_binary $options";
33+ } else {
34+ $cmdline = "$option_ibbackup_binary $options";
35+ }
36
37 # run ibbackup as a child process
38 $now = current_time();
39@@ -2049,6 +2059,7 @@
40 'parallel=i' => \$option_parallel,
41 'safe-slave-backup' => \$option_safe_slave_backup,
42 'safe-slave-backup-timeout=i' => \$option_safe_slave_backup_timeout,
43+ 'use-valgrind' => \$option_use_valgrind,
44 );
45
46 if (!$rcode) {
47@@ -3230,6 +3241,10 @@
48
49 This option accepts a string argument that specifies the amount of memory in bytes for xtrabackup to use for crash recovery while preparing a backup. Multiples are supported providing the unit (e.g. 1MB, 1GB). It is used only with the option --apply-log. It is passed directly to xtrabackup's --use-memory option. See the xtrabackup documentation for details.
50
51+=item --use-valgrind
52+
53+This option instructs innobackupex to invoke the xtrabackup binary through valgrind. You must have the valgrind binary within your path and should use either the file ~/.valgrindrc or the environment variable VALGRIND_OPTS to specify how you want valgrind to run and where to place its log file.
54+
55 =item --user=NAME
56
57 This option specifies the MySQL username used when connecting to the server, if that's not the current user. The option accepts a string argument. It is passed to the mysql child process without alteration. See mysql --help for details.
58
59=== modified file 'utils/build.sh'
60--- utils/build.sh 2013-05-07 07:53:25 +0000
61+++ utils/build.sh 2013-05-29 22:46:37 +0000
62@@ -36,8 +36,18 @@
63 ;;
64 esac
65
66+if [ -n "$WITH_VALGRIND" ]; then
67+ export CFLAGS="$CFLAGS -g -O0"
68+ export CXXFLAGS="$CXXFLAGS -g -O0"
69+ extra_config_51=
70+ extra_config_55plus="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_VALGRIND=ON"
71+elif [ -n "$RELWITHDEBINFO" ]; then
72+ export CFLAGS="$CFLAGS -g -O0"
73+ export CXXFLAGS="$CXXFLAGS -g -O0"
74+ extra_config_51=
75+ extra_config_55plus="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
76 # Percona Server 5.5 does not build with -Werror, so ignore DEBUG for now
77-if [ -n "$DEBUG" -a "$type" != "xtradb55" -a "$type" != "xtradb51" ]
78+elif [ -n "$DEBUG" -a "$type" != "xtradb55" -a "$type" != "xtradb51" ]
79 then
80 # InnoDB extra debug flags
81 innodb_extra_debug="-DUNIV_DEBUG -DUNIV_SYNC_DEBUG -DUNIV_MEM_DEBUG \
82@@ -208,14 +218,17 @@
83 server_tarball=mysql-$mysql_version.tar.gz
84 innodb_dir=$server_dir/storage/$innodb_name
85
86- echo "Downloading sources"
87- auto_download $server_tarball
88-
89- test -d $server_dir && rm -r $server_dir
90-
91- echo "Preparing sources"
92- unpack_and_patch $server_tarball $server_patch
93- mv $top_dir/mysql-$mysql_version $server_dir
94+ if [ -z "$MAKE_ONLY" ]
95+ then
96+ echo "Downloading sources"
97+ auto_download $server_tarball
98+
99+ test -d $server_dir && rm -r $server_dir
100+
101+ echo "Preparing sources"
102+ unpack_and_patch $server_tarball $server_patch
103+ mv $top_dir/mysql-$mysql_version $server_dir
104+ fi
105
106 build_server $type
107
108@@ -309,39 +322,47 @@
109 fi
110
111
112- echo "Downloading sources"
113+ if [ -z "$MAKE_ONLY" ]
114+ then
115+ echo "Downloading sources"
116
117- # Get Percona Server
118- if [ -d $branch_dir ]
119- then
120- rm -rf $branch_dir
121- fi
122- if [ -d $branch_dir ]
123- then
124- cd $branch_dir
125- (bzr upgrade || true)
126- bzr clean-tree --force --ignored
127- bzr revert
128- bzr pull --overwrite
129+ # Get Percona Server
130+ if [ -d $branch_dir ]
131+ then
132+ rm -rf $branch_dir
133+ fi
134+ if [ -d $branch_dir ]
135+ then
136+ cd $branch_dir
137+ (bzr upgrade || true)
138+ bzr clean-tree --force --ignored
139+ bzr revert
140+ bzr pull --overwrite
141+ else
142+ bzr branch -r tag:Percona-Server-$PS_51_VERSION \
143+ lp:percona-server/5.1 $branch_dir
144+ cd $branch_dir
145+ fi
146+
147+ $MAKE_CMD main
148+ cd $top_dir
149+ rm -rf $server_dir
150+ ln -s $branch_dir/Percona-Server $server_dir
151+
152+ # Patch Percona Server
153+ cd $server_dir
154+ patch -p1 < $top_dir/patches/xtradb51.patch
155+
156+ build_server $type
157+
158+ build_xtrabackup
159 else
160- bzr branch -r tag:Percona-Server-$PS_51_VERSION \
161- lp:percona-server/5.1 $branch_dir
162- cd $branch_dir
163+ cd $server_dir
164+
165+ build_server $type
166+
167+ build_xtrabackup
168 fi
169-
170- $MAKE_CMD main
171- cd $top_dir
172- rm -rf $server_dir
173- ln -s $branch_dir/Percona-Server $server_dir
174-
175- # Patch Percona Server
176- cd $server_dir
177- patch -p1 < $top_dir/patches/xtradb51.patch
178-
179- build_server $type
180-
181- build_xtrabackup
182-
183 ;;
184 "xtradb55" )
185 server_dir=$top_dir/Percona-Server-5.5
186@@ -362,40 +383,48 @@
187 fi
188
189
190- echo "Downloading sources"
191+ if [ -z "$MAKE_ONLY" ]
192+ then
193+ echo "Downloading sources"
194
195- # Get Percona Server
196- if [ -d $branch_dir ]
197- then
198- rm -rf $branch_dir
199- fi
200- if [ -d $branch_dir ]
201- then
202- cd $branch_dir
203- yes | bzr break-lock
204- (bzr upgrade || true)
205- bzr clean-tree --force --ignored
206- bzr revert
207- bzr pull --overwrite
208+ # Get Percona Server
209+ if [ -d $branch_dir ]
210+ then
211+ rm -rf $branch_dir
212+ fi
213+ if [ -d $branch_dir ]
214+ then
215+ cd $branch_dir
216+ yes | bzr break-lock
217+ (bzr upgrade || true)
218+ bzr clean-tree --force --ignored
219+ bzr revert
220+ bzr pull --overwrite
221+ else
222+ bzr branch -r tag:Percona-Server-$PS_55_VERSION \
223+ lp:percona-server $branch_dir
224+ cd $branch_dir
225+ fi
226+
227+ $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
228+ cd $top_dir
229+ rm -rf $server_dir
230+ ln -s $branch_dir/Percona-Server $server_dir
231+
232+ # Patch Percona Server
233+ cd $server_dir
234+ patch -p1 < $top_dir/patches/xtradb55.patch
235+
236+ build_server $type
237+
238+ build_xtrabackup
239 else
240- bzr branch -r tag:Percona-Server-$PS_55_VERSION \
241- lp:percona-server $branch_dir
242- cd $branch_dir
243+ cd $server_dir
244+
245+ build_server $type
246+
247+ build_xtrabackup
248 fi
249-
250- $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
251- cd $top_dir
252- rm -rf $server_dir
253- ln -s $branch_dir/Percona-Server $server_dir
254-
255- # Patch Percona Server
256- cd $server_dir
257- patch -p1 < $top_dir/patches/xtradb55.patch
258-
259- build_server $type
260-
261- build_xtrabackup
262-
263 ;;
264 *)
265 usage

Subscribers

People subscribed via source and target branches