Bug #77293 Wrong processlist_user in threads table for replication threads
Submitted: 10 Jun 2015 9:42 Modified: 20 Nov 2015 10:05
Reporter: Pavel Katiushyn Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:5.6.16 OS:Linux (CentOS6.5)
Assigned to: Marc Alff CPU Architecture:Any

[10 Jun 2015 9:42] Pavel Katiushyn
Description:
For replication threads the performance_schema.threads table on slave shows the name of user that started them. 
As the result it also affect statistics in the performance_schema accounts,hosts and users tables. And maybe some others.

information_schema.processlist shows "system user" instead for replication threads.

How to repeat:
[root@SRV11 ~]$ mysql -upavel.katiushyn -p
Enter password: 

mysql> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_User: replitest
             Slave_IO_Running: No
            Slave_SQL_Running: No

mysql> start slave;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from performance_schema.threads where NAME like '%slave%'\G                                                                     *************************** 1. row ***************************
          THREAD_ID: 2417726
               NAME: thread/sql/slave_io
               TYPE: BACKGROUND
     PROCESSLIST_ID: NULL
   PROCESSLIST_USER: pavel.katiushyn
   PROCESSLIST_HOST: localhost
     PROCESSLIST_DB: NULL
PROCESSLIST_COMMAND: NULL
   PROCESSLIST_TIME: 1104487
  PROCESSLIST_STATE: Waiting for master to send event
   PROCESSLIST_INFO: NULL
   PARENT_THREAD_ID: 2416846
               ROLE: NULL
       INSTRUMENTED: YES
*************************** 2. row ***************************
          THREAD_ID: 3532155
               NAME: thread/sql/slave_sql
               TYPE: BACKGROUND
     PROCESSLIST_ID: NULL
   PROCESSLIST_USER: pavel.katiushyn
   PROCESSLIST_HOST: localhost
     PROCESSLIST_DB: NULL
PROCESSLIST_COMMAND: NULL
   PROCESSLIST_TIME: 1
  PROCESSLIST_STATE: Slave has read all relay log; waiting for the slave I/O thread t
   PROCESSLIST_INFO: NULL
   PARENT_THREAD_ID: 3529230
               ROLE: NULL
       INSTRUMENTED: YES
2 rows in set (0.00 sec)

Suggested fix:
Consider changing to "system user" as in information_schema.processlist or to NULL as for an internal threads.
[10 Jun 2015 9:47] Pavel Katiushyn
The PROCESSLIST_USER show pavel.katiushyn for both threads, as replication was started by that user.