Debian Codegraph @

mysql-test/suite/mariabackup/aria_log_dir_path.test

raw
1 --source include/have_maria.inc
2
3 --echo #
4 --echo # MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used
5 --echo #
6
7 --let $datadir=`SELECT @@datadir`
8 --let $targetdir=$MYSQLTEST_VARDIR/tmp/backup
9
10 if ($ARIA_LOGDIR_MARIADB == '')
11 {
12 --let $ARIA_LOGDIR_MARIADB=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
13 }
14
15 if ($ARIA_LOGDIR_FS == '')
16 {
17 --let $ARIA_LOGDIR_FS=$MYSQLTEST_VARDIR/tmp/backup_aria_log_dir_path
18 }
19
20 --let $server_parameters=--aria-log-file-size=8388608 --aria-log-purge-type=external --loose-aria-log-dir-path=$ARIA_LOGDIR_MARIADB
21
22
23 --echo # Restart mariadbd with the test specific parameters
24 --mkdir $ARIA_LOGDIR_FS
25 --let $restart_parameters=$server_parameters
26 --source include/restart_mysqld.inc
27
28
29 --echo # Create and populate an Aria table (and Aria logs)
30 CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
31 DELIMITER $$;
32 BEGIN NOT ATOMIC
33 FOR id IN 0..9 DO
34 INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
35 END FOR;
36 END;
37 $$
38 DELIMITER ;$$
39
40
41 --echo # Testing aria log files before --backup
42 SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
43 --file_exists $ARIA_LOGDIR_FS/aria_log_control
44 --file_exists $ARIA_LOGDIR_FS/aria_log.00000001
45 --file_exists $ARIA_LOGDIR_FS/aria_log.00000002
46 --error 1
47 --file_exists $ARIA_LOGDIR_FS/aria_log.00000003
48 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
49 SHOW ENGINE aria logs;
50
51 --echo # mariadb-backup --backup
52 --disable_result_log
53 --mkdir $targetdir
54 --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir
55 --enable_result_log
56
57
58 --echo # mariadb-backup --prepare
59 --disable_result_log
60 --exec $XTRABACKUP --prepare --target-dir=$targetdir
61 --enable_result_log
62
63 --echo # shutdown server
64 --disable_result_log
65 --source include/shutdown_mysqld.inc
66 --echo # remove datadir
67 --rmdir $datadir
68 --echo # remove aria-log-dir-path
69 --rmdir $ARIA_LOGDIR_FS
70
71
72 --echo # mariadb-backup --copy-back
73 --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
74 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
75 --exec echo "# with parameters: $mariadb_backup_parameters"
76 --exec $XTRABACKUP $mariadb_backup_parameters
77
78
79 --echo # starting server
80 --let $restart_parameters=$server_parameters
81 --source include/start_mysqld.inc
82 --enable_result_log
83 --rmdir $targetdir
84
85
86 --echo # Check that the table is there after --copy-back
87 SELECT COUNT(*) from t1;
88 DROP TABLE t1;
89
90
91 --echo # Testing aria log files after --copy-back
92 SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
93 --file_exists $ARIA_LOGDIR_FS/aria_log_control
94 #--file_exists $ARIA_LOGDIR_FS/aria_log.00000001
95 --file_exists $ARIA_LOGDIR_FS/aria_log.00000002
96 --error 1
97 --file_exists $ARIA_LOGDIR_FS/aria_log.00000003
98 --replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
99 SHOW ENGINE aria logs;
100
101
102 --echo # Restarting mariadbd with default parameters
103 --let $restart_parameters=
104 --source include/restart_mysqld.inc
105 --rmdir $ARIA_LOGDIR_FS