Bug #102249 Slow query log filling up with performance_schema queries
Submitted: 14 Jan 2021 15:56 Modified: 18 Jan 2021 12:17
Reporter: Matthias Crauwels (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:8.0.22 OS:Any
Assigned to: CPU Architecture:Any
Tags: group-replication, mysqlrouter, performance_schema, slow_query_log

[14 Jan 2021 15:56] Matthias Crauwels
Description:
In our group replication cluster we currently have the slow query log filling up with queries to performance_schema coming from mysqlrouter.

The type of query that gets tracked is the following: 
SELECT member_id, member_host, member_port, member_state, @@group_replication_single_primary_mode FROM performance_schema.replication_group_members WHERE channel_name = 'group_replication_applier'

This query is triggered from every router every second.

How to repeat:
On any of the InnoDB cluster nodes set these variables.

SET GLOBAL slow_query_log = ON;
SET GLOBAL log_queries_not_using_indexes = ON;

As soon as you connect a single mysqlrouter node the slow_query_log start filling up.

Suggested fix:
Add an index on channel_name in performance_schema.replication_group_members
[27 Jan 2021 17:38] MySQL Verification Team
Hi,

Thanks for the report. This is a known issue. The way P_S works is changed in MySQL 8 and is being improved as we speak. 

all best
Bogdan