Re: [Maria-developers] a83d6ee812b: Safe session_track_system_variables snapshot
Hi, Sergey! Just one question. Why do you need Session_sysvars_tracker::session_track_system_variables if you have THD::system_variables::session_track_system_variables ? On Mar 25, Sergey Vojtovich wrote:
revision-id: a83d6ee812b (mariadb-10.3.12-94-ga83d6ee812b) parent(s): 3c6f17a130b author: Sergey Vojtovich <svoj@mariadb.org> committer: Sergey Vojtovich <svoj@mariadb.org> timestamp: 2019-03-19 23:40:08 +0400 message:
Safe session_track_system_variables snapshot
When enabling system variables tracker, make a copy of global_system_variables.session_track_system_variables under LOCK_global_system_variables. This protects from concurrent variable updates and potential freed memory access, as well as from variable reconstruction (which was previously protected by LOCK_plugin).
We can also use this copy as a session variable pointer, so that we don't have to allocate memory and reconstruct it every time it is referenced.
For this very reason we don't need buffer_length stuff anymore.
As well as don't we need to take LOCK_plugin early in ::enable(). Unified ::parse_var_list() to acquire LOCK_plugin unconditionally. For no apparent reason it wasn't previously acquired for global variable update.
No reason to access session_sysvars_tracker via get_tracker(), so access it directly instead.
Part of MDEV-14984 - regression in connect performance
Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (1)
-
Sergei Golubchik