MySQL Group Replication: what are those UDFs ?


To operate more easily a MySQL Group Replication (InnoDB Cluster), the Group Replication plugins provides some UDFs.

If you have read the recent article from Tiago Vale about the Group Replication Communication Protocol, you may have heard about two new UDFs allowing to get or set  the communication protocol.

So what are all the UDFs provided with the Group Replication and what’s their purpose ?

SELECT UDF_NAME FROM performance_schema.user_defined_functions 
WHERE UDF_NAME LIKE 'group_repl%';
 | UDF_NAME                                        |
 | group_replication_get_communication_protocol    |
 | group_replication_get_write_concurrency         |
 | group_replication_set_as_primary                |
 | group_replication_set_communication_protocol    |
 | group_replication_set_write_concurrency         |
 | group_replication_switch_to_multi_primary_mode  |
 | group_replication_switch_to_single_primary_mode |

Some of these UDFs can be called by a cluster method when using the Shell:

  • cluster.setPrimaryInstance()
  • cluster.switchToMultiPrimaryMode()
  • cluster.switchToSinglePrimaryMode()

In case you mix UDFs managing the topology with the Shell’s method, you might encounter a mismatch that will require a rescan() :

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

I deeply value the diversity of MySQL developers, users, community and my blog readers. I cannot agree the suffering, oppression, and systemic racism the Black community faces every day. Black lives matter.