summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-05-05 12:51:44 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-05-05 12:51:44 +0300
commitd44a10f4dd3567fd84a7f5c6b8a00ce3a441eab7 (patch)
treec4eb78bd10969ad7454192df3b6c99a85876af5c
parentf67327749194d86e58f33f004473b437008b5b44 (diff)
downloadmariadb-git-d44a10f4dd3567fd84a7f5c6b8a00ce3a441eab7.tar.gz
MDEV-23855 follow-up: Make innodb.doublewrite more stable
The test innodb.doublewrite could occasionally fail with 64KiB page size because the page 0 would no longer be in the doublewrite buffer. Let us stop purge before the server is killed, and ensure that the entire buffer pool will be flushed before we initiate an extra write of page 0.
-rw-r--r--mysql-test/suite/innodb/r/doublewrite.result9
-rw-r--r--mysql-test/suite/innodb/t/doublewrite.test11
2 files changed, 13 insertions, 7 deletions
diff --git a/mysql-test/suite/innodb/r/doublewrite.result b/mysql-test/suite/innodb/r/doublewrite.result
index 5adae545a71..1f26f7d1f5f 100644
--- a/mysql-test/suite/innodb/r/doublewrite.result
+++ b/mysql-test/suite/innodb/r/doublewrite.result
@@ -14,6 +14,9 @@ innodb_fil_make_page_dirty_debug 0
show variables like 'innodb_saved_page_number_debug';
Variable_name Value
innodb_saved_page_number_debug 0
+connect stop_purge,localhost,root,,;
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
create table t1 (f1 int primary key, f2 blob) engine=innodb;
start transaction;
insert into t1 values(1, repeat('#',12));
@@ -29,17 +32,17 @@ select space from information_schema.innodb_sys_tables
where name = 'test/t1' into @space_id;
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-# Ensure that dirty pages of table t1 is flushed.
-flush tables t1 for export;
-unlock tables;
begin;
insert into t1 values (6, repeat('%', 12));
+# Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
# Make the first page dirty for table t1
set global innodb_saved_page_number_debug = 0;
set global innodb_fil_make_page_dirty_debug = @space_id;
# Ensure that dirty pages of table t1 are flushed.
set global innodb_buf_flush_list_now = 1;
# Kill the server
+disconnect stop_purge;
# Make the first page (page_no=0) of the user tablespace
# full of zeroes.
#
diff --git a/mysql-test/suite/innodb/t/doublewrite.test b/mysql-test/suite/innodb/t/doublewrite.test
index 1a36dbef337..bd4f5fadcc3 100644
--- a/mysql-test/suite/innodb/t/doublewrite.test
+++ b/mysql-test/suite/innodb/t/doublewrite.test
@@ -34,6 +34,10 @@ show variables like 'innodb_doublewrite';
show variables like 'innodb_fil_make_page_dirty_debug';
show variables like 'innodb_saved_page_number_debug';
+connect (stop_purge,localhost,root,,);
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+
create table t1 (f1 int primary key, f2 blob) engine=innodb;
start transaction;
@@ -51,12 +55,10 @@ commit work;
select space from information_schema.innodb_sys_tables
where name = 'test/t1' into @space_id;
---echo # Ensure that dirty pages of table t1 is flushed.
-flush tables t1 for export;
-unlock tables;
-
begin;
insert into t1 values (6, repeat('%', 12));
+--echo # Ensure that dirty pages of table t1 are flushed.
+set global innodb_buf_flush_list_now = 1;
--source ../include/no_checkpoint_start.inc
@@ -69,6 +71,7 @@ set global innodb_buf_flush_list_now = 1;
--let CLEANUP_IF_CHECKPOINT=drop table t1;
--source ../include/no_checkpoint_end.inc
+disconnect stop_purge;
--echo # Make the first page (page_no=0) of the user tablespace
--echo # full of zeroes.