Merge lp:~percona-dev/percona-xtrabackup/lp713799_test into lp:percona-xtrabackup/2.0
Proposed by
Valentine Gostev
Status: | Merged |
---|---|
Approved by: | Valentine Gostev |
Approved revision: | no longer in the source branch. |
Merged at revision: | 227 |
Proposed branch: | lp:~percona-dev/percona-xtrabackup/lp713799_test |
Merge into: | lp:percona-xtrabackup/2.0 |
Diff against target: |
77 lines (+43/-1) 3 files modified
test/experimental/xb_race_drop.sh (+15/-0) test/inc/common.sh (+25/-0) test/run.sh (+3/-1) |
To merge this branch: | bzr merge lp:~percona-dev/percona-xtrabackup/lp713799_test |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexey Kopytov (community) | Approve | ||
Review via email: mp+51784@code.launchpad.net |
This proposal supersedes a proposal from 2011-03-01.
Description of the change
Added test case for bug lp:713799
To post a comment you must log in.
Hi Valentine,
Thanks for the quick turnaround with the test case. Some comments below:
On 07.02.11 8:36, Valentine Gostev wrote: /bugs.launchpad .net/bugs/ 712441 /bugs.launchpad .net/bugs/ 713799 /code.launchpad .net/~percona- dev/percona- xtrabackup/ lp713799_ test/+merge/ 48750
> Valentine Gostev has proposed merging lp:~percona-dev/percona-xtrabackup/lp713799_test into lp:percona-xtrabackup.
>
> Requested reviews:
> Alexey Kopytov (akopytov)
> Related bugs:
> #712441 Test backup during intensive create/drop/alter table statements
> https:/
> #713799 xtrabackup: race condition when trying to open an already removed tablespace
> https:/
>
> For more details, see:
> https:/
>
> Added test case for bug lp:713799
> === added file 'test/inc/ race_table_ create. sh' race_table_ create. sh 1970-01-01 00:00:00 +0000 race_table_ create. sh 2011-02-07 05:36:05 +0000 /tmp/xtrabackup .mysql. sock --user=root"
> --- test/inc/
> +++ test/inc/
> @@ -0,0 +1,20 @@
> +. inc/common.sh
> +
> +COMMD="mysql --no-defaults --socket=
> +run_cmd ${COMMD} -e "create database race;"
> +
All other tests use " ${MYSQL} ${MYSQL_ARGS} -e ..." to run the mysql
client. It looks like the same should work here. Or am I missing something?
> +rows=1000
I can imaging that on a fast machine (and with a bit of luck) the
create/drop loop can finish before the parent process actually starts to
backup. Which makes the test unreliable.
> +rowc=0 xb_table_ race.sh' xb_table_ race.sh 1970-01-01 00:00:00 +0000 xb_table_ race.sh 2011-02-07 05:36:05 +0000 file_per_ table table_create. sh &
> +while [ "$rows" -gt "$rowc" ]
> +do
> + t1=tr$RANDOM
> + t2=tr$RANDOM
> + t3=tr$RANDOM
> + ${COMMD} -e "create table $t1 (a int) ENGINE=InnoDB;" race
> + ${COMMD} -e "create table $t2 (a int) ENGINE=InnoDB;" race
> + ${COMMD} -e "create table $t3 (a int) ENGINE=InnoDB;" race
> + ${COMMD} -e "drop table $t1;" race
> + ${COMMD} -e "drop table $t2;" race
> + ${COMMD} -e "drop table $t3;" race
> + let "rowc=rowc+1"
> +done
>
> === added file 'test/t/
> --- test/t/
> +++ test/t/
> @@ -0,0 +1,20 @@
> +. inc/common.sh
> +
> +init
> +run_mysqld --innodb_
> +
> +run_cmd bash inc/race_
> +
I would make race_table_create a function rather than a separate script.
> +sleep 3
> +
Same comments as before. Using sleeps to synchronize asynchronous
process is generally a bad idea.
> +# Full backup $mysql_ datadir --backup --target- dir=$topdir/ data/full
> +# Full backup folder
> +mkdir -p $topdir/data/full
> +vlog "Starting backup"
> +
> +xtrabackup --datadir=
> +
> +vlog "Full backup done"
> +
It would also make sense to actually test restoring from the backup to
verify its integrity. That would require creating some permanent
table(s) in addition to the transient ones being created in
race_table_create.
> +stop_mysqld
> +clean
>
On a general level, I think this test is good for an ad-hoc testing of
the fix for bug #713799 (when you can manually verify the results), but
it's too flaky to include it into the test suite. We either need to add
some synchronization facilities to the xtrabackup test framework, or
create a separate stress test suite for such tes...