Skip to content
/ server Public
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,7 @@ copy_back()
if it exists. */

ds_tmp = ds_create(dst_dir, DS_TYPE_LOCAL);
if (!(ret = copy_or_move_file(ds_tmp, LOG_FILE_NAME, LOG_FILE_NAME,
if (!(ret = copy_or_move_file(ds_tmp, "ib_logfile0", "ib_logfile0",
dst_dir, 1))) {
goto cleanup;
}
Expand Down Expand Up @@ -1869,7 +1869,7 @@ copy_back()
}

/* skip the redo log (it was already copied) */
if (!strcmp(filename, LOG_FILE_NAME)) {
if (!strcmp(filename, "ib_logfile0")) {
continue;
}

Expand Down
10 changes: 6 additions & 4 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ static bool innodb_init()
srv_log_group_home_dir= xtrabackup_target_dir;

bool ret;
const std::string ib_logfile0{get_log_file_path()};
const std::string ib_logfile0{log_sys.get_circular_path()};
os_file_delete_if_exists_func(ib_logfile0.c_str(), nullptr);
os_file_t file= os_file_create_func(ib_logfile0.c_str(),
OS_FILE_CREATE,
Expand Down Expand Up @@ -5479,6 +5479,7 @@ static bool xtrabackup_backup_func()

srv_n_purge_threads = 1;
srv_read_only_mode = TRUE;
recv_sys.rpo = LSN_MAX;

srv_operation = SRV_OPERATION_BACKUP;
log_file_op = backup_file_op;
Expand Down Expand Up @@ -5570,10 +5571,11 @@ static bool xtrabackup_backup_func()

/* open the log file */
memset(&stat_info, 0, sizeof(MY_STAT));
dst_log_file = ds_open(backup_datasinks.m_redo, LOG_FILE_NAME, &stat_info);
dst_log_file =
ds_open(backup_datasinks.m_redo, "ib_logfile0", &stat_info);
if (dst_log_file == NULL) {
msg("Error: failed to open the target stream for '%s'.",
LOG_FILE_NAME);
msg("Error: failed to open the target stream"
" for 'ib_logfile0'.");
goto fail;
}

Expand Down
4 changes: 4 additions & 0 deletions mysql-test/include/innodb_encrypt_log.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
# (see include/innodb_encrypt_log.combinations)

--source include/have_innodb.inc
if ($MTR_COMBINATION_CRYPT)
{
--source ../suite/encryption/include/skip_innodb_log_archive.inc
}
4 changes: 2 additions & 2 deletions mysql-test/mariadb-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ END
my $opt_debug_sync_timeout= 300; # Default timeout for WAIT_FOR actions.
my $warn_seconds = 60;

my $rebootstrap_re= '--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path|force_rebootstrap';
my $rebootstrap_re= '--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_](group[-_]home[-_]dir|archive)|data[-_]home[-_]dir)|data[-_]file[-_]path|force_rebootstrap';

sub testcase_timeout ($) { return $opt_testcase_timeout * 60; }
sub check_timeout ($) { return testcase_timeout($_[0]); }
Expand Down Expand Up @@ -3145,7 +3145,7 @@ sub mysql_install_db {
# need to be given to the bootstrap process as well as the
# server process.
foreach my $extra_opt ( @opt_extra_mysqld_opt ) {
if ($extra_opt =~ /--innodb/) {
if ($extra_opt =~ /--((loose|skip)[-_])*innodb/) {
mtr_add_arg($args, $extra_opt);
}
}
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/suite/encryption/include/skip_innodb_log_archive.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--disable_query_log
SET STATEMENT sql_log_bin=0 FOR
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed\\.");
SET STATEMENT sql_log_bin=0 FOR
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
SET STATEMENT sql_log_bin=0 FOR
call mtr.add_suppression("InnoDB: ib_0.*\\.log does not match innodb_encrypt_log");
--enable_query_log
if (`SELECT COUNT(*)=0 FROM information_schema.global_variables where variable_name='innodb_log_archive' and variable_value='OFF'`)
{
--skip Test requires innodb_log_archive=OFF
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err
# empty redo log from before 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-log-recovery-target=12345
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
0
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=12345!=/ 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=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/bulk_insert.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
--source include/skip_innodb_log_archive.inc # innodb_encrypt_log
--source include/have_sequence.inc
--source include/have_file_key_management_plugin.inc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
--source ../../suite/innodb/include/no_checkpoint_prepare.inc
--source include/have_file_key_management_plugin.inc

--disable_query_log
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/debug_key_management.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_debug.inc
-- source include/innodb_undo_tablespaces.inc
-- source include/not_embedded.inc
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/encryption/t/doublewrite_debug.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
--source include/have_innodb.inc
--source ../../suite/innodb/include/skip_innodb_log_archive.inc #mariadb-backup
--source include/have_debug.inc
--source include/not_embedded.inc
--source include/have_file_key_management_plugin.inc
--source ../../suite/innodb/include/no_checkpoint_prepare.inc
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t[12]\\.ibd looks corrupted");
call mtr.add_suppression("InnoDB: Unable to apply log to corrupted page ");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/encrypt_and_grep.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/innodb_undo_tablespaces.inc
-- source include/have_file_key_management_plugin.inc

Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/encryption_force.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_partition.inc
-- source include/have_example_key_management_plugin.inc

Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/file_creation.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
--source ../../suite/innodb/include/no_checkpoint_prepare.inc
--source include/have_example_key_management_plugin.inc
let $restart_noprint=2;
# embedded does not support restart
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innochecksum.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Require InnoDB
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
-- source include/skip_innodb_log_archive.inc # depends on innodb_log_archive=OFF checkpoint logic
-- source include/innodb_page_size_small.inc
-- source include/innodb_checksum_algorithm.inc
-- source include/maybe_debug.inc
Expand Down
5 changes: 0 additions & 5 deletions mysql-test/suite/encryption/t/innodb-first-page-read.opt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_file_key_management_plugin.inc
# not embedded because of restarts
-- source include/not_embedded.inc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/not_embedded.inc
-- source include/have_file_key_management_plugin.inc

Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb-redo-badkey.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
--source ../../suite/innodb/include/no_checkpoint_prepare.inc
-- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb-redo-nokeys.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
--source ../../suite/innodb/include/no_checkpoint_prepare.inc
-- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb_encrypt_freed.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--source include/have_innodb.inc
--source include/skip_innodb_log_archive.inc # innodb_encrypt_log
--source include/have_example_key_management_plugin.inc
--source include/have_debug.inc
--source include/not_embedded.inc
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb_encrypt_log.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/not_embedded.inc
-- source filekeys_plugin.inc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--source include/skip_innodb_log_archive.inc # innodb_encrypt_log
--let $no_cleanup=1
--source ../../innodb/t/log_corruption.test

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_example_key_management_plugin.inc
-- source include/not_embedded.inc
# This test is too slow for valgrind and causes innnodb semaphores to time out
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb_encryption.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
#
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_example_key_management_plugin.inc
-- source include/innodb_undo_tablespaces.inc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_example_key_management_plugin.inc
-- source include/not_valgrind.inc
-- source include/not_embedded.inc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_example_key_management_plugin.inc
-- source include/not_embedded.inc
# We can't run this test under valgrind as it 'takes forever'
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/innodb_first_page.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

--source include/have_innodb.inc
--source include/skip_innodb_log_archive.inc # innodb_encrypt_log
--source include/have_file_key_management_plugin.inc
--source include/innodb_undo_tablespaces.inc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- source include/have_innodb.inc
-- source include/skip_innodb_log_archive.inc # innodb_encrypt_log
-- source include/have_file_key_management_plugin.inc
# test uses restart
-- source include/not_embedded.inc
Expand Down
1 change: 1 addition & 0 deletions mysql-test/suite/encryption/t/recovery_memory.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--source include/have_debug.inc
--source include/have_innodb.inc
--source include/skip_innodb_log_archive.inc # innodb_encrypt_log
--source include/have_sequence.inc
--source filekeys_plugin.inc

Expand Down
44 changes: 21 additions & 23 deletions mysql-test/suite/innodb/include/no_checkpoint_end.inc
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# Check that the latest checkpoint in the redo log files
# is not newer than the checkpoint sampled by no_checkpoint_start.inc

if (!$no_checkpoint_kill) {
--source include/kill_mysqld.inc
}
--error 2
--exec $MYSQLD_CMD --innodb --innodb-read-only --innodb-invalid-option --innodb-page-size=$INNODB_PAGE_SIZE --innodb-buffer-pool-size=21m

perl;
my $cp = $ENV{CHECKPOINT_LSN};
$cp =~ s/^InnoDB\t\t//;
my $log = "$ENV{MYSQLD_DATADIR}ib_logfile0";
open(LOG, "<$log") || die "Unable to open $log";
seek(LOG, 4096, 0) || die "Unable to seek $log";
die unless read(LOG, $_, 8) == 8;
my ($cp1hi,$cp1lo) = unpack("NN", $_);
seek(LOG, 8192, 0) || die "Unable to seek $log";
die unless read(LOG, $_, 8) == 8;
my ($cp2hi,$cp2lo) = unpack("NN", $_);
close(LOG);

my $cp1 = $cp1hi << 32 | $cp1lo;
my $cp2 = $cp2hi << 32 | $cp2lo;

my $cp=0;
my $search_file= "$ENV{MYSQLTEST_VARDIR}/log/mysqld.1.err";
open(FILE, '<', $search_file) || die("Can't open file $search_file: $!");
while(<FILE>)
{
if (/^CURRENT_TEST:/)
{
$cp=0;
}
elsif (!$cp && /\[Warning\] innodb_read_only prevents crash recovery between (\d+) and/o)
{
$cp=$1;
}
}
close(FILE);
open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die;

if ($cp1 > $cp || $cp2 > $cp) {
print OUT "--source include/start_mysqld.inc\n"
unless $ENV{no_checkpoint_kill};
if ($cp != $ENV{CHECKPOINT_LSN})
{
print OUT "--source include/start_mysqld.inc\n";
print OUT "$ENV{CLEANUP_IF_CHECKPOINT}\n";
print OUT "--skip Extra checkpoint 1 after $cp ($cp1,$cp2)\n";
print OUT "--skip Unexpected checkpoint $cp != $ENV{CHECKPOINT_LSN}\n";
}

close(OUT);
EOF

Expand Down
8 changes: 8 additions & 0 deletions mysql-test/suite/innodb/include/no_checkpoint_prepare.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--disable_query_log
call mtr.add_suppression("InnoDB: innodb_read_only prevents crash recovery");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("unknown option '--innodb-invalid-option'");
call mtr.add_suppression("\\[ERROR\\] Aborting");
let $INNODB_PAGE_SIZE=`SELECT @@GLOBAL.innodb_page_size`;
--enable_query_log
4 changes: 4 additions & 0 deletions mysql-test/suite/innodb/include/skip_innodb_log_archive.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if (`SELECT @@GLOBAL.innodb_log_archive`)
{
--skip Test requires innodb_log_archive=OFF
}
21 changes: 19 additions & 2 deletions mysql-test/suite/innodb/r/corrupted_during_recovery.result
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 VALUES(1);
SET GLOBAL innodb_max_purge_lag_wait=0, innodb_log_checkpoint_now=ON;
connect stop_purge,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
CREATE TABLE t2(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(2);
SET GLOBAL innodb_flush_log_at_trx_commit=1;
INSERT INTO t2 VALUES(1);
# Kill the server
disconnect stop_purge;
SELECT * FROM t2;
Got one of the listed errors
SELECT * FROM t2;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target.*/ in mysqld.1.err
DELETE FROM t1;
Got one of the listed errors
DELETE FROM t2;
Got one of the listed errors
# Corrupt the pages
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Page \[page id: space=[1-9][0-9]*, page number=3\] log sequence number 1311768467463790320 is in the future!/ in mysqld.1.err
SELECT * FROM t1;
a
1
Expand All @@ -18,6 +31,7 @@ a
CHECK TABLE t2;
Table Op Msg_type Msg_text
test.t2 check status OK
FOUND 1 /InnoDB: Page \[page id: space=[1-9][0-9]*, page number=3\] log sequence number 1311768467463790320 is in the future!.*/ in mysqld.1.err
DROP TABLE t1, t2;
CREATE TABLE t1(pk SERIAL) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
Expand All @@ -31,6 +45,9 @@ DELETE FROM t1 WHERE pk=3;
disconnect con1;
# Corrupt the page
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Did not find innodb_log_recovery_start=\d+ .*/ in mysqld.1.err
SELECT * FROM t1;
pk
1
2
Expand Down
Loading
Loading