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() :

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

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.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.