Skip to content

Commit 2499b16

Browse files
committed
Bug#36764973 MTR TEST innodb.parallel_read_kill FAILING IN MYSQL 8.0.37
Description ----------- The test has been failing 8.0.37 onwards. Background ----------- Test creates a table with a secondary index and inserts 150K un-commited records in it. Earlier Innodb was ignoring the optimizer hints but using the clustered index to count the records in the table. This behavior was reverted through Bug#35952353 [SELECT COUNT(*) degraded performance on 8.0 compared to 5.7] in 8.0.37. Now the query execution is quicker than before since it is using secondary index to count the records. Test doesn't have any dependency on the secondary index, therefore, removing the secondary index key from the table would restore the intent of the test. Fix ---- * Removed the secondary index key from the table. * Prepare the table of 150K records through 8 user connections, each of them inserts 18750 records. This reduces test execution duration to qualify it as a regular test than big test. Change-Id: I14bd90cf765ea3ad200e2d83c962f648f8366111
1 parent e2cb8ac commit 2499b16

File tree

2 files changed

+48
-14
lines changed

2 files changed

+48
-14
lines changed

mysql-test/suite/innodb/r/parallel_read_kill.result

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ END|
1212
CREATE TABLE t1(
1313
f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
1414
f2 INT NOT NULL,
15-
f3 INT NOT NULL,
16-
KEY(f2, f3))
15+
f3 INT NOT NULL)
1716
ENGINE=INNODB;
18-
BEGIN;
19-
# Create uncommitted rows
20-
CALL populate_t1(1, 150000);
17+
# Create 150000 uncommitted rows
2118
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
2219
SET SESSION innodb_parallel_read_threads=2;
2320
# Count committed rows
@@ -35,7 +32,6 @@ COUNT(*)
3532
Warnings:
3633
Warning 1287 'INFORMATION_SCHEMA.PROCESSLIST' is deprecated and will be removed in a future release. Please use performance_schema.processlist instead
3734
ERROR 70100: Query execution was interrupted
38-
COMMIT;
3935
# Cleanup
4036
SET DEBUG_SYNC="RESET";
4137
DROP PROCEDURE populate_t1;

mysql-test/suite/innodb/t/parallel_read_kill.test

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
--source include/have_debug.inc
2-
--source include/big_test.inc
2+
# Save the initial number of concurrent sessions
3+
--source include/count_sessions.inc
34

45
--echo #
56
--echo # Bug#31016076 SELECT COUNT(*) ON LARGE TABLE HANG FOREVER EVEN AFTER CTRL+C
@@ -19,13 +20,38 @@ DELIMITER ;|
1920
CREATE TABLE t1(
2021
f1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
2122
f2 INT NOT NULL,
22-
f3 INT NOT NULL,
23-
KEY(f2, f3))
23+
f3 INT NOT NULL)
2424
ENGINE=INNODB;
2525

26-
BEGIN;
27-
--echo # Create uncommitted rows
28-
CALL populate_t1(1, 150000);
26+
let $counter = 1;
27+
let $max_counter=9;
28+
while($counter < $max_counter){
29+
connect (c$counter, localhost, root,,);
30+
inc $counter;
31+
}
32+
33+
--disable_query_log
34+
--echo # Create 150000 uncommitted rows
35+
let $counter = 1;
36+
let $base=1;
37+
# Each of 8 connections creates 18750 records
38+
let $size = 18750;
39+
while($counter < $max_counter) {
40+
connection c$counter;
41+
BEGIN;
42+
send_eval CALL populate_t1($base, $size);
43+
connection default;
44+
let $base = `SELECT $base + $size`;
45+
inc $counter;
46+
}
47+
48+
let $counter = 1;
49+
while($counter < $max_counter) {
50+
connection c$counter;
51+
reap;
52+
inc $counter;
53+
}
54+
--enable_query_log
2955

3056
connect (con1,localhost,root,,);
3157
connection con1;
@@ -59,11 +85,23 @@ connection con1;
5985
--error ER_QUERY_INTERRUPTED
6086
--reap
6187

62-
connection default;
63-
COMMIT;
88+
89+
--disable_query_log
90+
let $counter = 1;
91+
while($counter < $max_counter){
92+
connection c$counter;
93+
COMMIT;
94+
disconnect c$counter;
95+
inc $counter;
96+
}
97+
--enable_query_log
6498

6599
--echo # Cleanup
100+
connection default;
66101
SET DEBUG_SYNC="RESET";
67102
DROP PROCEDURE populate_t1;
68103
DROP TABLE t1;
69104
disconnect con1;
105+
106+
# Wait till all disconnects are completed
107+
--source include/wait_until_count_sessions.inc

0 commit comments

Comments
 (0)