[MDEV-21462] main.processlist_notembedded fails to clean up, causes perfschema test failures Created: 2020-01-13  Updated: 2020-05-11  Resolved: 2020-05-06

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 10.5.0
Fix Version/s: 5.5.68, 10.4.13, 10.5.4, 10.1.46, 10.2.33, 10.3.24

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: regression

Issue Links:
Problem/Incident
is caused by MDEV-20466 SHOW PROCESSLIST truncates query text... Closed
Relates
relates to MDEV-22513 main.processlist_notembedded fails in... Closed

 Description   

The test perfschema.hostcache_peer_addr times out for me almost always when I run it on 10.5. Because MDEV-20466 introduced a NUL character to the output, the difference will not be displayed by mysql-test-run.pl. I got it with diff -au:

--- mysql-test/suite/perfschema/r/hostcache_peer_addr.result	2019-09-11 07:45:33.284745977 +0300
+++ mysql-test/suite/perfschema/r/hostcache_peer_addr.reject	2020-01-13 14:58:37.799296135 +0200
@@ -1,3 +1,12 @@
+Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
+Id	User	Host	db	Command	Time	State	Info	Progress
+5	root	localhost	test	Query	30	User sleep	SELECT user FROM mysql.user WHERE user ='some' or sleep (30)	0.000
+10	root	localhost	test	Query	0	Init	show full processlist	0.000
+Timeout in wait_condition.inc for select count(*) <= 1 from performance_schema.threads
+where `TYPE`='FOREGROUND'
+Id	User	Host	db	Command	Time	State	Info	Progress
+5	root	localhost	test	Query	60	User sleep	SELECT user FROM mysql.user WHERE user ='some' or sleep (30)	0.000
+10	root	localhost	test	Query	0	Init	show full processlist	0.000
 flush status;
 flush hosts;
 flush user_resources;

Above, there is a NUL character between ‘some’ and the closing quote. That command was added in MDEV-20466 to main.processlist_notembedded. That test does not appear to be properly cleaning up after itself.

I can repeat this deterministically as follows:

./mtr --no-reorder main.processlist_notembedded perfschema.hostcache_peer_addr

10.5 8576a7bacfaa4f7ac3ec86cff436e0d6e7bb3a7d

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
main.processlist_notembedded             [ pass ]     32
perfschema.hostcache_peer_addr           [ fail ]
        Test ended at 2020-01-13 14:58:38
 
CURRENT_TEST: perfschema.hostcache_peer_addr
Binary files /mariadb/10.5/mysql-test/suite/perfschema/r/hostcache_peer_addr.result and /mariadb/10.5/mysql-test/suite/perfschema/r/hostcache_peer_addr.reject differ



 Comments   
Comment by Marko Mäkelä [ 2020-05-05 ]

Here are two more failures:

./mtr --no-reorder main.processlist_notembedded perfschema.table_aggregate_off

10.5 7bcaa541aa1f298abf8e863566a19b3e9ec2f659

main.processlist_notembedded             [ pass ]     24
perfschema.table_aggregate_off           [ fail ]
        Test ended at 2020-05-05 21:05:17
 
CURRENT_TEST: perfschema.table_aggregate_off
Binary files /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_aggregate_off.result and /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_aggregate_off.reject differ

diff -ua /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_aggregate_off.re*
--- /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_aggregate_off.reject2020-05-05 20:58:59.316255187 +0300
+++ /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_aggregate_off.result2020-04-29 15:08:30.168337309 +0300
@@ -1,7 +1,3 @@
-Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
-Id	User	Host	db	Command	Time	State	Info	Progress
-123	root	localhost	test	Query	30	User sleep	SELECT user FROM mysql.user WHERE user ='some' or sleep (30)	0.000
-128	root	localhost	test	Query	0	starting	show full processlist	0.000
 update performance_schema.setup_consumers
 set enabled='NO' where name='global_instrumentation';
 select * from performance_schema.setup_actors

The diff is binary, because there is a NUL byte after the string some.
And another:

./mtr --no-reorder main.processlist_notembedded perfschema.table_lock_aggregate_thread_4u_3t

10.5 7bcaa541aa1f298abf8e863566a19b3e9ec2f659

CURRENT_TEST: perfschema.table_lock_aggregate_thread_4u_3t
Binary files /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result and /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.reject differ

diff -au /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.re*
--- /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.reject	2020-05-05 21:29:11.622563832 +0300
+++ /mariadb/10.5-merge/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result	2020-04-29 15:08:30.172337358 +0300
@@ -1,7 +1,3 @@
-Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
-Id	User	Host	db	Command	Time	State	Info	Progress
-123	root	localhost	test	Query	30	User sleep	SELECT user FROM mysql.user WHERE user ='some' or sleep (30)	0.000
-128	root	localhost	test	Query	0	starting	show full processlist	0.000
 update performance_schema.setup_instruments
 set enabled='NO' where name='wait/io/table/sql/handler';
 update performance_schema.setup_consumers

Comment by Marko Mäkelä [ 2020-05-06 ]

The test was using a combination of DEBUG_SYNC and a 30-second sleep, and it failed to ensure that the auxiliary connection got terminated on the server side. It is better to use proper DEBUG_SYNC interlocking without any sleep.

Generated at Thu Feb 08 09:07:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.