Bug #113202 p_s.processlist table does not contain async replica threads after restart
Submitted: 23 Nov 2023 17:12 Modified: 23 Nov 2023 19:46
Reporter: Kamil Holubicki (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.35 OS:Any
Assigned to: CPU Architecture:Any

[23 Nov 2023 17:12] Kamil Holubicki
Description:
After restarting async replica server, performance_schema.processlist table does not contain replica threads.

select * from performance_schema.processlist;

They appear back after stopping and starting replica.

How to repeat:
1. Setup 2 node async replication (node1 -> node2)
2. node2: I_S.processlist and P_S.processlist contain async replica threads
3. node2: shutdown
4. start node2
5. node2: I_S.processlist contains contain replica threads, but P_S.processlist does not.
6. node2: stop replica; start replica => P_S.processlist shows replica threads again

Suggested fix:
I don't have a fix for this. The cause is how table_processlist::make_row() method works. It filters out all threads which don't have user_name set.

I didn't investigate all details, but it seems the problm is because:

If replica thread is started by the user (from user connection), pfs->m_user_name is inherited from parent thread and then P_S.processlist shows replica threads.

If replica thread is started during server startup this info is missing and pfs->m_user_name is empty
[23 Nov 2023 19:46] MySQL Verification Team
Hi,

Thanks for the report.