Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
The current design limits SHOW/information_schema.PROCESSLIST STATEs (or technically, THD::proc_info) to static const strings.
Its description (in sql_class.h) reads:
This member is accessed and assigned without any synchronization.
Therefore, it may point only to constant (statically allocated) strings, which memory won't go away over time.
However, memory for dynamic strings inherently will go away over time.
Even an THD instance goes away as the corresponding thread terminates.
Lifting this limitation enables threads to provide flexible statuses with specific details (such as table names, GTIDs and statistics, as requested by MDEV-4557) without the constraints of available PROCESSLIST columns.
Requirements
- Maintain performance with constant strings, as many existing statuses will likely remain
- Be performant yet memory-safe for non-constant strings
- E.g., lazy generation: format on read rather than on write
- To be Confirmed: atomic copy-on-read
- Optional: support “undo” (it’s a popular pattern) or even state nesting
Attachments
Issue Links
- relates to
-
MDEV-37211 THD::proc_info is vulnerable to data race
-
- Open
-
- split from
-
MDEV-36839 Optimize Rows_log_event Reporting of Process Info
-
- Closed
-