From 98a78c460f3e7951712255e68a6dce614551683d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 25 Nov 2014 09:11:48 +0200 Subject: [PATCH] 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. --- .../innodb/r/innodb_defrag_concurrent.result | 12 ---- .../innodb/t/innodb_defrag_concurrent.test | 63 +------------------ 2 files changed, 1 insertion(+), 74 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result index 1b1ff3a858f..d3ad9cc9065 100644 --- a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result +++ b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result @@ -5,30 +5,24 @@ select @@global.innodb_stats_persistent; 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; SET @@global.innodb_defragment_n_pages = 20; -after populate PRIMARY select count(*) from t1; count(*) 20000 -after populate second select count(*) from t1 force index (second); count(*) 20000 -after populate third select count(*) from t1 force index (third); count(*) 20000 select count(*) from t1; count(*) 15800 -after delete PRIMAY select count(*) from t1 force index (second); count(*) 15800 -after delete second select count(*) from t1 force index (third); count(*) 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'); count(stat_value) > 0 0 @@ -46,21 +40,15 @@ UPDATE t1 SET c = c + 1 where c between 2000 and 8000;; optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK -select sleep(5); -sleep(5) -0 select count(*) from t1; count(*) 15723 -after optimize PRIMARY select count(*) from t1 force index (second); count(*) 15723 -after optimize second select count(*) from t1 force index (third); count(*) 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'); count(stat_value) > 0 1 diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test index 2b08613535c..f596fab2a15 100644 --- a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test +++ b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test @@ -41,30 +41,10 @@ while ($i) } --enable_query_log ---echo after populate PRIMARY 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); - -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); -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 --disable_query_log let $size = $delete_size; @@ -76,30 +56,10 @@ while ($size) } --enable_query_log -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; 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); ---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 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'); @@ -143,32 +103,11 @@ disconnect con3; disconnect con4; optimize table t1; -select sleep(5); 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); - ---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); ---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 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');