1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-09 08:01:34 +03:00

Remove wait_innodb_all_purged.inc

The file wait_innodb_all_purged.inc waited for InnoDB purge in a way
that only worked in debug builds. The file wait_all_purged.inc
provides a better mechanism.
This commit is contained in:
Marko Mäkelä
2017-08-07 23:38:27 +03:00
parent 03f3bdce5f
commit 86e0a73eaa
10 changed files with 83 additions and 168 deletions

View File

@@ -1,3 +1,5 @@
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE tab(a BIGINT PRIMARY KEY,c1 TINYTEXT,c2 TEXT,c3 MEDIUMTEXT,
c4 TINYBLOB,c5 BLOB,c6 MEDIUMBLOB,c7 LONGBLOB) ENGINE=InnoDB;
CREATE INDEX index1 ON tab(c1(255)) COMMENT 'Check index level merge MERGE_THRESHOLD=51';
@@ -205,14 +207,15 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 7
5 7
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 12;
delete from tab1 where a = 13;
delete from tab1 where a = 14;
delete from tab1 where a = 5;
delete from tab1 where a = 6;
delete from tab1 where a = 7;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -228,27 +231,24 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 4
5 4
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 11;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 1
index_page_merge_successful 1
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 10;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 2
index_page_merge_successful 2
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 9;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -288,14 +288,15 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 7
5 7
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 12;
delete from tab1 where a = 13;
delete from tab1 where a = 14;
delete from tab1 where a = 5;
delete from tab1 where a = 6;
delete from tab1 where a = 7;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -311,27 +312,24 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 4
5 4
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 11;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 10;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 1
index_page_merge_successful 1
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 9;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -371,14 +369,15 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 7
5 7
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 12;
delete from tab1 where a = 13;
delete from tab1 where a = 14;
delete from tab1 where a = 5;
delete from tab1 where a = 6;
delete from tab1 where a = 7;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -394,27 +393,24 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 4
5 4
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 11;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 10;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 9;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -459,14 +455,15 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 7
5 7
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 12;
delete from tab1 where a = 13;
delete from tab1 where a = 14;
delete from tab1 where a = 5;
delete from tab1 where a = 6;
delete from tab1 where a = 7;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -483,27 +480,24 @@ PAGE_NUMBER NUMBER_RECORDS
3 2
4 4
5 4
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 11;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 10;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=35 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 1
index_page_merge_successful 1
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 9;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=25 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -872,7 +866,7 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 21
28 21
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 33;
delete from tab1 where a = 34;
delete from tab1 where a = 35;
@@ -893,7 +887,8 @@ delete from tab1 where a = 18;
delete from tab1 where a = 19;
delete from tab1 where a = 20;
delete from tab1 where a = 21;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -910,27 +905,24 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 11
28 11
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 32;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 1
index_page_merge_successful 1
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 31;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 2
index_page_merge_successful 2
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 30;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1000,7 +992,7 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 21
28 21
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 33;
delete from tab1 where a = 34;
delete from tab1 where a = 35;
@@ -1021,7 +1013,8 @@ delete from tab1 where a = 18;
delete from tab1 where a = 19;
delete from tab1 where a = 20;
delete from tab1 where a = 21;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1038,27 +1031,24 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 11
28 11
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 32;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 31;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 1
index_page_merge_successful 1
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 30;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1128,7 +1118,7 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 21
28 21
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 33;
delete from tab1 where a = 34;
delete from tab1 where a = 35;
@@ -1149,7 +1139,8 @@ delete from tab1 where a = 18;
delete from tab1 where a = 19;
delete from tab1 where a = 20;
delete from tab1 where a = 21;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1166,27 +1157,24 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 11
28 11
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 32;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 31;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 30;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1257,7 +1245,7 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 21
28 21
set global innodb_purge_stop_now=ON;
begin;
delete from tab1 where a = 33;
delete from tab1 where a = 34;
delete from tab1 where a = 35;
@@ -1278,7 +1266,8 @@ delete from tab1 where a = 18;
delete from tab1 where a = 19;
delete from tab1 where a = 20;
delete from tab1 where a = 21;
set global innodb_purge_run_now=ON;
commit;
InnoDB 0 transactions not purged
# check page merge happens (nothing is expected)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1295,27 +1284,24 @@ PAGE_NUMBER NUMBER_RECORDS
4 2
27 11
28 11
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 32;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=50 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 0
index_page_merge_successful 0
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 31;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=45 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
name count_reset
index_page_merge_attempts 1
index_page_merge_successful 1
set global innodb_purge_stop_now=ON;
delete from tab1 where a = 30;
set global innodb_purge_run_now=ON;
InnoDB 0 transactions not purged
# check page merge happens (MERGE_THRESHOLD=40 causes merge here)
SELECT name,count_reset FROM information_schema.innodb_metrics
WHERE name like 'index_page_merge_%';
@@ -1323,3 +1309,4 @@ name count_reset
index_page_merge_attempts 2
index_page_merge_successful 2
DROP TABLE tab1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

View File

@@ -1,5 +1,3 @@
DROP TABLE if exists t1;
DROP TABLE if exists t2;
Testing tables with large records
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c VARCHAR(256), KEY SECOND(a, b,c)) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, REPEAT('A', 256), REPEAT('B', 256));
@@ -13,6 +11,7 @@ INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
SET GLOBAL innodb_fast_shutdown = 0;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
@@ -57,6 +56,7 @@ insert into t1 values (204, REPEAT('A', 256), REPEAT('B', 256));
DROP TABLE t1;
Testing table with small records
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(16), c VARCHAR(32), KEY SECOND(a,b,c)) ENGINE=INNODB;
SET GLOBAL innodb_fast_shutdown = 0;
optimize table t2;
Table Op Msg_type Msg_text
test.t2 optimize status OK