MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Rafal Somla Date:September 28 2009 11:21am
Subject:bzr commit into mysql-6.0-backup branch (Rafal.Somla:2875) WL#4766
View as plain text  
#At file:///ext/mysql/bzr/backup/wl4766/ based on revid:jorgen.loland@stripped

 2875 Rafal Somla	2009-09-28
      WL#4766 - Online Backup : Test different transaction isolation levels
      
      This patch modifies the vptest of WL#4769 to additionally test the 
      following:
      
      1. Transactions which run in parallel with BACKUP and use various 
         possible transaction isolation levels.
      2. Running BACKUP in parallel with other transactions and with 
         different transaction isolation levels in the connection which runs 
         BACKUP.
      3. Run RESTORE in parallel with transactions which use different 
         transaction isolation levels.
      
      Point 1 is tested by changing flightstat_stress_* test to use randomly 
      selected transaction isolation levels. Point 2 is tested by adding a 
      --tx-isolation-level parameter to the vptest/run_vp_test.pl script and 
      invoking it with different levels in the weekly collection. Point 3 is 
      tested by new restore_stress test which uses mysql-stress-test tool 
      with the same Flightstats database which is used for tests of WL#4769.
     @ mysql-test/collections/mysql-6.0-backup.daily
        - Add missing newline.
     @ mysql-test/collections/mysql-6.0-backup.weekly
        Add tests where BACKUP is run under different transaction isolation 
        levels.
     @ mysql-test/suite/backup_extra/init_flightstat_stress.txt
        List the test-case used for initializing flightstat stress test.
     @ mysql-test/suite/backup_extra/run_flightstat_stress_with_restore.txt
        List of tests for the flightstat stress test with restore operation.
        The frequency of DML operations is higher than that of RESTORE 
        operation.
     @ mysql-test/suite/backup_extra/t/flightstat_stress_cleanup.test
        Commands to clean-up after flightstat stress test (needed when 
        run from MTR).
     @ mysql-test/suite/backup_extra/t/flightstat_stress_delete.test
        Add code which sets random transaction isolation level.
     @ mysql-test/suite/backup_extra/t/flightstat_stress_init.test
        Initialization for flightstat stress test.
     @ mysql-test/suite/backup_extra/t/flightstat_stress_insert.test
        Add code which sets random transaction isolation level.
     @ mysql-test/suite/backup_extra/t/flightstat_stress_restore.test
        Run RESTORE command during flightstat stress testing.
     @ mysql-test/suite/backup_extra/t/flightstat_stress_update.test
        Add code which sets random transaction isolation level. Also, 
        explicitly use SELECT statement so that the isolation level
        matters.
     @ mysql-test/suite/backup_extra/t/restore_stress-master.opt
        Add option needed to load Flightstat database data from files.
     @ mysql-test/suite/backup_extra/t/restore_stress.test
        Test which runs flightstat stress test with RESTORE operation.
     @ mysql-test/suite/backup_extra/vptest/flightstats_alter.sql
        Removed as these changes are done in the stress initialization test
        flighstats_stress_init
     @ mysql-test/suite/backup_extra/vptest/run_vp_test.pl
        - Add tx-isolation-level option.
        - Have mysql-stress-test run the initialization test.

    added:
      mysql-test/suite/backup_extra/init_flightstat_stress.txt
      mysql-test/suite/backup_extra/r/flightstat_stress_init.result
      mysql-test/suite/backup_extra/r/flightstat_stress_restore.result
      mysql-test/suite/backup_extra/r/restore_stress.result
      mysql-test/suite/backup_extra/run_flightstat_stress_with_restore.txt
      mysql-test/suite/backup_extra/t/flightstat_stress_cleanup.test
      mysql-test/suite/backup_extra/t/flightstat_stress_init.test
      mysql-test/suite/backup_extra/t/flightstat_stress_restore.test
      mysql-test/suite/backup_extra/t/restore_stress-master.opt
      mysql-test/suite/backup_extra/t/restore_stress.test
    modified:
      mysql-test/collections/mysql-6.0-backup.daily
      mysql-test/collections/mysql-6.0-backup.weekly
      mysql-test/suite/backup_extra/r/flightstat_stress_delete.result
      mysql-test/suite/backup_extra/r/flightstat_stress_insert.result
      mysql-test/suite/backup_extra/r/flightstat_stress_update.result
      mysql-test/suite/backup_extra/t/flightstat_stress_delete.test
      mysql-test/suite/backup_extra/t/flightstat_stress_insert.test
      mysql-test/suite/backup_extra/t/flightstat_stress_update.test
      mysql-test/suite/backup_extra/vptest/flightstats_alter.sql
      mysql-test/suite/backup_extra/vptest/run_vp_test.pl
