summaryrefslogtreecommitdiff
path: root/mysql-test/suite/mariabackup/aria_log_dir_path.test
blob: 0178cd4eae5bc68a2b04c3c259c85664420e220c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
--source include/have_maria.inc

--echo #
--echo # MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used
--echo #

--let $datadir=`SELECT @@datadir`
--let $targetdir=$MYSQLTEST_VARDIR/tmp/backup

if ($ARIA_LOGDIR_MARIADB == '')
{
  --let $ARIA_LOGDIR_MARIADB=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
}

if ($ARIA_LOGDIR_FS == '')
{
  --let $ARIA_LOGDIR_FS=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
}

--let $server_parameters=--aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=$ARIA_LOGDIR_MARIADB


--echo # Restart mariadbd with the test specific parameters
--mkdir $ARIA_LOGDIR_FS
--let $restart_parameters=$server_parameters
--source include/restart_mysqld.inc


--echo # Create and populate an Aria table (and Aria logs)
CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
DELIMITER $$;
BEGIN NOT ATOMIC
  FOR id IN 0..9 DO
    INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
  END FOR;
END;
$$
DELIMITER ;$$


--echo # Testing aria log files before --backup
SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
--file_exists $ARIA_LOGDIR_FS/aria_log_control
--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
--file_exists $ARIA_LOGDIR_FS/aria_log.00000002
--error 1
--file_exists $ARIA_LOGDIR_FS/aria_log.00000003
--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
SHOW ENGINE aria logs;


--echo # mariadb-backup --backup
--disable_result_log
--mkdir $targetdir
--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf  --backup  --target-dir=$targetdir
--enable_result_log


--echo # mariadb-backup --prepare
--disable_result_log
--exec $XTRABACKUP  --prepare --target-dir=$targetdir
--enable_result_log


--echo # shutdown server
--disable_result_log
--source include/shutdown_mysqld.inc
--echo # remove datadir
--rmdir $datadir
--echo # remove aria-log-dir-path
--rmdir $ARIA_LOGDIR_FS

--echo # mariadb-backup --copy-back
--let $mariadb_backup_parameters=--defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$datadir --target-dir=$targetdir --parallel=2 --throttle=1 --aria-log-dir-path=$ARIA_LOGDIR_MARIADB
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--exec echo "# with parameters: $mariadb_backup_parameters"
--exec $XTRABACKUP $mariadb_backup_parameters

--echo # starting server
--let $restart_parameters=$server_parameters
--source include/start_mysqld.inc
--enable_result_log
--rmdir $targetdir


--echo # Check that the table is there after --copy-back
SELECT COUNT(*) from t1;
DROP TABLE t1;


--echo # Testing aria log files after --copy-back
SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
--file_exists $ARIA_LOGDIR_FS/aria_log_control
--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
--file_exists $ARIA_LOGDIR_FS/aria_log.00000002
--error 1
--file_exists $ARIA_LOGDIR_FS/aria_log.00000003
--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
SHOW ENGINE aria logs;


--echo # Restarting mariadbd with default parameters
--let $restart_parameters=
--source include/restart_mysqld.inc
--rmdir $ARIA_LOGDIR_FS