[MDEV-23752] SHOW EXPLAIN FOR thd waits for sleep Created: 2020-09-18  Updated: 2023-11-22

Status: Stalled
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Critical
Reporter: Oleksandr Byelkin Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

--source include/not_embedded.inc
 
--connect (con1,localhost,root,,)
--let $con_id = `SELECT CONNECTION_ID()`
--send select sleep(100000);
 
--connection default
 
--replace_result $con_id con_id
eval SHOW EXPLAIN FOR $con_id;
 
--replace_result $con_id con_id
eval KILL QUERY $con_id;



 Comments   
Comment by Oleksandr Byelkin [ 2020-09-18 ]

for 10.6:

commit dec45aca77ee23557c59411fa9abf037e5343739 (HEAD -> bb-10.6-MDEV-23752-2, origin/bb-10.6-MDEV-23752-2, origin/bb-10.6-MDEV-16440-2)
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Fri Sep 18 17:35:08 2020 +0200
 
    MDEV-23752 SHOW EXPLAIN FOR thd waits for sleep
    
    my_apc awake thread after request.

for 10.2 & up (in 10.3 argument TRUE to check_killed() shoud be added)

commit 3d466b3c9b704e48bdffb9ed84852b9f3720b22b (HEAD -> bb-10.2-MDEV-23752, origin/bb-10.2-MDEV-23752)
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Fri Sep 18 09:11:38 2020 +0200
 
    MDEV-23752 SHOW EXPLAIN FOR thd waits for sleep
    
    call check_killed() periodically during sleep()

Comment by Michael Widenius [ 2020-10-08 ]

First pass of review done. Waiting for requested fixes and then will do a new review

Comment by Elena Stepanova [ 2021-01-29 ]

Although the bug report is still open, there is a test already for it inside mysql-test/t/processlist_notembedded.test, and the test fails fairly frequently in buildbot:

10.2 5b93a483e41

main.processlist_notembedded             w4 [ fail ]
        Test ended at 2021-01-27 15:54:35
 
CURRENT_TEST: main.processlist_notembedded
mysqltest: At line 55: query 'SHOW EXPLAIN FOR $con_id' failed: 1933: Target is not running an EXPLAINable command
 
The result from queries just before the failure was:
< snip >
connect  con1,localhost,root,,;
connection con1;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go';
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
FOUND 1 /sleep/ in MDEV-20466.text
SET DEBUG_SYNC= 'now SIGNAL go';
connection con1;
user
disconnect con1;
connection default;
SET DEBUG_SYNC = 'RESET';
End of 5.5 tests
#
# MDEV-23752: SHOW EXPLAIN FOR thd waits for sleep
#
connect  con1,localhost,root,,;
select sleep(100000);;
connection default;
SHOW EXPLAIN FOR con_id;

Please fix the test before you close the bug report.

Comment by Michael Widenius [ 2021-03-25 ]

I made this a blocker as this affects protected branches and thus can stop people from pushing

Comment by Michael Widenius [ 2021-04-20 ]

ok, I see that at least one of my review requests are in the commit, but not all.

I also noticed the split of 'awake' is already done in 10.6, so a lot of the changes in the code for dec45aca77ee23557c59411fa9abf037e5343739 has already been done.

Can you please compare your patch against 10.6 and create a new one?
Also please test that the above test case really works with 10.6

Comment by Oleksandr Byelkin [ 2021-05-03 ]

shoud be f867cca46b47f2ef9170ac9a7130bd3e493b8338 in bb-10.6-MDEV-23752-2

Comment by Michael Widenius [ 2023-11-17 ]

Looks good.
You can push, but please add the test case and also ensure to enable the test that Elena disabled

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