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

Proposed by George Ormond Lorch III
Status: Rejected
Rejected by: Alexey Kopytov
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 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.
Revision history for this message
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

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
=== modified file 'innobackupex'
--- innobackupex 2013-05-03 10:40:03 +0000
+++ innobackupex 2013-05-29 22:46:37 +0000
@@ -121,6 +121,8 @@
121my $option_safe_slave_backup = '';121my $option_safe_slave_backup = '';
122my $option_safe_slave_backup_timeout = 300;122my $option_safe_slave_backup_timeout = 300;
123123
124my $option_use_valgrind = '';
125
124# name of the my.cnf configuration file126# name of the my.cnf configuration file
125#my $config_file = '';127#my $config_file = '';
126128
@@ -989,7 +991,11 @@
989 get_option(\%config, $option_defaults_group, 'innodb_data_file_path');991 get_option(\%config, $option_defaults_group, 'innodb_data_file_path');
990992
991 # run ibbackup as a child process993 # run ibbackup as a child process
992 $cmdline = "$option_ibbackup_binary $options";994 if ($option_use_valgrind) {
995 $cmdline = "valgrind $option_ibbackup_binary $options";
996 } else {
997 $cmdline = "$option_ibbackup_binary $options";
998 }
993 $now = current_time();999 $now = current_time();
994 print STDERR "\n$now $prefix Starting ibbackup with command: $cmdline\n\n";1000 print STDERR "\n$now $prefix Starting ibbackup with command: $cmdline\n\n";
995 $rcode = system("$cmdline");1001 $rcode = system("$cmdline");
@@ -1195,7 +1201,11 @@
1195 if ($option_stream) {1201 if ($option_stream) {
1196 $options = $options . " --stream=$option_stream";1202 $options = $options . " --stream=$option_stream";
1197 }1203 }
1198 $cmdline = "$option_ibbackup_binary $options";1204 if ($option_use_valgrind) {
1205 $cmdline = "valgrind $option_ibbackup_binary $options";
1206 } else {
1207 $cmdline = "$option_ibbackup_binary $options";
1208 }
11991209
1200 # run ibbackup as a child process1210 # run ibbackup as a child process
1201 $now = current_time();1211 $now = current_time();
@@ -2049,6 +2059,7 @@
2049 'parallel=i' => \$option_parallel,2059 'parallel=i' => \$option_parallel,
2050 'safe-slave-backup' => \$option_safe_slave_backup,2060 'safe-slave-backup' => \$option_safe_slave_backup,
2051 'safe-slave-backup-timeout=i' => \$option_safe_slave_backup_timeout,2061 'safe-slave-backup-timeout=i' => \$option_safe_slave_backup_timeout,
2062 'use-valgrind' => \$option_use_valgrind,
2052 );2063 );
2053 2064
2054 if (!$rcode) {2065 if (!$rcode) {
@@ -3230,6 +3241,10 @@
32303241
3231This 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.3242This 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.
32323243
3244=item --use-valgrind
3245
3246This 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.
3247
3233=item --user=NAME3248=item --user=NAME
32343249
3235This 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.3250This 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.
32363251
=== modified file 'utils/build.sh'
--- utils/build.sh 2013-05-07 07:53:25 +0000
+++ utils/build.sh 2013-05-29 22:46:37 +0000
@@ -36,8 +36,18 @@
36 ;;36 ;;
37esac37esac
3838
39if [ -n "$WITH_VALGRIND" ]; then
40 export CFLAGS="$CFLAGS -g -O0"
41 export CXXFLAGS="$CXXFLAGS -g -O0"
42 extra_config_51=
43 extra_config_55plus="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_VALGRIND=ON"
44elif [ -n "$RELWITHDEBINFO" ]; then
45 export CFLAGS="$CFLAGS -g -O0"
46 export CXXFLAGS="$CXXFLAGS -g -O0"
47 extra_config_51=
48 extra_config_55plus="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
39# Percona Server 5.5 does not build with -Werror, so ignore DEBUG for now49# Percona Server 5.5 does not build with -Werror, so ignore DEBUG for now
40if [ -n "$DEBUG" -a "$type" != "xtradb55" -a "$type" != "xtradb51" ]50elif [ -n "$DEBUG" -a "$type" != "xtradb55" -a "$type" != "xtradb51" ]
41then51then
42 # InnoDB extra debug flags52 # InnoDB extra debug flags
43 innodb_extra_debug="-DUNIV_DEBUG -DUNIV_SYNC_DEBUG -DUNIV_MEM_DEBUG \53 innodb_extra_debug="-DUNIV_DEBUG -DUNIV_SYNC_DEBUG -DUNIV_MEM_DEBUG \
@@ -208,14 +218,17 @@
208 server_tarball=mysql-$mysql_version.tar.gz218 server_tarball=mysql-$mysql_version.tar.gz
209 innodb_dir=$server_dir/storage/$innodb_name219 innodb_dir=$server_dir/storage/$innodb_name
210220
211 echo "Downloading sources"221 if [ -z "$MAKE_ONLY" ]
212 auto_download $server_tarball222 then
213223 echo "Downloading sources"
214 test -d $server_dir && rm -r $server_dir224 auto_download $server_tarball
215225
216 echo "Preparing sources"226 test -d $server_dir && rm -r $server_dir
217 unpack_and_patch $server_tarball $server_patch227
218 mv $top_dir/mysql-$mysql_version $server_dir228 echo "Preparing sources"
229 unpack_and_patch $server_tarball $server_patch
230 mv $top_dir/mysql-$mysql_version $server_dir
231 fi
219232
220 build_server $type233 build_server $type
221234
@@ -309,39 +322,47 @@
309 fi322 fi
310323
311324
312 echo "Downloading sources"325 if [ -z "$MAKE_ONLY" ]
326 then
327 echo "Downloading sources"
313 328
314 # Get Percona Server329 # Get Percona Server
315 if [ -d $branch_dir ]330 if [ -d $branch_dir ]
316 then331 then
317 rm -rf $branch_dir332 rm -rf $branch_dir
318 fi333 fi
319 if [ -d $branch_dir ]334 if [ -d $branch_dir ]
320 then335 then
321 cd $branch_dir336 cd $branch_dir
322 (bzr upgrade || true)337 (bzr upgrade || true)
323 bzr clean-tree --force --ignored338 bzr clean-tree --force --ignored
324 bzr revert339 bzr revert
325 bzr pull --overwrite340 bzr pull --overwrite
341 else
342 bzr branch -r tag:Percona-Server-$PS_51_VERSION \
343 lp:percona-server/5.1 $branch_dir
344 cd $branch_dir
345 fi
346
347 $MAKE_CMD main
348 cd $top_dir
349 rm -rf $server_dir
350 ln -s $branch_dir/Percona-Server $server_dir
351
352 # Patch Percona Server
353 cd $server_dir
354 patch -p1 < $top_dir/patches/xtradb51.patch
355
356 build_server $type
357
358 build_xtrabackup
326 else359 else
327 bzr branch -r tag:Percona-Server-$PS_51_VERSION \360 cd $server_dir
328 lp:percona-server/5.1 $branch_dir361
329 cd $branch_dir362 build_server $type
363
364 build_xtrabackup
330 fi365 fi
331
332 $MAKE_CMD main
333 cd $top_dir
334 rm -rf $server_dir
335 ln -s $branch_dir/Percona-Server $server_dir
336
337 # Patch Percona Server
338 cd $server_dir
339 patch -p1 < $top_dir/patches/xtradb51.patch
340
341 build_server $type
342
343 build_xtrabackup
344
345 ;;366 ;;
346"xtradb55" )367"xtradb55" )
347 server_dir=$top_dir/Percona-Server-5.5368 server_dir=$top_dir/Percona-Server-5.5
@@ -362,40 +383,48 @@
362 fi383 fi
363384
364385
365 echo "Downloading sources"386 if [ -z "$MAKE_ONLY" ]
387 then
388 echo "Downloading sources"
366 389
367 # Get Percona Server390 # Get Percona Server
368 if [ -d $branch_dir ]391 if [ -d $branch_dir ]
369 then392 then
370 rm -rf $branch_dir393 rm -rf $branch_dir
371 fi394 fi
372 if [ -d $branch_dir ]395 if [ -d $branch_dir ]
373 then396 then
374 cd $branch_dir397 cd $branch_dir
375 yes | bzr break-lock398 yes | bzr break-lock
376 (bzr upgrade || true)399 (bzr upgrade || true)
377 bzr clean-tree --force --ignored400 bzr clean-tree --force --ignored
378 bzr revert401 bzr revert
379 bzr pull --overwrite402 bzr pull --overwrite
403 else
404 bzr branch -r tag:Percona-Server-$PS_55_VERSION \
405 lp:percona-server $branch_dir
406 cd $branch_dir
407 fi
408
409 $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
410 cd $top_dir
411 rm -rf $server_dir
412 ln -s $branch_dir/Percona-Server $server_dir
413
414 # Patch Percona Server
415 cd $server_dir
416 patch -p1 < $top_dir/patches/xtradb55.patch
417
418 build_server $type
419
420 build_xtrabackup
380 else421 else
381 bzr branch -r tag:Percona-Server-$PS_55_VERSION \422 cd $server_dir
382 lp:percona-server $branch_dir423
383 cd $branch_dir424 build_server $type
425
426 build_xtrabackup
384 fi427 fi
385
386 $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
387 cd $top_dir
388 rm -rf $server_dir
389 ln -s $branch_dir/Percona-Server $server_dir
390
391 # Patch Percona Server
392 cd $server_dir
393 patch -p1 < $top_dir/patches/xtradb55.patch
394
395 build_server $type
396
397 build_xtrabackup
398
399 ;;428 ;;
400*)429*)
401 usage430 usage

Subscribers

People subscribed via source and target branches