Commit 98a78c46 authored by Jan Lindström's avatar Jan Lindström

MDEV-7181: innodb.innodb_defrag_concurrent fails in buildbot

Problem was that test tried to calculate number of pages on
buffer pool and operations done to them. This is not realible
way on buildbot.
parent afe6d88d
...@@ -5,30 +5,24 @@ select @@global.innodb_stats_persistent; ...@@ -5,30 +5,24 @@ select @@global.innodb_stats_persistent;
set global innodb_defragment_stats_accuracy = 80; set global innodb_defragment_stats_accuracy = 80;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB; CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
SET @@global.innodb_defragment_n_pages = 20; SET @@global.innodb_defragment_n_pages = 20;
after populate PRIMARY
select count(*) from t1; select count(*) from t1;
count(*) count(*)
20000 20000
after populate second
select count(*) from t1 force index (second); select count(*) from t1 force index (second);
count(*) count(*)
20000 20000
after populate third
select count(*) from t1 force index (third); select count(*) from t1 force index (third);
count(*) count(*)
20000 20000
select count(*) from t1; select count(*) from t1;
count(*) count(*)
15800 15800
after delete PRIMAY
select count(*) from t1 force index (second); select count(*) from t1 force index (second);
count(*) count(*)
15800 15800
after delete second
select count(*) from t1 force index (third); select count(*) from t1 force index (third);
count(*) count(*)
15800 15800
after delete third
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 0 count(stat_value) > 0
0 0
...@@ -46,21 +40,15 @@ UPDATE t1 SET c = c + 1 where c between 2000 and 8000;; ...@@ -46,21 +40,15 @@ UPDATE t1 SET c = c + 1 where c between 2000 and 8000;;
optimize table t1; optimize table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
select sleep(5);
sleep(5)
0
select count(*) from t1; select count(*) from t1;
count(*) count(*)
15723 15723
after optimize PRIMARY
select count(*) from t1 force index (second); select count(*) from t1 force index (second);
count(*) count(*)
15723 15723
after optimize second
select count(*) from t1 force index (third); select count(*) from t1 force index (third);
count(*) count(*)
15723 15723
after optimize third
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 0 count(stat_value) > 0
1 1
......
...@@ -41,30 +41,10 @@ while ($i) ...@@ -41,30 +41,10 @@ while ($i)
} }
--enable_query_log --enable_query_log
--echo after populate PRIMARY
select count(*) from t1; select count(*) from t1;
if (`select count(*) < 30 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
aelect count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
--echo after populate second
select count(*) from t1 force index (second); select count(*) from t1 force index (second);
if (`select count(*) < 320 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
--ECHO after populate third
select count(*) from t1 force index (third); select count(*) from t1 force index (third);
if (`select count(*) < 20 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'third' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'third' order by page_number;
}
# Delete some data # Delete some data
--disable_query_log --disable_query_log
let $size = $delete_size; let $size = $delete_size;
...@@ -77,29 +57,9 @@ while ($size) ...@@ -77,29 +57,9 @@ while ($size)
--enable_query_log --enable_query_log
select count(*) from t1; select count(*) from t1;
--echo after delete PRIMAY
if (`select count(*) < 30 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
select count(*) from t1 force index (second); select count(*) from t1 force index (second);
--echo after delete second
if (`select count(*) < 300 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
select count(*) from t1 force index (third); select count(*) from t1 force index (third);
--echo after delete third
if (`select count(*) > 20 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'third' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'third' order by page_number;
}
# Above delete will free some pages and insert causes page split and these could cause defrag # Above delete will free some pages and insert causes page split and these could cause defrag
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
...@@ -143,32 +103,11 @@ disconnect con3; ...@@ -143,32 +103,11 @@ disconnect con3;
disconnect con4; disconnect con4;
optimize table t1; optimize table t1;
select sleep(5);
select count(*) from t1; select count(*) from t1;
--echo after optimize PRIMARY
if (`select count(*) > 62 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
select count(*) from t1 force index (second); select count(*) from t1 force index (second);
--echo after optimize second
if (`select count(*) > 340 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
select count(*) from t1 force index (third); select count(*) from t1 force index (third);
--echo after optimize third
if (`select count(*) > 25 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'third' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'third' order by page_number;
}
# Now pages are freed # Now pages are freed
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split'); select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment