mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-20139 innodb.innodb_buffer_pool_dump_pct failed in buildbot with timeout
This test was using a sleep of 1 second in an attempt to ensure that the timestamp that is part of an InnoDB status string would increase. This not only prolongs the test execution time by 1+1 seconds, but it also is inaccurate. It is possible that the actual sleep duration is less than a second. Let us wait for the creation of the file ib_buffer_pool and then wait for the buffer pool dump completion. In that way, the test can complete in a dozen or two milliseconds (1% of the previous duration) and work more reliably.
This commit is contained in:
@@ -3,17 +3,8 @@ col2 VARCHAR(25), col3 varchar(25)) ENGINE=InnoDB;
|
|||||||
CREATE INDEX idx1 ON tab5(col2(10));
|
CREATE INDEX idx1 ON tab5(col2(10));
|
||||||
CREATE INDEX idx2 ON tab5(col3(10));
|
CREATE INDEX idx2 ON tab5(col3(10));
|
||||||
SET GLOBAL innodb_buffer_pool_dump_pct=100;
|
SET GLOBAL innodb_buffer_pool_dump_pct=100;
|
||||||
SELECT variable_value INTO @IBPDS
|
|
||||||
FROM information_schema.global_status
|
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
|
|
||||||
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
||||||
SET GLOBAL innodb_buffer_pool_dump_pct=1;
|
SET GLOBAL innodb_buffer_pool_dump_pct=1;
|
||||||
SELECT @@global.innodb_buffer_pool_dump_pct;
|
|
||||||
@@global.innodb_buffer_pool_dump_pct
|
|
||||||
1
|
|
||||||
SELECT variable_value INTO @IBPDS
|
|
||||||
FROM information_schema.global_status
|
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
|
|
||||||
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
||||||
SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT;
|
SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT;
|
||||||
DROP TABLE tab5;
|
DROP TABLE tab5;
|
||||||
|
@@ -35,49 +35,44 @@ SET GLOBAL innodb_buffer_pool_dump_pct=100;
|
|||||||
# - The granularity of the timestamp is one second.
|
# - The granularity of the timestamp is one second.
|
||||||
# - There could have been some dump caused by some previous test
|
# - There could have been some dump caused by some previous test
|
||||||
# just a few milliseconds before.
|
# just a few milliseconds before.
|
||||||
# In order to avoid conflict with previous tests, read the current value
|
|
||||||
# of INNODB_BUFFER_POOL_DUMP_STATUS
|
|
||||||
# and confirm that the timestamp is different after the dump
|
|
||||||
#***********************************************************
|
#***********************************************************
|
||||||
|
|
||||||
# Read the current value to compare with the new value.
|
--error 0,1
|
||||||
SELECT variable_value INTO @IBPDS
|
--remove_file $MYSQLD_DATADIR/ib_buffer_pool
|
||||||
FROM information_schema.global_status
|
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
|
|
||||||
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
||||||
|
perl;
|
||||||
# Sleep one second in order to ensure that the time stamp is
|
my $f="$ENV{MYSQLD_DATADIR}/ib_buffer_pool";
|
||||||
# different at next dump
|
my $count=300;
|
||||||
--sleep 1
|
until (-e $f)
|
||||||
|
{
|
||||||
|
select(undef, undef, undef, .1);
|
||||||
|
die "File $f was not created\n" if (0 > --$count);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
let $wait_condition = SELECT count(*) = 1
|
let $wait_condition = SELECT count(*) = 1
|
||||||
FROM information_schema.global_status
|
FROM information_schema.global_status
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
|
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
|
||||||
AND variable_value != @IBPDS
|
|
||||||
AND variable_value like 'Buffer pool(s) dump completed at%';
|
AND variable_value like 'Buffer pool(s) dump completed at%';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
--move_file $MYSQLD_DATADIR/ib_buffer_pool $MYSQLD_DATADIR/ib_buffer_pool100
|
--move_file $MYSQLD_DATADIR/ib_buffer_pool $MYSQLD_DATADIR/ib_buffer_pool100
|
||||||
SET GLOBAL innodb_buffer_pool_dump_pct=1;
|
SET GLOBAL innodb_buffer_pool_dump_pct=1;
|
||||||
SELECT @@global.innodb_buffer_pool_dump_pct;
|
|
||||||
|
|
||||||
# Read the current value to compare with the new value.
|
|
||||||
--disable_warnings
|
|
||||||
SELECT variable_value INTO @IBPDS
|
|
||||||
FROM information_schema.global_status
|
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
SET GLOBAL innodb_buffer_pool_dump_now=ON;
|
||||||
|
|
||||||
# Sleep one second in order to ensure that the time stamp is
|
perl;
|
||||||
# different at next dump
|
my $f="$ENV{MYSQLD_DATADIR}/ib_buffer_pool";
|
||||||
--sleep 1
|
my $count=300;
|
||||||
|
until (-e $f)
|
||||||
|
{
|
||||||
|
select(undef, undef, undef, .1);
|
||||||
|
die "File $f was not created\n" if (0 > --$count);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
let $wait_condition = SELECT count(*) = 1
|
let $wait_condition = SELECT count(*) = 1
|
||||||
FROM information_schema.global_status
|
FROM information_schema.global_status
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
|
WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
|
||||||
AND variable_value != @IBPDS
|
|
||||||
AND variable_value like 'Buffer pool(s) dump completed at%';
|
AND variable_value like 'Buffer pool(s) dump completed at%';
|
||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user