Commit 9ef2d29f authored by Eugene Kosov's avatar Eugene Kosov

MDEV-14425 deprecate and ignore innodb_log_files_in_group

Now there can be only one log file instead of several which
logically work as a single file.

Possible names of redo log files: ib_logfile0,
ib_logfile101 (for just created one)

innodb_log_fiels_in_group: value of this variable is not used
by InnoDB. Possible values are still 1..100, to not break upgrade

LOG_FILE_NAME: add constant of value "ib_logfile0"
LOG_FILE_NAME_PREFIX: add constant of value "ib_logfile"

get_log_file_path(): convenience function that returns full
path of a redo log file

SRV_N_LOG_FILES_MAX: removed

srv_n_log_files: we can't remove this for compatibility reasons,
but now server doesn't use this variable

log_sys_t::file::fd: now just one, not std::vector

log_sys_t::log_capacity: removed word 'group'

find_and_check_log_file(): part of logic from huge srv_start()
moved here

recv_sys_t::files: file descriptors of redo log files.
There can be several of those in case we're upgrading
from older MariaDB version.

recv_sys_t::remove_extra_log_files: whether to remove
ib_logfile{1,2,3...} after successfull upgrade.

recv_sys_t::read(): open if needed and read from one
of several log files

recv_sys_t::files_size(): open if needed and return files count

redo_file_sizes_are_correct(): check that redo log files
sizes are equal. Just to log an error for a user.
Corresponding check was moved from srv0start.cc

