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

Submitted: 23 Nov 2023 17:12 Modified: 19 Oct 12:13
Reporter: Kamil Holubicki (OCA) Email Updates:
Status: Closed 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.
[20 Aug 20:48] MySQL Admin
Posted by developer: Bug status updated to 'In progress'
[21 Aug 8:48] MySQL Admin
Posted by developer: Bug status updated to 'Patch approved'
[25 Aug 14:48] MySQL Admin
Posted by developer: Bug status updated to 'Documenting'
[19 Oct 12:13] Edward Gilmore
Posted by developer:
 
Added the following note to the MySQL Server 8.4.13, 9.7.4, and 26.10.0 release notes:

After an asynchronous replica restarted, its I/O and SQL threads could
appear in INFORMATION_SCHEMA.PROCESSLIST but remain absent from
performance_schema.processlist until replication was stopped and
restarted. Foreground system threads with process-list IDs are now
retained, and an empty user name is represented as system user.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.