Bug #86626 Group replication partition handling thread is not instrumented on perf schema
Submitted: 8 Jun 2017 16:42 Modified: 18 Sep 2017 13:43
Reporter: Pedro Gomes Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Group Replication Severity:S3 (Non-critical)
Version:5.7.19 OS:Any
Assigned to: CPU Architecture:Any

[8 Jun 2017 16:42] Pedro Gomes
Description:
When the partition handling thread is started there is no PSI key associated to it.

  if (mysql_thread_create(0,
                          &partition_trx_handler_pthd,
                          get_connection_attrib(),
                          launch_handler_thread,
                          (void*)this))

If the user does a select in the performance schema table for threads, and this thread is running, it wont show up.
There is no issues besides the visibility one. 

How to repeat:
Cause a partition situation.
And check the performance_schema.threads table.

You can use the following diff

diff --git a/rapid/plugin/group_replication/tests/mtr/t/gr_network_partition_handling_after_restore.test b/rapid/plugin/group_replication/tests/mtr/t/gr_network_partition_handling_after_restore.test
index ebb5543..648068f 100644
--- a/rapid/plugin/group_replication/tests/mtr/t/gr_network_partition_handling_after_restore.test
+++ b/rapid/plugin/group_replication/tests/mtr/t/gr_network_partition_handling_after_restore.test
@@ -99,6 +99,10 @@ CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
 --let $rpl_connection_name= server_1
 --source include/rpl_connection.inc
 
+--sleep 2
+
+SELECT * FROM performance_schema.threads;
+
 --disable_query_log
 --eval SET GLOBAL group_replication_force_members= "$local_address_server1"
 --enable_query_log

And then run

./mtr  --retry=0 --timer  --vardir=/dev/shm/thread_status   --suite=group_replication group_replication.gr_network_partition_handling_after_restore --big-test

Suggested fix:
Create a PSI key for the thread.
[18 Sep 2017 13:43] David Moss
Posted by developer:
 
Thank you for your feedback, this has been fixed in upcoming versions and the following was added to the 5.7.20 / 8.0.3 changelog:
Group Replication partition threads were not visible in the Performance Schema tables.