namespace deprecated: put all deprecated variables here to
prevent usage of it by us, developers
parent 8d7a8e45
......@@ -1863,24 +1863,25 @@ copy_back()
dst_dir = (srv_log_group_home_dir && *srv_log_group_home_dir)
? srv_log_group_home_dir : mysql_data_home;
/* --backup generates a single ib_logfile0, which we must copy
/* --backup generates a single LOG_FILE_NAME, which we must copy
if it exists. */
ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);
MY_STAT stat_arg;
if (!my_stat("ib_logfile0", &stat_arg, MYF(0)) || !stat_arg.st_size) {
if (!my_stat(LOG_FILE_NAME, &stat_arg, MYF(0)) || !stat_arg.st_size) {
/* After completed --prepare, redo log files are redundant.
We must delete any redo logs at the destination, so that
the database will not jump to a different log sequence number
(LSN). */
for (uint i = 0; i <= SRV_N_LOG_FILES_MAX + 1; i++) {
char filename[FN_REFLEN];
snprintf(filename, sizeof filename, "%s/ib_logfile%u",
dst_dir, i);
unlink(filename);
}
} else if (!(ret = copy_or_move_file("ib_logfile0", "ib_logfile0",
char filename[FN_REFLEN];
snprintf(filename, sizeof filename, "%s/%s0", dst_dir,
LOG_FILE_NAME_PREFIX);
unlink(filename);
snprintf(filename, sizeof filename, "%s/%s101", dst_dir,
LOG_FILE_NAME_PREFIX);
unlink(filename);
} else if (!(ret = copy_or_move_file(LOG_FILE_NAME, LOG_FILE_NAME,
dst_dir, 1))) {
goto cleanup;
}
......@@ -1972,7 +1973,7 @@ copy_back()
}
/* skip the redo log (it was already copied) */
if (!strcmp(filename, "ib_logfile0")) {
if (!strcmp(filename, LOG_FILE_NAME)) {
continue;
}
......
......@@ -483,9 +483,7 @@ get_mysql_vars(MYSQL *connection)
}
if (innodb_log_files_in_group_var) {
srv_n_log_files = strtol(
innodb_log_files_in_group_var, &endptr, 10);
ut_ad(*endptr == 0);
// deprecated
}
if (innodb_log_file_size_var) {
......@@ -1573,7 +1571,6 @@ bool write_backup_config_file()
"[mysqld]\n"
"innodb_checksum_algorithm=%s\n"
"innodb_data_file_path=%s\n"
"innodb_log_files_in_group=%lu\n"
"innodb_log_file_size=%llu\n"
"innodb_page_size=%lu\n"
"innodb_undo_directory=%s\n"
......@@ -1583,7 +1580,6 @@ bool write_backup_config_file()
"%s\n",
innodb_checksum_algorithm_names[srv_checksum_algorithm],
make_local_paths(innobase_data_file_path).c_str(),
srv_n_log_files,
srv_log_file_size,
srv_page_size,
srv_undo_dir,
......
......@@ -1166,6 +1166,10 @@ uint xb_client_options_count = array_elements(xb_client_options);
static const char *dbug_option;
#endif
namespace deprecated {
extern ulong srv_n_log_files;
}
struct my_option xb_server_options[] =
{
{"datadir", 'h', "Path to the database root.", (G_PTR*) &mysql_data_home,
......@@ -1274,7 +1278,7 @@ struct my_option xb_server_options[] =
UNIV_PAGE_SIZE_MAX, 0},
{"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
"Ignored for mysqld option compatibility",
&srv_n_log_files, &srv_n_log_files,
&deprecated::srv_n_log_files, &deprecated::srv_n_log_files,
0, GET_LONG, REQUIRED_ARG, 1, 1, 100, 0, 1, 0},
{"innodb_log_group_home_dir", OPT_INNODB_LOG_GROUP_HOME_DIR,
"Path to InnoDB log files.", &srv_log_group_home_dir,
......@@ -2894,7 +2898,7 @@ Initialize the appropriate datasink(s). Both local backups and streaming in the
Otherwise (i.e. when streaming in the 'tar' format) we need 2 separate datasinks
for the data stream (and don't allow parallel data copying) and for metainfo
files (including ib_logfile0). The second datasink writes to temporary
files (including LOG_FILE_NAME). The second datasink writes to temporary
files first, and then streams them in a serialized way when closed. */
static void
xtrabackup_init_datasinks(void)
......@@ -3760,36 +3764,6 @@ xb_filters_free()
}
}
/**Create log file metadata.
@param[in] i log file number in group
@param[in,out] file_names redo log file names */
static
void
open_or_create_log_file(
ulint i,
std::vector<std::string> &file_names)
{
char name[FN_REFLEN];
ulint dirnamelen;
os_normalize_path(srv_log_group_home_dir);
dirnamelen = strlen(srv_log_group_home_dir);
ut_a(dirnamelen < (sizeof name) - 10 - sizeof "ib_logfile");
memcpy(name, srv_log_group_home_dir, dirnamelen);
/* Add a path separator if needed. */
if (dirnamelen && name[dirnamelen - 1] != OS_PATH_SEPARATOR) {
name[dirnamelen++] = OS_PATH_SEPARATOR;
}
sprintf(name + dirnamelen, "%s%zu", "ib_logfile", i);
ut_a(fil_validate());
file_names.emplace_back(name);
}
/***********************************************************************
Set the open files limit. Based on set_max_open_files().
......@@ -4046,15 +4020,8 @@ static bool xtrabackup_backup_func()
SRV_MAX_N_PENDING_SYNC_IOS);
log_sys.create();
log_sys.log.create(srv_n_log_files);
std::vector<std::string> file_names;
for (ulint i = 0; i < srv_n_log_files; i++) {
open_or_create_log_file(i, file_names);
}
log_sys.log.open_files(std::move(file_names));
log_sys.log.create();
log_sys.log.open_file(get_log_file_path());
/* create extra LSN dir if it does not exist. */
if (xtrabackup_extra_lsndir
......@@ -4123,10 +4090,10 @@ static bool xtrabackup_backup_func()
/* open the log file */
memset(&stat_info, 0, sizeof(MY_STAT));
dst_log_file = ds_open(ds_redo, "ib_logfile0", &stat_info);
dst_log_file = ds_open(ds_redo, LOG_FILE_NAME, &stat_info);
if (dst_log_file == NULL) {
msg("Error: failed to open the target stream for "
"'ib_logfile0'.");
msg("Error: failed to open the target stream for '%s'.",
LOG_FILE_NAME);
goto fail;
}
......@@ -4147,7 +4114,7 @@ static bool xtrabackup_backup_func()
log_hdr_field +=
(log_sys.next_checkpoint_no & 1) ? LOG_CHECKPOINT_2 : LOG_CHECKPOINT_1;
/* The least significant bits of LOG_CHECKPOINT_OFFSET must be
stored correctly in the copy of the ib_logfile. The most significant
stored correctly in the copy of the LOG_FILE_NAME. The most significant
bits, which identify the start offset of the log block in the file,
we did choose freely, as LOG_FILE_HDR_SIZE. */
ut_ad(!((log_sys.log.get_lsn() ^ checkpoint_lsn_start)
......
......@@ -54,7 +54,6 @@ loose-innodb_write_io_threads= 2
loose-innodb_read_io_threads= 2
loose-innodb_log_buffer_size= 1M
loose-innodb_log_file_size= 10M
loose-innodb_log_files_in_group= 1
loose-innodb-stats-persistent= OFF
slave-net-timeout=120
......
......@@ -40,7 +40,7 @@ NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in t0.ibd
# ib_logfile0 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile0
# Restart without redo log encryption
# restart: --skip-innodb-encrypt-log --innodb-log-files-in-group=1
# restart: --skip-innodb-encrypt-log
SELECT COUNT(*) FROM t0;
COUNT(*)
1024
......
......@@ -53,13 +53,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
FOUND 2 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
# Empty multi-file redo log from after MariaDB 10.2.2
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
......
......@@ -3,5 +3,4 @@
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
--innodb-log-files-in-group=1
--file-key-management-encryption-algorithm=aes_cbc
......@@ -59,7 +59,7 @@ INSERT INTO t0
-- source include/search_pattern_in_file.inc
--echo # Restart without redo log encryption
-- let $restart_parameters=--skip-innodb-encrypt-log --innodb-log-files-in-group=1
-- let $restart_parameters=--skip-innodb-encrypt-log
-- source include/start_mysqld.inc
SELECT COUNT(*) FROM t0;
......
......@@ -9,8 +9,6 @@
--copy_file $bugdir/bak_ibdata1 $bugdir/ibdata1
--copy_file $bugdir/bak_ibdata2 $bugdir/ibdata2
--copy_file $bugdir/bak_ib_logfile0 $bugdir/ib_logfile0
--copy_file $bugdir/bak_ib_logfile1 $bugdir/ib_logfile1
--copy_file $bugdir/bak_ib_logfile2 $bugdir/ib_logfile2
--copy_file $bugdir/bak_undo001 $bugdir/undo001
--copy_file $bugdir/bak_undo002 $bugdir/undo002
--copy_file $bugdir/bak_undo003 $bugdir/undo003
......@@ -53,13 +53,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!/ in mysqld.1.err
FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
FOUND 2 /InnoDB: Upgrade after a crash is not supported\. The redo log was created with BogoDB 1\.2\.3\.4, and it appears corrupted\./ in mysqld.1.err
# Empty multi-file redo log from after MariaDB 10.2.2
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=2m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
......
This diff is collapsed.
......@@ -5,14 +5,14 @@
SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus';
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
# Kill the server
# restart: --debug=d,innodb_log_abort_1 --innodb-log-files-in-group=2 --innodb-log-file-size=4M
# restart: --debug=d,innodb_log_abort_1 --innodb-log-file-size=4194304
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Tablespace 4294967280 was not found at .*, but there were no modifications either/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_3,ib_log --innodb-log-files-in-group=2 --innodb-log-file-size=4M
# restart: --debug=d,innodb_log_abort_3,ib_log --innodb-log-file-size=4194304
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /srv_prepare_to_delete_redo_log_files: ib_log: FILE_CHECKPOINT.* written/ in mysqld.1.err
FOUND 1 /srv_prepare_to_delete_redo_log_file: ib_log: FILE_CHECKPOINT.* written/ in mysqld.1.err
# restart
# restart
DROP TABLE t1;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
# restart: --innodb-thread-concurrency=1 --innodb-log-file-size=2m
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
NOT FOUND /InnoDB: Log file .*ib_logfile1 is of different size .* bytes than other log files 0 bytes!/ in mysqld.1.err
# restart: --innodb-thread-concurrency=1 --innodb-log-file-size=2m
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
......@@ -19,7 +12,7 @@ a
INSERT INTO t1 VALUES (42);
BEGIN;
DELETE FROM t1;
# restart: --innodb-log-files-in-group=3 --innodb-log-file-size=5M
# restart: --innodb-log-file-size=5M
SELECT * FROM t1;
a
42
......@@ -52,11 +45,11 @@ FOUND 1 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_4
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 2 /redo log from 3\*[0-9]+ to 1\*[0-9]+ bytes/ in mysqld.1.err
FOUND 5 /redo log from [0-9]+ to [0-9]+ bytes/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_5
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 3 /redo log from 3\*[0-9]+ to 1\*[0-9]+ bytes/ in mysqld.1.err
FOUND 6 /redo log from [0-9]+ to [0-9]+ bytes/ in mysqld.1.err
# restart: --innodb-read-only
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
......@@ -64,14 +57,14 @@ FOUND 2 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_6
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 4 /redo log from 3\*[0-9]+ to 1\*[0-9]+ bytes/ in mysqld.1.err
FOUND 7 /redo log from [0-9]+ to [0-9]+ bytes/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_7
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
# restart: --innodb-read-only
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Cannot create log files in read-only mode/ in mysqld.1.err
FOUND 1 /InnoDB: Cannot create log file in read-only mode/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_8
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
......@@ -86,8 +79,9 @@ ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of 512 bytes/ in mysqld.1.err
# restart: --debug=d,innodb_log_abort_9
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files/ in mysqld.1.err
a
42
123
# restart: --debug=d,innodb_log_abort_10
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
......
......@@ -445,7 +445,7 @@ WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir
--let $ibd=$ibp --innodb-undo-tablespaces=0 --innodb-log-files-in-group=2
--let $ibd=$ibp --innodb-undo-tablespaces=0
--let $ibp=$ibp --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
--let $restart_parameters= $ibp
......
......@@ -16,7 +16,7 @@ call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 42\\r?$");
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfiles to start up the database\\? Log sequence number in the ib_logfiles is 1213964,");
call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfile0 to start up the database\\? Log sequence number in the ib_logfile0 is 1213964,");
call mtr.add_suppression("InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!");
--enable_query_log
......@@ -246,6 +246,8 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN=InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 2097152 bytes!
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=InnoDB: Upgrade after a crash is not supported\\. The redo log was created with BogoDB 1\\.2\\.3\\.4, and it appears corrupted\\.
--source include/search_pattern_in_file.inc
perl;
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
......
......@@ -34,7 +34,7 @@ let $check_yes_innodb=SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
WHERE engine='innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let $ibp=--innodb-log-files-in-group=3 --innodb-log-group-home-dir=$bugdir
--let $ibp=--innodb-log-group-home-dir=$bugdir
--let $ibp=$ibp --innodb-data-home-dir=$bugdir --innodb-undo-directory=$bugdir
--let $ibp=$ibp --innodb-undo-logs=20 --innodb-undo-tablespaces=3
--let $ibp=$ibp --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
......@@ -49,13 +49,11 @@ eval $check_no_innodb;
let SEARCH_PATTERN=\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002';
--source include/search_pattern_in_file.inc
--echo # Remove undo001,undo002,ibdata1,ibdata2,ib_logfile1,ib_logfile2,ib_logfile101
--echo # Remove undo001,undo002,ibdata1,ibdata2,ib_logfile101
--remove_file $bugdir/undo001
--rmdir $bugdir/undo002
--remove_file $bugdir/ibdata1
--remove_file $bugdir/ibdata2
--remove_file $bugdir/ib_logfile1
--remove_file $bugdir/ib_logfile2
--remove_file $bugdir/ib_logfile101
--list_files $bugdir
......@@ -82,8 +80,6 @@ eval $check_yes_innodb;
--copy_file $bugdir/ibdata1 $bugdir/bak_ibdata1
--copy_file $bugdir/ibdata2 $bugdir/bak_ibdata2
--copy_file $bugdir/ib_logfile0 $bugdir/bak_ib_logfile0
--copy_file $bugdir/ib_logfile1 $bugdir/bak_ib_logfile1
--copy_file $bugdir/ib_logfile2 $bugdir/bak_ib_logfile2
--copy_file $bugdir/undo001 $bugdir/bak_undo001
--copy_file $bugdir/undo002 $bugdir/bak_undo002
--copy_file $bugdir/undo003 $bugdir/bak_undo003
......@@ -189,15 +185,14 @@ let SEARCH_PATTERN=InnoDB: Expected to open innodb_undo_tablespaces=3 but was ab
# clean up & Restore
--source ../include/log_file_cleanup.inc
--echo # 9. Without ibdata*, without undo*, Without ib_logfile1 and with ib_logfile2
--echo # 9. Without ibdata*, without undo*
--remove_files_wildcard $bugdir ibdata*
--remove_files_wildcard $bugdir undo00*
--remove_file $bugdir/ib_logfile1
--list_files $bugdir
--source include/start_mysqld.inc
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
let SEARCH_PATTERN=redo log file .*ib_logfile0.* exists\. Creating system tablespace with existing redo log files is not recommended\. Please delete all redo log files before creating new system tablespace\.;
let SEARCH_PATTERN=redo log file .*ib_logfile0.* exists\. Creating system tablespace with existing redo log file is not recommended\. Please delete redo log file before creating new system tablespace\.;
--source include/search_pattern_in_file.inc
# clean up & Restore
......@@ -212,8 +207,7 @@ eval $check_no_innodb;
--source ../include/log_file_cleanup.inc
--echo # 11. With ibdata*, without ib_logfile1
--remove_file $bugdir/ib_logfile1
--echo # 11. With ibdata*
--list_files $bugdir
--source include/start_mysqld.inc
eval $check_yes_innodb;
......
......@@ -16,8 +16,8 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
FLUSH TABLES;
--enable_query_log
--let $n_logs=`SELECT if(@@innodb_log_files_in_group = 1, 2, 1)`
--let $resize= --innodb-log-files-in-group=$n_logs --innodb-log-file-size=4M
--let $change=`SELECT if(@@innodb_log_file_size = 4194304, 8388608, 4194304)`
--let $resize= --innodb-log-file-size=$change
--source include/no_checkpoint_start.inc
......@@ -39,7 +39,7 @@ SELECT * FROM t1;
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
--let SEARCH_PATTERN= srv_prepare_to_delete_redo_log_files: ib_log: FILE_CHECKPOINT.* written
--let SEARCH_PATTERN= srv_prepare_to_delete_redo_log_file: ib_log: FILE_CHECKPOINT.* written
--source include/search_pattern_in_file.inc
--let $restart_parameters=
......
......@@ -12,17 +12,16 @@ if (`SELECT @@innodb_log_file_size = 1048576`) {
}
--disable_query_log
call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata file do not match the log sequence number [0-9]+ in the ib_logfile");
call mtr.add_suppression("syntax error in innodb_log_group_home_dir");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("InnoDB: innodb_read_only prevents crash recovery");
call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfiles");
call mtr.add_suppression("InnoDB: Cannot (create|resize) log files in read-only mode");
call mtr.add_suppression("InnoDB: Are you sure you are using the right ib_logfile");
call mtr.add_suppression("InnoDB: Cannot (create|resize) log file in read-only mode");
call mtr.add_suppression("InnoDB: Can't initiate database recovery, running in read-only-mode");
call mtr.add_suppression("InnoDB: Only one log file found");
call mtr.add_suppression("InnoDB: Log file .*ib_logfile[01].* size");
call mtr.add_suppression("InnoDB: Log file .*ib_logfile0.* size");
call mtr.add_suppression("InnoDB: Unable to open .*ib_logfile0. to check native AIO read support");
FLUSH TABLES;
--enable_query_log
......@@ -40,14 +39,7 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let $restart_parameters= --innodb-thread-concurrency=1 --innodb-log-file-size=2m
--source include/start_mysqld.inc
eval $check_no_innodb;
--remove_file $MYSQLD_DATADIR/ib_logfile0
--move_file $MYSQLD_DATADIR/ib_logfile.old $MYSQLD_DATADIR/ib_logfile.0
--source include/shutdown_mysqld.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile1 is of different size .* bytes than other log files 0 bytes!;
--source include/search_pattern_in_file.inc
--source include/start_mysqld.inc
CHECK TABLE t1;
--let $restart_parameters= --innodb-thread-concurrency=100 --innodb-log-file-size=20M
......@@ -66,7 +58,7 @@ INSERT INTO t1 VALUES (42);
BEGIN;
DELETE FROM t1;
let $restart_parameters = --innodb-log-files-in-group=3 --innodb-log-file-size=5M;
let $restart_parameters = --innodb-log-file-size=5M;
--source include/restart_mysqld.inc
let $shutdown_timeout=;
......@@ -120,14 +112,14 @@ let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 1\*[0-9]+ bytes;
let SEARCH_PATTERN= redo log from [0-9]+ to [0-9]+ bytes;
--source include/search_pattern_in_file.inc
--let $restart_parameters= --debug=d,innodb_log_abort_5
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 1\*[0-9]+ bytes;
let SEARCH_PATTERN= redo log from [0-9]+ to [0-9]+ bytes;
--source include/search_pattern_in_file.inc
--let $restart_parameters= --innodb-read-only
......@@ -142,7 +134,7 @@ let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
let SEARCH_PATTERN= redo log from 3\*[0-9]+ to 1\*[0-9]+ bytes;
let SEARCH_PATTERN= redo log from [0-9]+ to [0-9]+ bytes;
--source include/search_pattern_in_file.inc
--let $restart_parameters= --debug=d,innodb_log_abort_7
......@@ -157,7 +149,7 @@ SELECT * FROM t1;
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: Cannot create log files in read-only mode;
let SEARCH_PATTERN= InnoDB: Cannot create log file in read-only mode;
--source include/search_pattern_in_file.inc
--let $restart_parameters= --debug=d,innodb_log_abort_8
......@@ -201,11 +193,8 @@ close(FILE);
EOF
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files;
--source include/search_pattern_in_file.inc
--remove_file $MYSQLD_DATADIR/ib_logfile1
--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
......
......@@ -2,7 +2,7 @@
# MDEV-13416 mariabackup fails with EFAULT "Bad Address"
#
# restart
FOUND 1 /InnoDB: New log files created, LSN=175964\d{8}/ in mysqld.1.err
FOUND 1 /InnoDB: New log file created, LSN=175964\d{8}/ in mysqld.1.err
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup
......
......@@ -35,7 +35,7 @@ EOF
--source include/start_mysqld.inc
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
--let SEARCH_PATTERN= InnoDB: New log files created, LSN=175964\d{8}
--let SEARCH_PATTERN= InnoDB: New log file created, LSN=175964\d{8}
--source include/search_pattern_in_file.inc
CREATE TABLE t(i INT) ENGINE INNODB;
......
--loose-innodb-log-file-size=1048576 --loose-innodb-log-files-in-group=2
--loose-innodb-log-file-size=2097152
......@@ -1226,7 +1226,7 @@ SESSION_VALUE NULL
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Number of log files in the log group. InnoDB writes to the files in a circular fashion.
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
NUMERIC_BLOCK_SIZE 0
......
This diff is collapsed.
......@@ -863,8 +863,7 @@ fil_space_get(
MY_ATTRIBUTE((warn_unused_result));
/** The tablespace memory cache; also the totality of logs (the log
data space) is stored here; below we talk about tablespaces, but also
the ib_logfiles form a 'space' and it is handled here */
data space) is stored here; below we talk about tablespaces */
struct fil_system_t {
/**
Constructor.
......
This diff is collapsed.
......@@ -375,18 +375,6 @@ log_get_lsn_nowait(void)
return(lsn);
}
/****************************************************************
Gets the log group capacity. It is OK to read the value without
holding log_sys.mutex because it is constant.
@return log group capacity */
UNIV_INLINE
lsn_t
log_get_capacity(void)
/*==================*/
{
return(log_sys.log_group_capacity);
}
/****************************************************************
Get log_sys::max_modified_age_async. It is OK to read the value without
holding log_sys::mutex because it is constant.
......
......@@ -296,7 +296,21 @@ struct recv_sys_t{
/** Last added LSN to pages. */
lsn_t last_stored_lsn;
/** After successful upgrade from multiple redo log files we'd like
to remove extra ones */
bool remove_extra_log_files{false};
void read(os_offset_t offset, span<byte> buf);
size_t files_size();
void close_files() { files.clear(); }
private:
/** All found log files (more that one is possible if we're upgrading
from older MariaDB version */
std::vector<log_file_t> files;
void open_log_files_if_needed();
/** Maximum number of buffer pool blocks to allocate for redo log records */
ulint max_log_blocks;
......
......@@ -327,7 +327,6 @@ constexpr ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES= (10U << 20) /
extern char* srv_log_group_home_dir;
extern ulong srv_n_log_files;
/** The InnoDB redo log file size, or 0 when changing the redo log format
at startup (while disallowing writes to the redo log). */
extern ulonglong srv_log_file_size;
......@@ -511,8 +510,8 @@ extern my_bool srv_purge_view_update_only_debug;
extern my_bool srv_master_thread_disabled_debug;
/** InnoDB system tablespace to set during recovery */
extern uint srv_sys_space_size_debug;
/** whether redo log files have been created at startup */
extern bool srv_log_files_created;
/** whether redo log file has been created at startup */
extern bool srv_log_file_created;
#endif /* UNIV_DEBUG */
extern ulint srv_dml_needed_delay;
......
This diff is collapsed.
......@@ -86,7 +86,7 @@ to file pages already before the recovery is finished: in this case no
ibuf operations are allowed, as they could modify the pages read in the
buffer pool before the pages have been recovered to the up-to-date state.
TRUE means that recovery is running and no operations on the log files
true means that recovery is running and no operations on the log file
are allowed yet: the variable name is misleading. */
bool recv_no_ibuf_operations;
......@@ -544,6 +544,34 @@ inline void recv_sys_t::trim(const page_id_t page_id, lsn_t lsn)
DBUG_VOID_RETURN;
}
void recv_sys_t::open_log_files_if_needed()
{
if (!recv_sys.files.empty())
return;
for (auto &&path : get_existing_log_files_paths())
{
recv_sys.files.emplace_back(std::move(path));
ut_a(recv_sys.files.back().open() == DB_SUCCESS);
}
}
void recv_sys_t::read(os_offset_t total_offset, span<byte> buf)
{
open_log_files_if_needed();
size_t file_idx= static_cast<size_t>(total_offset / log_sys.log.file_size);
os_offset_t offset= total_offset % log_sys.log.file_size;
dberr_t err= recv_sys.files[file_idx].read(offset, buf);
ut_a(err == DB_SUCCESS);
}
size_t recv_sys_t::files_size()
{
open_log_files_if_needed();
return files.size();
}
/** Process a file name from a FILE_* record.
@param[in,out] name file name
@param[in] len length of the file name
......@@ -708,6 +736,8 @@ void recv_sys_t::close()
recv_spaces.clear();
mlog_init.clear();
files.clear();
}
/************************************************************
......@@ -951,7 +981,7 @@ inline void recv_sys_t::free(const void *data)
out: the last read valid lsn
@param[in] end_lsn read area end
@return whether no invalid blocks (e.g checksum mismatch) were found */
bool log_t::files::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
bool log_t::file::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
{
ulint len;
bool success = true;
......@@ -960,7 +990,7 @@ bool log_t::files::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
ut_ad(!(end_lsn % OS_FILE_LOG_BLOCK_SIZE));
byte* buf = log_sys.buf;
loop:
lsn_t source_offset = calc_lsn_offset(*start_lsn);
lsn_t source_offset = calc_lsn_offset_old(*start_lsn);
ut_a(end_lsn - *start_lsn <= ULINT_MAX);
len = (ulint) (end_lsn - *start_lsn);
......@@ -980,7 +1010,7 @@ bool log_t::files::read_log_seg(lsn_t* start_lsn, lsn_t end_lsn)
ut_a((source_offset >> srv_page_size_shift) <= ULINT_MAX);
log_sys.log.read(static_cast<size_t>(source_offset), {buf, len});
recv_sys.read(source_offset, {buf, len});
for (ulint l = 0; l < len; l += OS_FILE_LOG_BLOCK_SIZE,
buf += OS_FILE_LOG_BLOCK_SIZE,
......@@ -1094,6 +1124,28 @@ recv_check_log_header_checksum(
== log_block_calc_checksum_crc32(buf));
}
static bool redo_file_sizes_are_correct()
{
auto paths= get_existing_log_files_paths();
auto get_size= [](const std::string &path) {
return os_file_get_size(path.c_str()).m_total_size;
};
os_offset_t size= get_size(paths[0]);
auto it=
std::find_if(paths.begin(), paths.end(), [&](const std::string &path) {
return get_size(path) != size;
});
if (it == paths.end())
return true;
ib::error() << "Log file " << *it << " is of different size "
<< get_size(*it) << " bytes than other log files " << size
<< " bytes!";
return false;
}
/** Find the latest checkpoint in the format-0 log header.
@param[out] max_field LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2
@return error code or DB_SUCCESS */
......@@ -1105,6 +1157,10 @@ recv_find_max_checkpoint_0(ulint* max_field)
ib_uint64_t checkpoint_no;
byte* buf = log_sys.checkpoint_buf;
if (!redo_file_sizes_are_correct()) {
return DB_CORRUPTION;
}
ut_ad(log_sys.log.format == 0);
/** Offset of the first checkpoint checksum */
......@@ -1172,6 +1228,44 @@ recv_find_max_checkpoint_0(ulint* max_field)
return(DB_ERROR);
}
/** Return number of ib_logfile0..100 files */
static size_t count_log_files()
{
size_t counter= 0;
for (int i= 0; i < 101; i++)
{
auto path=
get_log_file_path(LOG_FILE_NAME_PREFIX).append(std::to_string(i));
os_file_stat_t stat;
dberr_t err= os_file_get_status(path.c_str(), &stat, false, true);
if (err)
break;
if (stat.type != OS_FILE_TYPE_FILE)
break;
counter++;
}
return counter;
}
/** Same as cals_lsn_offset() except that it supports multiple files */
lsn_t log_t::file::calc_lsn_offset_old(lsn_t lsn) const
{
ut_ad(log_sys.mutex.is_owned() || log_sys.write_mutex.is_owned());
const lsn_t size= capacity() * recv_sys.files_size();
lsn_t l= lsn - this->lsn;
if (longlong(l) < 0)
{
l= lsn_t(-longlong(l)) % size;
l= size - l;
}
l+= lsn_offset - LOG_FILE_HDR_SIZE * (1 + lsn_offset / file_size);
l%= size;
return l + LOG_FILE_HDR_SIZE * (1 + l / (file_size - LOG_FILE_HDR_SIZE));
}
/** Determine if a pre-MySQL 5.7.9/MariaDB 10.2.2 redo log is clean.
@param[in] lsn checkpoint LSN
@param[in] crypt whether the log might be encrypted
......@@ -1181,7 +1275,7 @@ recv_find_max_checkpoint_0(ulint* max_field)
static dberr_t recv_log_format_0_recover(lsn_t lsn, bool crypt)
{
log_mutex_enter();
const lsn_t source_offset = log_sys.log.calc_lsn_offset(lsn);
const lsn_t source_offset = log_sys.log.calc_lsn_offset_old(lsn);
log_mutex_exit();
byte* buf = log_sys.buf;
......@@ -1189,8 +1283,8 @@ static dberr_t recv_log_format_0_recover(lsn_t lsn, bool crypt)
"Upgrade after a crash is not supported."
" This redo log was created before MariaDB 10.2.2";
log_sys.log.read(source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1),
{buf, OS_FILE_LOG_BLOCK_SIZE});
recv_sys.read(source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1),
{buf, OS_FILE_LOG_BLOCK_SIZE});
if (log_block_calc_checksum_format_0(buf)
!= log_block_get_checksum(buf)
......@@ -1222,6 +1316,7 @@ static dberr_t recv_log_format_0_recover(lsn_t lsn, bool crypt)
= log_sys.current_flush_lsn = log_sys.flushed_to_disk_lsn
= lsn;
log_sys.next_checkpoint_no = 0;
recv_sys.remove_extra_log_files = true;
return(DB_SUCCESS);
}
......@@ -1233,11 +1328,15 @@ static dberr_t recv_log_format_0_recover(lsn_t lsn, bool crypt)
static dberr_t recv_log_recover_10_4()
{
const lsn_t lsn = log_sys.log.get_lsn();
const lsn_t source_offset = log_sys.log.calc_lsn_offset(lsn);
const lsn_t source_offset = log_sys.log.calc_lsn_offset_old(lsn);
byte* buf = log_sys.buf;
log_sys.log.read(source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1),
{buf, OS_FILE_LOG_BLOCK_SIZE});
if (!redo_file_sizes_are_correct()) {
return DB_CORRUPTION;
}
recv_sys.read(source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1),
{buf, OS_FILE_LOG_BLOCK_SIZE});
ulint crc = log_block_calc_checksum_crc32(buf);
ulint cksum = log_block_get_checksum(buf);
......@@ -1277,6 +1376,7 @@ static dberr_t recv_log_recover_10_4()
= log_sys.current_flush_lsn = log_sys.flushed_to_disk_lsn
= lsn;
log_sys.next_checkpoint_no = 0;
recv_sys.remove_extra_log_files = true;
return DB_SUCCESS;
}
......@@ -1379,7 +1479,7 @@ recv_find_max_checkpoint(ulint* max_field)
if (*max_field == 0) {
/* Before 10.2.2, we could get here during database
initialization if we created an ib_logfile0 file that
initialization if we created an LOG_FILE_NAME file that
was filled with zeroes, and were killed. After
10.2.2, we would reject such a file already earlier,
when checking the file header. */
......@@ -2661,7 +2761,7 @@ static bool recv_scan_log_recs(
}
if (scanned_lsn > recv_sys.scanned_lsn) {
ut_ad(!srv_log_files_created);
ut_ad(!srv_log_file_created);
if (!recv_needed_recovery) {
recv_needed_recovery = true;
......@@ -3146,23 +3246,28 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn)
&& recv_sys.mlog_checkpoint_lsn == checkpoint_lsn) {
/* The redo log is logically empty. */
} else if (checkpoint_lsn != flush_lsn) {
ut_ad(!srv_log_files_created);
ut_ad(!srv_log_file_created);
if (checkpoint_lsn + sizeof_checkpoint < flush_lsn) {
ib::warn() << "Are you sure you are using the"
" right ib_logfiles to start up the database?"
" Log sequence number in the ib_logfiles is "
<< checkpoint_lsn << ", less than the"
" log sequence number in the first system"
" tablespace file header, " << flush_lsn << ".";
ib::warn()
<< "Are you sure you are using the right "
<< LOG_FILE_NAME
<< " to start up the database? Log sequence "
"number in the "
<< LOG_FILE_NAME << " is " << checkpoint_lsn
<< ", less than the log sequence number in "
"the first system tablespace file header, "
<< flush_lsn << ".";
}
if (log_sys.log.is_physical()
&& !recv_needed_recovery) {
ib::info() << "The log sequence number " << flush_lsn
if (!recv_needed_recovery) {
ib::info()
<< "The log sequence number " << flush_lsn
<< " in the system tablespace does not match"
" the log sequence number " << checkpoint_lsn
<< " in the ib_logfiles!";
" the log sequence number "
<< checkpoint_lsn << " in the "
<< LOG_FILE_NAME << "!";
if (srv_read_only_mode) {
ib::error() << "innodb_read_only"
......
......@@ -2136,8 +2136,8 @@ os_file_create_simple_func(
file = CreateFile(
(LPCTSTR) name, access,
FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
create_flag, attributes, NULL);
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, create_flag, attributes, NULL);
if (file == INVALID_HANDLE_VALUE) {
......@@ -2404,9 +2404,8 @@ os_file_create_func(
);
DWORD create_flag;
DWORD share_mode = srv_operation != SRV_OPERATION_NORMAL
? FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
: FILE_SHARE_READ | FILE_SHARE_DELETE;
const DWORD share_mode =
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) {
WAIT_ALLOW_WRITES();
......@@ -2426,12 +2425,6 @@ os_file_create_func(
create_flag = OPEN_EXISTING;
/* On Windows Physical devices require admin privileges and
have to have the write-share mode set. See the remarks
section for the CreateFile() function documentation in MSDN. */
share_mode |= FILE_SHARE_WRITE;
} else if (create_mode == OS_FILE_OPEN
|| create_mode == OS_FILE_OPEN_RETRY) {
......@@ -2612,9 +2605,8 @@ os_file_create_simple_no_error_handling_func(
DWORD access;
DWORD create_flag;
DWORD attributes = 0;
DWORD share_mode = srv_operation != SRV_OPERATION_NORMAL
? FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
: FILE_SHARE_READ | FILE_SHARE_DELETE;
const DWORD share_mode =
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;
ut_a(name);
......@@ -2660,11 +2652,6 @@ os_file_create_simple_no_error_handling_func(
access = GENERIC_READ;
/*!< A backup program has to give mysqld the maximum
freedom to do what it likes with the file */
share_mode |= FILE_SHARE_DELETE | FILE_SHARE_WRITE
| FILE_SHARE_READ;
} else {
ib::error()
......@@ -3911,7 +3898,7 @@ static bool is_linux_native_aio_supported()
{
File fd;
io_context_t io_ctx;
char name[1000];
std::string log_file_path = get_log_file_path();
memset(&io_ctx, 0, sizeof(io_ctx));
if (io_setup(1, &io_ctx)) {
......@@ -3939,31 +3926,14 @@ static bool is_linux_native_aio_supported()
}
}
else {
os_normalize_path(srv_log_group_home_dir);
ulint dirnamelen = strlen(srv_log_group_home_dir);
ut_a(dirnamelen < (sizeof name) - 10 - sizeof "ib_logfile");
memcpy(name, srv_log_group_home_dir, dirnamelen);
/* Add a path separator if needed. */
if (dirnamelen && name[dirnamelen - 1] != OS_PATH_SEPARATOR) {
name[dirnamelen++] = OS_PATH_SEPARATOR;
}
strcpy(name + dirnamelen, "ib_logfile0");
fd = my_open(name, O_RDONLY | O_CLOEXEC, MYF(0));
fd = my_open(log_file_path.c_str(), O_RDONLY | O_CLOEXEC,
MYF(0));
if (fd == -1) {
ib::warn()
<< "Unable to open"
<< " \"" << name << "\" to check native"
<< " AIO read support.";
ib::warn() << "Unable to open \"" << log_file_path
<< "\" to check native"
<< " AIO read support.";
int ret = io_destroy(io_ctx);
ut_a(ret != EINVAL);
......@@ -4024,7 +3994,7 @@ static bool is_linux_native_aio_supported()
ib::error()
<< "Linux Native AIO not supported. You can either"
" move "
<< (srv_read_only_mode ? name : "tmpdir")
<< (srv_read_only_mode ? log_file_path : "tmpdir")
<< " to a file system that supports native"
" AIO or you can set innodb_use_native_aio to"
" FALSE to avoid this message.";
......@@ -4033,7 +4003,7 @@ static bool is_linux_native_aio_supported()
default:
ib::error()
<< "Linux Native AIO check on "
<< (srv_read_only_mode ? name : "tmpdir")
<< (srv_read_only_mode ? log_file_path : "tmpdir")
<< "returned error[" << -err << "]";
}
......
......@@ -162,7 +162,6 @@ static os_event_t srv_master_thread_disabled_event;
/*------------------------- LOG FILES ------------------------ */
char* srv_log_group_home_dir;
ulong srv_n_log_files;
/** The InnoDB redo log file size, or 0 when changing the redo log format
at startup (while disallowing writes to the redo log). */
ulonglong srv_log_file_size;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment