~akopytov/percona-xtrabackup/support-remote-tablespaces-2.0

« back to all changes in this revision

Viewing changes to test/t/bug606981.sh

  • Committer: Alexey Kopytov
  • Date: 2013-04-22 10:58:30 UTC
  • Revision ID: akopytov@gmail.com-20130422105830-9xguy1eijf62ckfa
Implementation of
https://blueprints.launchpad.net/percona-xtrabackup/+spec/support-separate-undo-tablespace

In order to backup separate undo tablespaces they must be added in the
fil_system list of tablespaces on the backup stage. This is implemented
in srv_undo_tablespaces_init(), which needs some modifications for
XtraBackup. First, create_new_db is always FALSE in XtraBackup. We also
need another argument to check if we can read the number of currently
used undo tablespaces from the trx header. We can't do that on the
backup stage, so we just do what srv_undo_tablespaces_init() would do in
'create_new_db == TRUE' mode, i.e. just assume the number of available
undo tablespaces is the number of used tablespaces.

We also have to restore undo tablespaces on --copy-back (unlike
e.g. separate doublewrite tablespace in PS). The reasons are that:

1) the server would refuse to start if the number of available undo
tablespaces is less than the number of configured ones.

2) we can prepare the backup with --redo-only (i.e. let the server
rollback uncommitted transactions)

There were also some tweaks to the test suite required to create a test
case. Previously my.cnf was only used by xtrabackup, but not the server
itself (one had to pass arguments to start_server and then add the same
arguments to my.cnf for xtrabackup to "see" them). Now my.cnf is used by
both server and xtrabackup, and it is possible to add custom entries to
my.cnf using the MYSQLD_EXTRA_MY_CNF_OPTS variable.

This patch also fixes bug #1169971: "Lost InnoDB messages in
xtrabackup_56".

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    exit $SKIPPED_EXIT_CODE
7
7
fi
8
8
 
9
 
start_server --innodb_file_per_table
 
9
MYSQLD_EXTRA_MY_CNF_OPTS="
 
10
innodb_file_per_table=1
 
11
innodb_flush_method=O_DIRECT
 
12
"
 
13
 
 
14
start_server
10
15
 
11
16
load_sakila
12
17
 
13
18
# Take backup
14
 
echo "innodb_flush_method=O_DIRECT" >> $topdir/my.cnf
15
19
mkdir -p $topdir/backup
16
20
innobackupex --stream=tar $topdir/backup > $topdir/backup/out.tar
17
21
stop_server
30
34
backup_dir=$topdir/backup
31
35
cd $backup_dir
32
36
$TAR -ixvf out.tar
33
 
cd - >/dev/null 2>&1 
34
 
innobackupex --apply-log --defaults-file=$topdir/my.cnf $backup_dir
 
37
cd - >/dev/null 2>&1
 
38
innobackupex --apply-log $backup_dir
35
39
vlog "Restoring MySQL datadir"
36
40
mkdir -p $mysql_datadir
37
 
innobackupex --copy-back --defaults-file=$topdir/my.cnf $backup_dir
 
41
innobackupex --copy-back $backup_dir
38
42
 
39
43
start_server
40
44
# Check sakila