Skip to content
Permalink
Browse files
Merge 10.2 into 10.3
  • Loading branch information
dr-m committed Mar 29, 2018
2 parents 4277c17 + 014dfe4 commit 980dd09
Show file tree
Hide file tree
Showing 22 changed files with 287 additions and 132 deletions.
@@ -774,49 +774,37 @@ Innodb_pages0_read 4
# Success!
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
# Restart Success!
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use test;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use innodb_encrypted_1;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use innodb_encrypted_2;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use innodb_encrypted_3;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use innodb_encrypted_1;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use innodb_encrypted_2;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
use innodb_encrypted_3;
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
show status like 'innodb_pages0_read%';
Variable_name Value
Innodb_pages0_read 304
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
variable_value <= 303
1
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
NAME
innodb_encrypted_3/t_1
@@ -148,20 +148,19 @@ show status like 'innodb_pages0_read%';
-- source include/restart_mysqld.inc

--echo # Restart Success!
show status like 'innodb_pages0_read%';

show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
use test;
show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
use innodb_encrypted_1;
show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
use innodb_encrypted_2;
show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';
use innodb_encrypted_3;
show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';

use innodb_encrypted_1;
show status like 'innodb_pages0_read%';

--disable_result_log
--disable_query_log
let $tables = 100;
@@ -173,10 +172,9 @@ while ($tables)
--enable_query_log
--enable_result_log

show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';

use innodb_encrypted_2;
show status like 'innodb_pages0_read%';

--disable_result_log
--disable_query_log
@@ -189,10 +187,10 @@ while ($tables)
--enable_query_log
--enable_result_log

show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';

use innodb_encrypted_3;
show status like 'innodb_pages0_read%';

--disable_result_log
--disable_query_log
let $tables = 100;
@@ -204,7 +202,7 @@ while ($tables)
--enable_query_log
--enable_result_log

show status like 'innodb_pages0_read%';
SELECT variable_value <= 303 FROM information_schema.global_status WHERE variable_name = 'innodb_pages0_read';

SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'innodb_encrypted%' ORDER BY NAME;
@@ -1,7 +1,9 @@
# 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
}

perl;
my $cp = $ENV{CHECKPOINT_LSN};
@@ -22,7 +24,8 @@ my $cp2 = $cp2hi << 32 | $cp2lo;
open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die;

