Bug #88668 UNISTALL Group Replication can deadlock with GR Start on server start
Submitted: 27 Nov 2017 17:30 Modified: 22 Feb 2018 12:13
Reporter: Pedro Gomes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:8.0.4 OS:Any
Assigned to: CPU Architecture:Any

[27 Nov 2017 17:30] Pedro Gomes
Description:
NOTE:
This bug may be refused as it is based on user malpractices, but it is still described here for future reference.

If server is booted and group replication is starting alongside it, the control to the user will be given to him when the server is in read mode. 

If the user panics and un-sets the read only mode and unistall the plugin.

The command will deadlock when this happens:

1) The uninstall will be stuck because it is waiting on GCS to terminate.
2) GCS will get stuck as in the join, it will see the read mode off and will try to set it. It can't because it is waiting on 1.

How to repeat:
Go to 

gr_plugin_reinstall_with_start_on_boot 

add the group name to the server restart params

remove the mtr suppressions and unset the read mode.

Run the test and watch it get stuck.

Suggested fix:
Obvious one:
Don't do this.

If for some reason we want to fix this, check that that server is not uninstalling when trying to set the read mode on a view change.
Or check that we are already leaving, there is maybe a flag that we can use.
[22 Feb 2018 12:13] David Moss
Posted by developer:
 
Thank you for your feedback, this has been fixed in upcoming versions and the following was added to the 8.0.11 changelog:
Attempting to uninstall the Group Replication plugin on a server configured to start the plugin automatically at boot could result in a deadlock. Now, the uninstall process checks to ensure that the plugin is not in the process of starting and fails gracefully if it is.
[31 May 2018 14:49] David Moss
Reclosing.