-
Marc Alff authored
SESSION_CONNECT_ATTRS Before this fix, executing a select on table performance_schema.session_connect_attrs could crash the server, when executed under load. The root cause is that the code that scans records: - does not honor the PFS_thread::m_sesion_lock lock, - does parse the live session attribute data, while it can possibly be modified Race conditions could occur: - when writing session attributes, shortly after a thread connect - when erasing session attributes, shortly before a thread disconnect The fix is to: - use an optimist lock on PFS_thread::m_sesion_lock - make a copy of the session connect attributes, - only when the optimist lock was successful, (meaning the data was not concurently modified), parse the safe copy of the content of it to extract attributes.
Marc Alff authoredSESSION_CONNECT_ATTRS Before this fix, executing a select on table performance_schema.session_connect_attrs could crash the server, when executed under load. The root cause is that the code that scans records: - does not honor the PFS_thread::m_sesion_lock lock, - does parse the live session attribute data, while it can possibly be modified Race conditions could occur: - when writing session attributes, shortly after a thread connect - when erasing session attributes, shortly before a thread disconnect The fix is to: - use an optimist lock on PFS_thread::m_sesion_lock - make a copy of the session connect attributes, - only when the optimist lock was successful, (meaning the data was not concurently modified), parse the safe copy of the content of it to extract attributes.
Loading