if ($cp1 > $cp || $cp2 > $cp) {
print OUT "--source include/start_mysqld.inc\n";
print OUT "--source include/start_mysqld.inc\n"
unless $ENV{no_checkpoint_kill};
print OUT "$ENV{CLEANUP_IF_CHECKPOINT}\n";
print OUT "--skip Extra checkpoint 1 after $cp";
print OUT " ($no1hi:$no1lo=$cp1,$no2hi:$no2lo=$cp2)\n";
@@ -12,11 +12,11 @@ ERROR HY000: Running in read-only mode
alter table t1 add f3 int not null, algorithm=copy;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
alter table t1 add f3 int not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Operation not allowed when innodb_forced_recovery > 0.. Try ALGORITHM=COPY
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
drop index idx on t1;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
alter table t1 drop index idx, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Operation not allowed when innodb_forced_recovery > 0.. Try ALGORITHM=COPY
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
update t1 set f1=3 where f2=2;
ERROR HY000: Running in read-only mode
create table t3(f1 int not null)engine=innodb;
@@ -40,7 +40,7 @@ ERROR HY000: Running in read-only mode
alter table t2 add f3 int not null, algorithm=copy;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
alter table t2 add f3 int not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Operation not allowed when innodb_forced_recovery > 0.. Try ALGORITHM=COPY
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
drop index idx on t2;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 165 "Table is read only")
update t2 set f1=3 where f2=2;
@@ -67,7 +67,7 @@ ERROR HY000: Table 't2' is read only
alter table t2 add f3 int not null, algorithm=copy;
ERROR HY000: Table 't2' is read only
alter table t2 add f3 int not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Operation not allowed when innodb_forced_recovery > 0.. Try ALGORITHM=COPY
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
drop index idx on t2;
ERROR HY000: Table 't2' is read only
update t2 set f1=3 where f2=2;
@@ -5,24 +5,24 @@ call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that yo
call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`\\.`t21` because it could not be opened");
call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: ");
call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist");
SELECT @@GLOBAL.innodb_flush_log_at_trx_commit;
@@GLOBAL.innodb_flush_log_at_trx_commit
1
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
SET GLOBAL INNODB_FAST_SHUTDOWN = 0;
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
# Fails during full backup
DROP TABLE t1;
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
INSERT INTO t1(a) select 1 union select 2 union select 3;
# Create full backup , modify table, then fails during creation of
# incremental/differential backup
SET GLOBAL INNODB_FAST_SHUTDOWN = 0;
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1(i INT) ENGINE INNODB;
INSERT INTO t1 VALUES(1);
CREATE TABLE t21(i INT) ENGINE INNODB;
INSERT INTO t21 VALUES(1);
CREATE TABLE t2(i int) ENGINE INNODB;
SET GLOBAL INNODB_FAST_SHUTDOWN = 0;
ALTER TABLE t21 FORCE, ALGORITHM=INPLACE;
# Create partial backup (excluding table t21), Ignore the
# unsupported redo log for the table t21.
@@ -10,23 +10,35 @@ call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;

SELECT @@GLOBAL.innodb_flush_log_at_trx_commit;
CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;

SET GLOBAL INNODB_FAST_SHUTDOWN = 0;
--source include/restart_mysqld.inc

--source ../../suite/innodb/include/no_checkpoint_start.inc
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;

# Below mariabackup operation may complete successfully if checkpoint happens
# after the alter table command.

echo # Fails during full backup;
--disable_result_log
--error 1
--error 0,1
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log

DROP TABLE t1;

--let MYSQLD_DATADIR=$basedir/
perl;
open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die;
print OUT '
--let no_checkpoint_end=1
--let CLEANUP_IF_CHECKPOINT=rmdir $basedir;
--source ../../suite/innodb/include/no_checkpoint_end.inc
--exit Backup failed to fail despite MLOG_INDEX_LOAD record
' if (-f "$ENV{MYSQLD_DATADIR}/xtrabackup_info");
close(OUT);
EOF
--source $MYSQLTEST_VARDIR/log/check.txt
--remove_file $MYSQLTEST_VARDIR/log/check.txt
rmdir $basedir;

CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB;
@@ -39,18 +51,30 @@ INSERT INTO t1(a) select 1 union select 2 union select 3;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log

SET GLOBAL INNODB_FAST_SHUTDOWN = 0;
--source include/restart_mysqld.inc
--source ../../suite/innodb/include/no_checkpoint_start.inc
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;

--disable_result_log
--error 1
--error 0,1
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
--enable_result_log

DROP TABLE t1;
rmdir $basedir;
rmdir $incremental_dir;

--let MYSQLD_DATADIR=$incremental_dir/
perl;
open(OUT, ">$ENV{MYSQLTEST_VARDIR}/log/check.txt") || die;
print OUT '
--let no_checkpoint_end=1
--let CLEANUP_IF_CHECKPOINT=rmdir $basedir;rmdir $incremental_dir;
--source ../../suite/innodb/include/no_checkpoint_end.inc
--exit Backup failed to fail despite MLOG_INDEX_LOAD record
' if (-f "$ENV{MYSQLD_DATADIR}/xtrabackup_info");
close(OUT);
EOF
--source $MYSQLTEST_VARDIR/log/check.txt
--remove_file $MYSQLTEST_VARDIR/log/check.txt
rmdir $basedir;rmdir $incremental_dir;

CREATE TABLE t1(i INT) ENGINE INNODB;
INSERT INTO t1 VALUES(1);
@@ -62,8 +86,6 @@ let $targetdir=$MYSQLTEST_VARDIR/tmp/bk;

CREATE TABLE t2(i int) ENGINE INNODB;

SET GLOBAL INNODB_FAST_SHUTDOWN = 0;
--source include/restart_mysqld.inc
ALTER TABLE t21 FORCE, ALGORITHM=INPLACE;

--echo # Create partial backup (excluding table t21), Ignore the
@@ -484,7 +484,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables,
old locks. This should always succeed (unless some external process
has removed the tables)
*/
thd->locked_tables_list.reopen_tables(thd);
result= thd->locked_tables_list.reopen_tables(thd);
/*
Since downgrade_lock() won't do anything with shared
metadata lock it is much simpler to go through all open tables rather
@@ -360,18 +360,23 @@ buf_dump(

for (bpage = UT_LIST_GET_FIRST(buf_pool->LRU), j = 0;
bpage != NULL && j < n_pages;
bpage = UT_LIST_GET_NEXT(LRU, bpage), j++) {
bpage = UT_LIST_GET_NEXT(LRU, bpage)) {

ut_a(buf_page_in_file(bpage));
if (bpage->id.space() >= SRV_LOG_SPACE_FIRST_ID) {
/* Ignore the innodb_temporary tablespace. */
continue;
}

dump[j] = BUF_DUMP_CREATE(bpage->id.space(),
bpage->id.page_no());
dump[j++] = BUF_DUMP_CREATE(bpage->id.space(),
bpage->id.page_no());
}

ut_a(j == n_pages);

buf_pool_mutex_exit(buf_pool);

ut_a(j <= n_pages);
n_pages = j;

for (j = 0; j < n_pages && !SHOULD_QUIT(); j++) {
ret = fprintf(f, ULINTPF "," ULINTPF "\n",
BUF_DUMP_SPACE(dump[j]),
@@ -677,6 +682,11 @@ buf_load()
/* space_id for this iteration of the loop */
const ulint this_space_id = BUF_DUMP_SPACE(dump[i]);

if (this_space_id >= SRV_LOG_SPACE_FIRST_ID) {
/* Ignore the innodb_temporary tablespace. */
continue;
}

if (this_space_id != cur_space_id) {
if (space != NULL) {
fil_space_release(space);
@@ -686,7 +686,7 @@ fil_node_open_file(
ib::error()
<< "Expected tablespace id " << space->id
<< " but found " << space_id
<< "in the file" << node->name;
<< " in the file" << node->name;
return(false);
}

@@ -5159,7 +5159,7 @@ fil_io(
break;

} else {
if (space->id != srv_sys_space.space_id()
if (space->id != TRX_SYS_SPACE
&& UT_LIST_GET_LEN(space->chain) == 1
&& (srv_is_tablespace_truncated(space->id)
|| space->is_being_truncated
@@ -5211,7 +5211,7 @@ fil_io(
/* Check that at least the start offset is within the bounds of a
single-table tablespace, including rollback tablespaces. */
if (node->size <= cur_page_no
&& space->id != srv_sys_space.space_id()
&& space->id != TRX_SYS_SPACE
&& fil_type_is_data(space->purpose)) {

if (req_type.ignore_missing()) {
@@ -942,7 +942,7 @@ fsp_try_extend_data_file(fil_space_t* space, fsp_header_t* header, mtr_t* mtr)

ut_d(fsp_space_modify_check(space, mtr));

if (space->id == srv_sys_space.space_id()
if (space->id == TRX_SYS_SPACE
&& !srv_sys_space.can_auto_extend_last_file()) {

/* We print the error message only once to avoid
@@ -956,7 +956,7 @@ fsp_try_extend_data_file(fil_space_t* space, fsp_header_t* header, mtr_t* mtr)
srv_sys_space.set_tablespace_full_status(true);
}
return(0);
} else if (fsp_is_system_temporary(space->id)
} else if (space->id == SRV_TMP_SPACE_ID
&& !srv_tmp_space.can_auto_extend_last_file()) {

/* We print the error message only once to avoid

0 comments on commit 980dd09

Please sign in to comment.