p_s.processlist table does not contain async replica threads after restart

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.

Steps to reproduce:
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

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

I didn't investigate all details, but it seems the problem 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

Environment

None

Activity

Show:

Details

Assignee

Reporter

Needs QA

Yes

Affects versions

Priority

Smart Checklist

Created November 23, 2023 at 5:14 PM
Updated March 6, 2024 at 9:29 AM