Bug #90949 Bug #88693 not fixed yet? INSTALL PLUGIN hang
Submitted: 21 May 2018 10:50 Modified: 21 May 2018 11:36
Reporter: Roel Van de Paar Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.7.21 OS:Any
Assigned to: CPU Architecture:Any

[21 May 2018 10:50] Roel Van de Paar
Description:
A given thread will try to lock LOCK_system_variables_hash, has LOCK_plugin locked. While another thread has LOCK_plugin locked, and tries to lock LOCK_system_variables_hash.

Credits: 
- Hang analysis, code bug & past bug discovery, testcase idea: Laurynas Biveinis
- Hang discovery, testcase implementation: yours truly

How to repeat:
Very easy to reproduce. Testcase:

$ cat test.sql
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master.so';
SELECT @@version_comment;
UNINSTALL PLUGIN rpl_semi_sync_master;

Run in tight loop, multi-threaded. Plugin choice and var choice don't matter.

You can use https://github.com/Percona-QA/percona-qa/blob/master/multirun_cli.sh as follows to run:

~/percona-qa/multirun_cli.sh 100 100 test.sql ./bin/mysql ./socket.sock

By the time it hits thread ~80 (first round out of 100) it will have likely locked up already. No CLI access possible after that. 

Suggested fix:
Please fix this bug, it may be causing other issues.
[21 May 2018 11:36] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that with the provided test case, issue is no longer seen on 5.7.22 (5.7.21 is affected with the provided test case and I see INSTALL.. in System lock state and no further CLI connection possible). Could you please confirm with 5.7.22? Thank you.

Regards,
Umesh
[21 May 2018 11:40] MySQL Verification Team
Observed that the internal bug(bug #26946491) which is mentioned in Bug #88693 is fixed in 5.7.22

*** PDUBOIS  paul.dubois 01/05/18 10:17 am *** 
Fixed in 5.7.22, 8.0.4

Installing and uninstalling a plugin many times from multiple 
sessions could cause the server to become unresponsive.