=== modified file 'mysql-test/collections/mysql-6.0-backup.daily'
--- a/mysql-test/collections/mysql-6.0-backup.daily	2009-09-28 08:47:23 +0000
+++ b/mysql-test/collections/mysql-6.0-backup.daily	2009-09-28 11:20:58 +0000
@@ -3,3 +3,4 @@ perl mysql-test-run.pl --timer --comment
 perl mysql-test-run.pl --timer --comment=backup_interoperability --suite=backup_extra backup_interop
 perl mysql-test-run.pl --timer --comment=big_test --big backup_row_size
 perl ./suite/backup_extra/vptest/run_vp_test.pl --mysql-dir=../ --datadump-dir=$FLIGHTSTATS_PATH
+

=== modified file 'mysql-test/collections/mysql-6.0-backup.weekly'
--- a/mysql-test/collections/mysql-6.0-backup.weekly	2009-09-10 13:46:13 +0000
+++ b/mysql-test/collections/mysql-6.0-backup.weekly	2009-09-28 11:20:58 +0000
@@ -1,3 +1,7 @@
 #perl mysql-test-run.pl --timer --force --suite=backup_extra backup_consistency_falcon
 perl mysql-test-run.pl --timer --force --suite=backup_extra backup_consistency_innodb
 perl mysql-test-run.pl --timer --comment=big_test --big backup_row_size
+perl ./suite/backup_extra/vptest/run_vp_test.pl --tx-isolation-level=uncommited   --mysql-dir=../ --datadump-dir=$FLIGHTSTATS_PATH
+perl ./suite/backup_extra/vptest/run_vp_test.pl --tx-isolation-level=commited     --mysql-dir=../ --datadump-dir=$FLIGHTSTATS_PATH
+perl ./suite/backup_extra/vptest/run_vp_test.pl --tx-isolation-level=repeatable   --mysql-dir=../ --datadump-dir=$FLIGHTSTATS_PATH
+perl ./suite/backup_extra/vptest/run_vp_test.pl --tx-isolation-level=serializable --mysql-dir=../ --datadump-dir=$FLIGHTSTATS_PATH

=== added file 'mysql-test/suite/backup_extra/init_flightstat_stress.txt'
--- a/mysql-test/suite/backup_extra/init_flightstat_stress.txt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/init_flightstat_stress.txt	2009-09-28 11:20:58 +0000
@@ -0,0 +1 @@
+flightstat_stress_init

=== modified file 'mysql-test/suite/backup_extra/r/flightstat_stress_delete.result'
--- a/mysql-test/suite/backup_extra/r/flightstat_stress_delete.result	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/r/flightstat_stress_delete.result	2009-09-28 11:20:58 +0000
@@ -1,5 +1,6 @@
 USE FlightStats_test;
-SET @tmp_num=int_rand(18524);
+SET TRANSACTION ISOLATION LEVEL <level>;
+SET @tmp_num=test.int_rand(18524-5);
 START TRANSACTION;
 SET @tmp_num=@tmp_num+1;
 DELETE FROM ontime_1week WHERE id=@tmp_num;

