Some time ago I wrote this article explaining how to find which node was the Primary Master in a MySQL Group Replication cluster running in Single-Primary Mode.
In the latest release of Group Replication, MySQL 8.0.2 dmr, Jaideep improved the visibility of Group Replication extending the performance_schema tables (see his article).
Thanks to these improvements, it’s now very easy to find which host is acting a Primary-Master. This is the query you can use:
mysql-sql> SELECT MEMBER_HOST as `PRIMARY` FROM performance_schema.replication_group_members WHERE MEMBER_ROLE='PRIMARY'; +---------+ | PRIMARY | +---------+ | mysql3 | +---------+ 1 row in set (0.00 sec)
Much easier isn’t it ?
I let you discover the other improvements and features in MySQL 8.0.2 and don’t forget that your feedback is very important !