Bug #102115 Contribution by Facebook: Fix replica threads not showing in variables_by_thread
Submitted: 31 Dec 2020 17:37 Modified: 15 Jan 2021 19:26
Reporter: FBContrib Admin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S3 (Non-critical)
Version:8.0.20 OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[31 Dec 2020 17:37] FBContrib Admin
Description:
Background innformation provided by Facebook:
Abstract:
Fixes https://bugs.mysql.com/bug.php?id=98434

The reason replication worker threads were not showing up was because the PFS_thread objectwas not linked to the THD object. The fix is to call mysql_thread_set_psi_THD. We also set mysql_thread_set_psi_id to set the correct processlist_id.

Use case: We can look at variable settings on the replication worker threads to determine if there are misconfugrations.

Repo: https://github.com/mysql/mysql-server
Patch on top of 8.0.20: https://github.com/mysql/mysql-server/commit/7d10c82196c 

How to repeat:
See description

Suggested fix:
See contribution code attached
[31 Dec 2020 17:37] FBContrib Admin
Fix slave threads not showing in variables_by_thread 
(*) This code is contributed under the Facebook agreement

Contribution: fb_patch_209.txt (text/plain), 1.81 KiB.

[11 Jan 2021 10:42] Marc ALFF
Thanks for the contribution.

For the bits related to mysql_thread_set_psi_id() and column PROCESSLIST_ID,
the fix is no longer required, as it was addressed by:

Bug#71682 PROCESSLIST_ID for slave sql thread is missing

already fixed in MySQL 5.7.5.

For the bits related to mysql_thread_set_psi_THD(),
this is the correct solution, accepting the patch.

Regards,
-- Marc Alff
[15 Jan 2021 19:26] Paul DuBois
Posted by developer:
 
Fixed in 8.0.24.

Replication threads running in the server were visible in the
Performance Schema threads table, but failed to appear in the
variables_by_thread or status_by_thread tables. Now they appear in
all three tables. Thanks to Facebook for the contribution.
[12 Feb 2021 15:46] Omer Barnir
Thanks to Facebook for the contribution