WL#10378: Group Replication: group single/multi primary mode change and primary election

Affects: Server-8.0   —   Status: Complete

Executive Summary

This worklog implements a framework to do group-wide configuration changes. After this worklog is done, the user will be able to change single_primary_mode without having to stop group replication, and he will also be able to trigger the election of a specific member as the new primary.

Background

Group Replication can be configured to run on multi primary (multi-primary) or single primary mode. Both these modes have their use cases but situations may occur where the user may want to go from one to the other with no downtime and currently such a change would require a rolling shutdown of the group members.

This worklog aims to make the change from multi-primary to single primary possible with a simple invocation of a function. The group should coordinate to elect a primary, enable or disable the read only modes on the correct members and execute any other necessary step that is deemed necessary.

This worklog should also provide to the end user the much requested option to force the election of a new primary member of his/her choice. Until now the primary would be the first member of the group, or when it died/stopped, the one with the lowest UUID or greater member weight.

This last feature is included in this worklog as it is a derivation of the coordination process that must be in place for the above live changes from multi-primary to single-primary mode and vice-versa.

User Stories

  • As a MySQL DBA I want to change the primary from member A to member B without having to remove member A from the group, so I can demote member A to secondary.

  • As a MySQL DBA I want to change from single primary mode to multi primary mode without stopping group replication, so I can from now on write to multiple servers.

  • As a MySQL DBA I want to change from multi primary mode to single primary, so I adjust the deployment mode now that I have figured that multi primary is not really fitting my use case.