Skip to content

Commit 80d2774

Browse files
author
Arun Kuruvila
committed
Bug#24337625: SYSSCHEMA.FN_FORMAT_PATH IS FAILING ON THE PB2
UNDO TABLESPACES RUN Description: Mtr test, syschema.fn_format, is failing on PB2 platforms for "innodb_undo-2-debug" configuration where "innodb_undo_tablespaces" is set to 2. Analysis: For "innodb_undo-2-debug" configuration, the data directory is pre installed with "innodb_undo_tablespaces=2". This will create the innodb undo tablespaces inside the default "innodb_undo_directory" path. But the mtr test, "fn_format_path" uses its own innodb undo directory. So when this test is run, it is failing to start the server throwing the error, "[ERROR] InnoDB: Unable to open undo tablespace 'xxx'.". This happens because the innodb tablespaces are created inside default "innodb_undo_directory" path and mtr is checking for the tablespace inside the "innodb_undo_directory" path specified by the test. Fix: While starting the test, a custom data directory is installed with appropriate "innodb_undo_tablespaces" and "innodb_undo_directory".
1 parent ee94c5e commit 80d2774

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

mysql-test/suite/sysschema/r/fn_format_path.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# restart: --datadir=CUSTOM_DATADIR --innodb_data_home_dir=MYSQLTEST_VARDIR/tmp/innodb --innodb_log_group_home_dir=MYSQLTEST_VARDIR/tmp/innodb_logs --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/innodb_undo --innodb_undo_tablespaces=innodb_undo_tablespaces
12
SELECT sys.format_path(NULL);
23
sys.format_path(NULL)
34
NULL
@@ -28,3 +29,4 @@ sys.format_path(@mypath)
2829
SELECT sys.format_path('/foo/bar/baz.foo');
2930
sys.format_path('/foo/bar/baz.foo')
3031
/foo/bar/baz.foo
32+
# restart

mysql-test/suite/sysschema/t/fn_format_path-master.opt

Lines changed: 0 additions & 1 deletion
This file was deleted.

mysql-test/suite/sysschema/t/fn_format_path.test

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,36 @@
55
# Verify the sys.format_path() function perfoms as expected
66
#
77

8+
# Save current server option values;
9+
let $page_size = `select @@innodb_page_size`;
10+
let $innodb_undo_tablespaces = `select @@innodb_undo_tablespaces`;
11+
let $MYSQLD_BASEDIR= `select @@basedir`;
12+
13+
# Create custom datadir
14+
--mkdir $MYSQL_TMP_DIR/custom_datadir
15+
let $CUSTOM_DATADIR = $MYSQL_TMP_DIR/custom_datadir/data;
16+
17+
# Stop the server because the MTR uses default value for innodb_undo_directory.
18+
--source include/shutdown_mysqld.inc
19+
20+
let BOOTSTRAP_SQL=$MYSQL_TMP_DIR/boot.sql;
21+
22+
# Create bootstrap file
23+
write_file $BOOTSTRAP_SQL;
24+
CREATE DATABASE test;
25+
EOF
26+
27+
# Set the bootstrap parameter with new innodb_undo_directory
28+
let NEW_CMD = $MYSQLD --no-defaults --initialize-insecure $KEYRING_PLUGIN_OPT --lc_messages_dir=$MYSQL_SHAREDIR --innodb-page-size=$page_size --innodb-undo-tablespaces=$innodb_undo_tablespaces --basedir=$MYSQLD_BASEDIR --datadir=$CUSTOM_DATADIR --innodb_log_file_size=5M --innodb_log_files_in_group=2 --innodb_undo_directory=$MYSQLTEST_VARDIR/tmp/innodb_undo --init-file=$BOOTSTRAP_SQL --secure-file-priv="" </dev/null>>$MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1;
29+
30+
# Run the bootstrap command
31+
--exec $NEW_CMD
32+
33+
# Start the DB server with new datadir, innodb_data_home_dir, innodb_log_group_home_dir and innodb_undo_directory
34+
--replace_result $CUSTOM_DATADIR CUSTOM_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $innodb_undo_tablespaces innodb_undo_tablespaces
35+
--let $restart_parameters="restart: --datadir=$CUSTOM_DATADIR --innodb_data_home_dir=$MYSQLTEST_VARDIR/tmp/innodb --innodb_log_group_home_dir=$MYSQLTEST_VARDIR/tmp/innodb_logs --innodb_undo_directory=$MYSQLTEST_VARDIR/tmp/innodb_undo --innodb_undo_tablespaces=$innodb_undo_tablespaces"
36+
--source include/start_mysqld.inc
37+
838
# Passing NULL should return NULL
939
SELECT sys.format_path(NULL);
1040

@@ -40,3 +70,12 @@ SELECT sys.format_path(@mypath);
4070

4171
# Unrecognized paths should return the full path
4272
SELECT sys.format_path('/foo/bar/baz.foo');
73+
74+
# Restart the server
75+
let $restart_parameters=;
76+
--source include/restart_mysqld.inc
77+
78+
# Cleanup
79+
--remove_file $BOOTSTRAP_SQL
80+
let CLEANUP_FOLDER= $MYSQL_TMP_DIR/custom_datadir;
81+
--source include/cleanup_folder.inc

0 commit comments

Comments
 (0)