2014-12-22 15:53:17 +01:00
|
|
|
create table snapshot_status engine = myisam
|
|
|
|
select * from information_schema.global_status
|
|
|
|
where variable_name like 'innodb_scrub%';
|
2017-01-04 19:49:13 +01:00
|
|
|
# MDEV-8139 Fix scrubbing tests
|
|
|
|
# FIXME: Add index(b) to each table; ensure that undo logs are scrubbed.
|
|
|
|
create table delete_3 (
|
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=compressed;
|
|
|
|
delete from delete_3;
|
|
|
|
create table delete_rollback_delete_3 (
|
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=compressed;
|
|
|
|
begin;
|
|
|
|
delete from delete_rollback_delete_3;
|
|
|
|
rollback;
|
|
|
|
delete from delete_rollback_delete_3;
|
|
|
|
create table insert_rollback_3 (
|
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=compressed;
|
|
|
|
begin;
|
|
|
|
rollback;
|
|
|
|
create table delete_2 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=compact;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_2;
|
|
|
|
create table delete_rollback_delete_2 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=compact;
|
|
|
|
begin;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_rollback_delete_2;
|
2014-12-22 15:53:17 +01:00
|
|
|
rollback;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_rollback_delete_2;
|
|
|
|
create table insert_rollback_2 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=compact;
|
|
|
|
begin;
|
|
|
|
rollback;
|
2017-01-04 19:49:13 +01:00
|
|
|
create table delete_1 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=redundant;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_1;
|
|
|
|
create table delete_rollback_delete_1 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=redundant;
|
|
|
|
begin;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_rollback_delete_1;
|
2014-12-22 15:53:17 +01:00
|
|
|
rollback;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_rollback_delete_1;
|
|
|
|
create table insert_rollback_1 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=redundant;
|
|
|
|
begin;
|
|
|
|
rollback;
|
2017-01-04 19:49:13 +01:00
|
|
|
create table delete_0 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=dynamic;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_0;
|
|
|
|
create table delete_rollback_delete_0 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=dynamic;
|
|
|
|
begin;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_rollback_delete_0;
|
2014-12-22 15:53:17 +01:00
|
|
|
rollback;
|
2017-01-04 19:49:13 +01:00
|
|
|
delete from delete_rollback_delete_0;
|
|
|
|
create table insert_rollback_0 (
|
2014-12-22 15:53:17 +01:00
|
|
|
a int auto_increment primary key,
|
|
|
|
b varchar(256),
|
|
|
|
c text) engine = innodb row_format=dynamic;
|
|
|
|
begin;
|
|
|
|
rollback;
|
2017-01-04 19:49:13 +01:00
|
|
|
SET GLOBAL innodb_fast_shutdown=0;
|
|
|
|
# delete_3.ibd
|
|
|
|
# delete_rollback_delete_3.ibd
|
|
|
|
# insert_rollback_3.ibd
|
|
|
|
# delete_2.ibd
|
|
|
|
# delete_rollback_delete_2.ibd
|
|
|
|
# insert_rollback_2.ibd
|
|
|
|
# delete_1.ibd
|
|
|
|
# delete_rollback_delete_1.ibd
|
|
|
|
# insert_rollback_1.ibd
|
|
|
|
# delete_0.ibd
|
|
|
|
# delete_rollback_delete_0.ibd
|
|
|
|
# insert_rollback_0.ibd
|
|
|
|
check table delete_3, delete_rollback_delete_3, insert_rollback_3;
|
|
|
|
Table Op Msg_type Msg_text
|
|
|
|
test.delete_3 check status OK
|
|
|
|
test.delete_rollback_delete_3 check status OK
|
|
|
|
test.insert_rollback_3 check status OK
|
|
|
|
drop table delete_3, delete_rollback_delete_3, insert_rollback_3;
|
|
|
|
check table delete_2, delete_rollback_delete_2, insert_rollback_2;
|
|
|
|
Table Op Msg_type Msg_text
|
|
|
|
test.delete_2 check status OK
|
|
|
|
test.delete_rollback_delete_2 check status OK
|
|
|
|
test.insert_rollback_2 check status OK
|
|
|
|
drop table delete_2, delete_rollback_delete_2, insert_rollback_2;
|
|
|
|
check table delete_1, delete_rollback_delete_1, insert_rollback_1;
|
|
|
|
Table Op Msg_type Msg_text
|
|
|
|
test.delete_1 check status OK
|
|
|
|
test.delete_rollback_delete_1 check status OK
|
|
|
|
test.insert_rollback_1 check status OK
|
|
|
|
drop table delete_1, delete_rollback_delete_1, insert_rollback_1;
|
|
|
|
check table delete_0, delete_rollback_delete_0, insert_rollback_0;
|
|
|
|
Table Op Msg_type Msg_text
|
|
|
|
test.delete_0 check status OK
|
|
|
|
test.delete_rollback_delete_0 check status OK
|
|
|
|
test.insert_rollback_0 check status OK
|
|
|
|
drop table delete_0, delete_rollback_delete_0, insert_rollback_0;
|
2014-12-22 15:53:17 +01:00
|
|
|
show variables like 'innodb_%scrub_data%';
|
|
|
|
Variable_name Value
|
|
|
|
innodb_background_scrub_data_check_interval 3600
|
|
|
|
innodb_background_scrub_data_compressed OFF
|
|
|
|
innodb_background_scrub_data_interval 604800
|
|
|
|
innodb_background_scrub_data_uncompressed OFF
|
|
|
|
innodb_immediate_scrub_data_uncompressed ON
|
|
|
|
# verify that this test have not caused any background scrubbing
|
|
|
|
select ss.variable_name, gs.variable_value - ss.variable_value as variable_value
|
|
|
|
from snapshot_status ss,
|
|
|
|
information_schema.global_status gs
|
|
|
|
where ss.variable_name = gs.variable_name;
|
|
|
|
variable_name variable_value
|
|
|
|
INNODB_SCRUB_BACKGROUND_PAGE_REORGANIZATIONS 0
|
|
|
|
INNODB_SCRUB_BACKGROUND_PAGE_SPLITS 0
|
|
|
|
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_MISSING_INDEX 0
|
|
|
|
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_OUT_OF_FILESPACE 0
|
|
|
|
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNDERFLOW 0
|
|
|
|
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNKNOWN 0
|
|
|
|
drop table snapshot_status;
|