MDEV-20389: Refine the test case

Let us invoke wait_all_purged.inc right before the workload.
Starting with MDEV-12288 in MariaDB Server 10.3, also INSERT
generates purge workload. If we do not ensure that purge has
run to completion, the results on 10.3 and later could be
nondeterministic.
This commit is contained in:
Marko Mäkelä 2019-08-20 16:03:43 +03:00
parent 2850b8d844
commit 4438ff07cd
2 changed files with 3 additions and 2 deletions

View file

@ -6,7 +6,6 @@
#
SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency= 1;
InnoDB 0 transactions not purged
CREATE PROCEDURE insert_n(start int, end int)
BEGIN
DECLARE i INT DEFAULT start;
@ -52,6 +51,7 @@ connection default;
# Connect to default and record how many pages were accessed
# when selecting the record using the secondary key.
#
InnoDB 3 transactions not purged
SET @num_pages_1 = num_pages_get();
SELECT * FROM t1 force index (b);
a b c

View file

@ -8,7 +8,6 @@
--source include/have_innodb.inc
SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency= 1;
--source include/wait_all_purged.inc
DELIMITER ~~;
CREATE PROCEDURE insert_n(start int, end int)
@ -65,6 +64,8 @@ connection default;
--echo # Connect to default and record how many pages were accessed
--echo # when selecting the record using the secondary key.
--echo #
--let $wait_all_purged=3
--source include/wait_all_purged.inc
SET @num_pages_1 = num_pages_get();
SELECT * FROM t1 force index (b);
SET @num_pages_2= num_pages_get();