=== added file 'mysql-test/suite/backup_extra/r/flightstat_stress_init.result'
--- a/mysql-test/suite/backup_extra/r/flightstat_stress_init.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/r/flightstat_stress_init.result	2009-09-28 11:20:58 +0000
@@ -0,0 +1,8 @@
+CREATE FUNCTION test.int_rand(num INT) RETURNS INT
+RETURN ROUND(num * RAND() + 0.5);
+CREATE TABLE test.txil (id int, level text);
+INSERT INTO test.txil VALUES
+(1, 'READ UNCOMMITTED'),
+(2, 'READ COMMITTED'),
+(3, 'REPEATABLE READ'),
+(4, 'SERIALIZABLE');

=== modified file 'mysql-test/suite/backup_extra/r/flightstat_stress_insert.result'
--- a/mysql-test/suite/backup_extra/r/flightstat_stress_insert.result	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/r/flightstat_stress_insert.result	2009-09-28 11:20:58 +0000
@@ -1,5 +1,6 @@
 USE FlightStats_test;
-SET @tmp_num=int_rand(6279-5)+148000;
+SET TRANSACTION ISOLATION LEVEL <level>;
+SET @tmp_num=test.int_rand(6279-5)+148000;
 START TRANSACTION;
 SET @tmp_num=@tmp_num+1;
 INSERT INTO ontime_all (

=== added file 'mysql-test/suite/backup_extra/r/flightstat_stress_restore.result'
--- a/mysql-test/suite/backup_extra/r/flightstat_stress_restore.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/r/flightstat_stress_restore.result	2009-09-28 11:20:58 +0000
@@ -0,0 +1,6 @@
+RESTORE FROM 'FlightStats.bkp' OVERWRITE;
+backup_id
+#
+SELECT release_lock('flighstat_restore_lock');
+release_lock('flighstat_restore_lock')
+NULL

=== modified file 'mysql-test/suite/backup_extra/r/flightstat_stress_update.result'
--- a/mysql-test/suite/backup_extra/r/flightstat_stress_update.result	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/r/flightstat_stress_update.result	2009-09-28 11:20:58 +0000
@@ -1,24 +1,40 @@
-use FlightStats_test;
-SET @tmp_num=int_rand(6279-5)+148000;
+USE FlightStats_test;
+SET TRANSACTION ISOLATION LEVEL <level>;
+SET @tmp_num=test.int_rand(6279-5)+148000;
 START TRANSACTION;
-SET @tmp=@tmp_num+1;
-UPDATE ontime_all  
-SET distance=distance+1 
-WHERE id=@tmp;
-SET @tmp=@tmp_num+1;
-UPDATE ontime_all  
-SET distance=distance+1 
-WHERE id=@tmp;
-SET @tmp=@tmp_num+1;
-UPDATE ontime_all  
-SET distance=distance+1 
-WHERE id=@tmp;
-SET @tmp=@tmp_num+1;
-UPDATE ontime_all  
-SET distance=distance+1 
-WHERE id=@tmp;
-SET @tmp=@tmp_num+1;
-UPDATE ontime_all  
-SET distance=distance+1 
-WHERE id=@tmp;
+SET @tmp_num=@tmp_num+1;
+SELECT distance FROM ontime_1week
+WHERE id=@tmp_num 
+INTO @dist;
+UPDATE ontime_1week
+SET distance=@dist+1 
+WHERE id=@tmp_num;
+SET @tmp_num=@tmp_num+1;
+SELECT distance FROM ontime_1week
+WHERE id=@tmp_num 
+INTO @dist;
+UPDATE ontime_1week
+SET distance=@dist+1 
+WHERE id=@tmp_num;
+SET @tmp_num=@tmp_num+1;
+SELECT distance FROM ontime_1week
+WHERE id=@tmp_num 
+INTO @dist;
+UPDATE ontime_1week
+SET distance=@dist+1 
+WHERE id=@tmp_num;
+SET @tmp_num=@tmp_num+1;
+SELECT distance FROM ontime_1week
+WHERE id=@tmp_num 
+INTO @dist;
+UPDATE ontime_1week
+SET distance=@dist+1 
+WHERE id=@tmp_num;
+SET @tmp_num=@tmp_num+1;
+SELECT distance FROM ontime_1week
+WHERE id=@tmp_num 
+INTO @dist;
+UPDATE ontime_1week
+SET distance=@dist+1 
+WHERE id=@tmp_num;
 COMMIT;

=== added file 'mysql-test/suite/backup_extra/r/restore_stress.result'
--- a/mysql-test/suite/backup_extra/r/restore_stress.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/r/restore_stress.result	2009-09-28 11:20:58 +0000
@@ -0,0 +1,28 @@
+# Flightstat data found!
+# Creating FlightStats_test database ...
+# Altering the database ...
+# Done creating database.
+# Loading data from aircraft_engine_types.dat to aircraft_engine_types table ...
+# Loading data from aircraft_engines.dat to aircraft_engines table ...
+# Loading data from aircraft_models.dat to aircraft_models table ...
+# Loading data from aircraft_types.dat to aircraft_types table ...
+# Loading data from airport_remarks.dat to airport_remarks table ...
+# Loading data from airports.dat to airports table ...
+# Loading data from carriers.dat to carriers table ...
+# Loading data from exceptions.dat to exceptions table ...
+# Loading data from states.dat to states table ...
+# Loading data from zipcodes.dat to zipcodes table ...
+# Loading data from ontime_1week.dat to ontime_1week table ...
+# Loading data from aircraft.dat to aircraft table ...
+# Done loading data.
+
+# Backing-up FlightStat database ...
+backup_id
+#
+# Done backing-up.
+
+# Running stress load ...
+# Done running stress load.
+
+# Cleanup ...
+# Test done.

=== added file 'mysql-test/suite/backup_extra/run_flightstat_stress_with_restore.txt'
--- a/mysql-test/suite/backup_extra/run_flightstat_stress_with_restore.txt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/run_flightstat_stress_with_restore.txt	2009-09-28 11:20:58 +0000
@@ -0,0 +1,7 @@
+flightstat_stress_insert
+flightstat_stress_update
+flightstat_stress_delete
+flightstat_stress_insert
+flightstat_stress_update
+flightstat_stress_delete
+flightstat_stress_restore

=== added file 'mysql-test/suite/backup_extra/t/flightstat_stress_cleanup.test'
--- a/mysql-test/suite/backup_extra/t/flightstat_stress_cleanup.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/t/flightstat_stress_cleanup.test	2009-09-28 11:20:58 +0000
@@ -0,0 +1,2 @@
+DROP FUNCTION test.int_rand;
+DROP TABLE test.txil;

=== modified file 'mysql-test/suite/backup_extra/t/flightstat_stress_delete.test'
--- a/mysql-test/suite/backup_extra/t/flightstat_stress_delete.test	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/t/flightstat_stress_delete.test	2009-09-28 11:20:58 +0000
@@ -3,6 +3,13 @@ USE FlightStats_test;
 # Number of deletes performed in this transaction
 let $total_it=5;
 
+# Setting transaction isolation level
+
+let $n= `SELECT test.int_rand(count(*)) FROM test.txil`;
+let $level=`SELECT level FROM test.txil WHERE id=$n`;
+--replace_regex /LEVEL .*/LEVEL <level>/
+eval SET TRANSACTION ISOLATION LEVEL $level;
+
 # Assume that ontime_1week has been loaded. It contains records with
 # id values in an unbroken series between 1 and 18524. The stress test
 # will not run for longer than a couple of minutes, and the
@@ -12,14 +19,14 @@ let $total_it=5;
 # delete a significant amount of non-existing records (delete of
 # non-existing record is a very cheap operation)
 
---eval SET @tmp_num=int_rand(18524-$total_it)
+--eval SET @tmp_num=test.int_rand(18524-$total_it)
 
 START TRANSACTION;
 
 LET $it=0;
 WHILE (`SELECT $it < $total_it `)
 {
-  INC $it;        
+  INC $it;
   SET @tmp_num=@tmp_num+1;
 
   DELETE FROM ontime_1week WHERE id=@tmp_num;

=== added file 'mysql-test/suite/backup_extra/t/flightstat_stress_init.test'
--- a/mysql-test/suite/backup_extra/t/flightstat_stress_init.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/t/flightstat_stress_init.test	2009-09-28 11:20:58 +0000
@@ -0,0 +1,13 @@
+CREATE FUNCTION test.int_rand(num INT) RETURNS INT
+  RETURN ROUND(num * RAND() + 0.5);
+
+#
+# Transaction isolation levels to be used by transactions
+# in the stress load. They are choosen randomly.
+#
+CREATE TABLE test.txil (id int, level text);
+INSERT INTO test.txil VALUES
+  (1, 'READ UNCOMMITTED'),
+  (2, 'READ COMMITTED'),
+  (3, 'REPEATABLE READ'),
+  (4, 'SERIALIZABLE');

=== modified file 'mysql-test/suite/backup_extra/t/flightstat_stress_insert.test'
--- a/mysql-test/suite/backup_extra/t/flightstat_stress_insert.test	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/t/flightstat_stress_insert.test	2009-09-28 11:20:58 +0000
@@ -5,10 +5,17 @@ USE FlightStats_test;
 
 LET $total_it=5;
 
+# Setting transaction isolation level
+
+let $n= `SELECT test.int_rand(count(*)) FROM test.txil`;
+let $level=`SELECT level FROM test.txil WHERE id=$n`;
+--replace_regex /LEVEL .*/LEVEL <level>/
+eval SET TRANSACTION ISOLATION LEVEL $level;
+
 # Assume that ontime_1week has been loaded. It contains records with
 # id values in an unbroken series between 148000 and 154279 (6279
 # records). 
---eval SET @tmp_num=int_rand(6279-$total_it)+148000
+--eval SET @tmp_num=test.int_rand(6279-$total_it)+148000
 
 START TRANSACTION;
 

=== added file 'mysql-test/suite/backup_extra/t/flightstat_stress_restore.test'
--- a/mysql-test/suite/backup_extra/t/flightstat_stress_restore.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/t/flightstat_stress_restore.test	2009-09-28 11:20:58 +0000
@@ -0,0 +1,16 @@
+#
+# Run RESTORE operation during stress test. An exclusive
+# flighstat_restore_lock is used to ensure that only one
+# thread at a time runs RESTORE operation. There is a few
+# seconds sleep before each RESTORE so that other operations
+# always have a chance to run in parallel.
+#
+
+if (`select get_lock('flightstat_restore_lock',0)`)
+{
+  --sleep 3
+  --replace_column 1 #
+  RESTORE FROM 'FlightStats.bkp' OVERWRITE;
+
+  SELECT release_lock('flighstat_restore_lock');
+}

=== modified file 'mysql-test/suite/backup_extra/t/flightstat_stress_update.test'
--- a/mysql-test/suite/backup_extra/t/flightstat_stress_update.test	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/t/flightstat_stress_update.test	2009-09-28 11:20:58 +0000
@@ -5,10 +5,17 @@ USE FlightStats_test;
 
 LET $total_it=5;
 
+# Setting transaction isolation level
+
+let $n= `SELECT test.int_rand(count(*)) FROM test.txil`;
+let $level=`SELECT level FROM test.txil WHERE id=$n`;
+--replace_regex /LEVEL .*/LEVEL <level>/
+eval SET TRANSACTION ISOLATION LEVEL $level;
+
 # Assume that ontime_1week has been loaded. It contains records with
 # id values in an unbroken series between 148000 and 154279 (6279
 # records). 
---eval SET @tmp_num=int_rand(6279-$total_it)+148000
+--eval SET @tmp_num=test.int_rand(6279-$total_it)+148000
 
 START TRANSACTION;
 
@@ -18,8 +25,12 @@ WHILE (`SELECT $it < $total_it `)
   INC $it;        
   SET @tmp_num=@tmp_num+1;
 
-  UPDATE ontime_all  
-    SET distance=distance+1 
+  SELECT distance FROM ontime_1week
+    WHERE id=@tmp_num 
+    INTO @dist;
+
+  UPDATE ontime_1week
+    SET distance=@dist+1 
     WHERE id=@tmp_num;
 }
 

=== added file 'mysql-test/suite/backup_extra/t/restore_stress-master.opt'
--- a/mysql-test/suite/backup_extra/t/restore_stress-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/t/restore_stress-master.opt	2009-09-28 11:20:58 +0000
@@ -0,0 +1 @@
+--secure_file_priv=

=== added file 'mysql-test/suite/backup_extra/t/restore_stress.test'
--- a/mysql-test/suite/backup_extra/t/restore_stress.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/backup_extra/t/restore_stress.test	2009-09-28 11:20:58 +0000
@@ -0,0 +1,138 @@
+#
+# This test uses stress test tool to run RESTORE in parallel with
+# transactions on the restored database. The Flightstat database is
+# used and environment variable FLIGHTSTATS_PATH should be set to point
+# at files which define that database.
+#
+
+--source include/have_innodb.inc
+
+
+let $THREAD_COUNT= 5;        # should be >1!
+let $STRESS_DURATION= 300;
+
+let $STRESS_SUITE= ./suite/backup_extra;
+let $STRESS_LIST= ./suite/backup_extra/run_flightstat_stress_with_restore.txt;
+let $STRESS_DIR= $STRESS_SUITE/stress_basedir;
+
+#
+# Checking that FLIGHTSTATS_PATH is set and contains data.
+#
+
+if (`select '$FLIGHTSTATS_PATH'=''`)
+{
+--skip Could not locate Flightstat database files - set FLIGHTSTATS_PATH variable.
+}
+
+--perl
+$path= $ENV{'FLIGHTSTATS_PATH'};
+
+if (-f "$path/flightstats_schema.sql")
+{
+  print "# Flightstat data found!\n";
+}
+else
+{
+  print "Could not find Flightstat data in $ENV{'FLIGHTSTATS_PATH'}\n";
+};
+EOF
+
+--disable_query_log
+
+#
+# Create Flightstat schema.
+#
+# Note --source did not work complaining about wrong comments in the schema.sql
+# file.
+
+--echo # Creating FlightStats_test database ...
+--exec $MYSQL <$FLIGHTSTATS_PATH/flightstats_schema.sql
+--echo # Altering the database ...
+--exec $MYSQL <$STRESS_SUITE/vptest/flightstats_alter.sql
+--echo # Done creating database.
+
+#
+# Loading table data.
+# 
+
+create table test.data_files (file text, tname text);
+insert into test.data_files values
+('aircraft_engine_types.dat', 'aircraft_engine_types'),
+('aircraft_engines.dat', 'aircraft_engines'),
+('aircraft_models.dat', 'aircraft_models'),
+('aircraft_types.dat', 'aircraft_types'),
+('airport_remarks.dat', 'airport_remarks'),
+('airports.dat', 'airports'),
+('carriers.dat', 'carriers'),
+('exceptions.dat', 'exceptions'),
+('states.dat', 'states'),
+('zipcodes.dat', 'zipcodes'),
+('ontime_1week.dat', 'ontime_1week'),
+#('ontime_1day.dat', 'ontime_1week'),
+('aircraft.dat','aircraft');
+
+let $count= `select count(*) from test.data_files`;
+
+use FlightStats_test;
+
+while (`select count(*) from test.data_files`)
+{
+ SELECT file, tname FROM test.data_files LIMIT 1
+ INTO @file, @table;
+
+ let $file= `select @file`;
+ let $table= `select @table`;
+ 
+ --echo # Loading data from $file to $table table ...
+
+ eval 
+ LOAD DATA INFILE '$FLIGHTSTATS_PATH/$file'
+ INTO TABLE $table
+ FIELDS TERMINATED BY '\t'
+ LINES TERMINATED BY '\n';
+
+ eval DELETE FROM test.data_files WHERE tname='$table';
+}
+
+DROP TABLE test.data_files;
+
+--echo # Done loading data.
+
+--echo
+--echo # Backing-up FlightStat database ...
+--replace_column 1 #
+BACKUP DATABASE FlightStats_test TO 'FlightStats.bkp';
+--echo # Done backing-up.
+
+#
+# Stress load.
+# 
+
+--echo
+--echo # Running stress load ...
+
+let $STRESS_OPTS= --verbose;
+#let $STRESS_OPTS= $STRESS_OPTS --test-count=25;
+let $STRESS_OPTS= $STRESS_OPTS --test-duration=$STRESS_DURATION;
+let $STRESS_OPTS= $STRESS_OPTS --threads=$THREAD_COUNT;
+let $STRESS_OPTS= $STRESS_OPTS --server-socket=$MASTER_MYSOCK;
+let $STRESS_OPTS= $STRESS_OPTS --stress-basedir=$STRESS_DIR;
+let $STRESS_OPTS= $STRESS_OPTS --cleanup;
+let $STRESS_OPTS= $STRESS_OPTS --server-logs-dir=$STRESS_DIR;
+let $STRESS_OPTS= $STRESS_OPTS --stress-suite-basedir=$STRESS_SUITE;
+let $STRESS_OPTS= $STRESS_OPTS --stress-tests-file=$STRESS_LIST;
+let $STRESS_OPTS= $STRESS_OPTS --stress-init-file=$STRESS_SUITE/init_flightstat_stress.txt;
+let $STRESS_OPTS= $STRESS_OPTS --mysqltest=../client/mysqltest;
+
+--exec ./mysql-stress-test.pl $STRESS_OPTS >$STRESS_DIR/stress.log
+
+--echo # Done running stress load.
+
+--echo
+--echo # Cleanup ...
+
+DROP DATABASE FlightStats_test;
+--source $STRESS_SUITE/t/flightstat_stress_cleanup.test
+
+--echo # Test done.
+--exit

=== modified file 'mysql-test/suite/backup_extra/vptest/flightstats_alter.sql'
--- a/mysql-test/suite/backup_extra/vptest/flightstats_alter.sql	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/vptest/flightstats_alter.sql	2009-09-28 11:20:58 +0000
@@ -1,12 +1,3 @@
 use FlightStats_test;
 
 CREATE TABLE `ontime_1week` LIKE `ontime_all`;
-
-DELIMITER //
-CREATE FUNCTION FlightStats_test.int_rand(num INT) RETURNS INT
-BEGIN
-   RETURN ROUND(num * RAND() + 0.5);
-END //
-DELIMITER ;
- 
-

=== modified file 'mysql-test/suite/backup_extra/vptest/run_vp_test.pl'
--- a/mysql-test/suite/backup_extra/vptest/run_vp_test.pl	2009-09-28 08:47:23 +0000
+++ b/mysql-test/suite/backup_extra/vptest/run_vp_test.pl	2009-09-28 11:20:58 +0000
@@ -35,6 +35,8 @@ my $slave_port = 0;         # Port the s
 my $backup_binlog_file = "";
 my $backup_binlog_pos = 0;
 
+my $tx_isolation_level;     # Transaction isolation level for BACKUP thread
+
 # Store command line options
 my $opt_result = GetOptions(
         'mysql-dir=s' => \$mysql_dir,
@@ -42,6 +44,7 @@ my $opt_result = GetOptions(
         'schema-file=s' => \$schema_file,
         'stress-threads=s' => \$stress_threads,
         'mtr-build-thread=s' => \$mtr_build_thread_option,
+        'tx-isolation-level=s' => \$tx_isolation_level
 );
 
 # Expand all paths to absolute path
@@ -63,6 +66,7 @@ my $slave_dbdir=$test_dir."var/mysqld.2/
 my $stress_suitedir=$test_dir."suite/backup_extra/";
 my $test_files_dir=$stress_suitedir;
 my $stress_basedir=$stress_suitedir."stress_basedir";
+my $stress_init_file = $stress_suitedir."init_flightstat_stress.txt";
 my $stress_tests_file = $stress_suitedir."run_flightstat_stress.txt";
 my $tmpfile_dir=$stress_suitedir."vptest/tmp/";
 my $alter_file=$stress_suitedir."vptest/flightstats_alter.sql";
@@ -251,6 +255,7 @@ sub print_usage {
     print("  mysql-dir=PATH       (default: '../')\n");
     print("  schema-file=FILE     (default: DATADUMP_DIR/flightstats_schema.sql)\n");
     print("  stress-threads=INT   (default: 2)\n");
+    print("  tx-isolation-level=LVL (default: NONE)\n");
     print("Example:\n");
     print("  perl run_test.pl --datadump-dir=/mysql/flightstat/datadump/\n");
     print("  perl run_test.pl --datadump-dir=/mysql/flightstat/datadump/ \\ \n".
@@ -277,6 +282,7 @@ sub diff_dumps {
         exit(1);
     }
 }
+
 # Todo: Replace above function with below function when Text::Diff is
 # available in PB. This will remove platform dependence (*nix)
 # sub diff_dumps {
@@ -381,6 +387,9 @@ sub backup {
 
     unlink ($backup_file); #Remove file if already exists
     execute_sql($server_port,"PURGE BACKUP LOGS");
+    execute_sql($server_port, 
+                "SET TRANSACTION ISOLATION LEVEL $tx_isolation_level") 
+                                                     if $tx_isolation_level;
 
     my $time_before=time();
     execute_sql($server_port,
@@ -431,6 +440,7 @@ sub run_stress {
     my $stress_param ="--stress-basedir=$stress_basedir ".
         "--stress-suite-basedir=$stress_suitedir/ ".
         "--server-logs-dir=$stress_basedir ".
+        "--stress-init-file=$stress_init_file ".
         "--stress-tests-file=$stress_tests_file --server-user=root ".
         "--server-port=$server_port --server-host=$server_host ".
         "--mysqltest=$client_dir/mysqltest --test-duration=$stress_duration ".
@@ -652,6 +662,22 @@ sub check_options {
         print_usage("Could not find test data in: \'".$datadump_dir."\'\n");
         exit(1);
     }
+
+    # Set correct isolation level for BACKUP thread
+    
+    if ($tx_isolation_level =~ /uncom/i) {
+      	$tx_isolation_level= 'READ UNCOMMITTED';
+    } elsif ($tx_isolation_level =~ /comm/i) {
+      	$tx_isolation_level= 'READ COMMITTED';
+    } elsif ($tx_isolation_level =~ /repeat/i) {
+      	$tx_isolation_level= 'REPEATABLE READ';
+    } elsif ($tx_isolation_level =~ /serial/i) {
+      	$tx_isolation_level= 'SERIALIZABLE';
+    } elsif ($tx_isolation_level) {
+    	print("Unrecognized transaction isolation level '$tx_isolation_level'".
+    	      " - ignoring\n");
+      	$tx_isolation_level= undef;
+    }  
 }
 
 sub set_autoincrement {


Attachment: [text/bzr-bundle] bzr/rafal.somla@sun.com-20090928112058-3f4xecu3sinuq58s.bundle
Thread
bzr commit into mysql-6.0-backup branch (Rafal.Somla:2875) WL#4766Rafal Somla28 Sep
  • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2875) WL#4766Ingo Strüwing29 Sep
    • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2875) WL#4766Rafal Somla29 Sep