Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.4
-
None
Description
Performance schema suffers from check-then act anti-pattern
For example init_setup_actor_hash:
if ((! setup_actor_hash_inited) && (param->m_setup_actor_sizing != 0))
|
{
|
lf_hash_init(&setup_actor_hash, sizeof(PFS_setup_actor*), LF_HASH_UNIQUE,
|
0, 0, setup_actor_hash_get_key, &my_charset_bin);
|
/* setup_actor_hash.size= param->m_setup_actor_sizing; */
|
setup_actor_hash_inited= true;
|
}
|
The compiler or CPU can reorder setup_actor_hash_inited initialization before lf_hash_init call.
At the same time, get_setup_actor_hash_pins
if (! setup_actor_hash_inited)
|
return NULL;
|
thread->m_setup_actor_hash_pins= lf_hash_get_pins(&setup_actor_hash);
|
can be called in parallel, resulting, in fact, in having garbage in setup_actor_hash.
Same for the other modules. Basically, everything called in
initialize_performance_schema is worth checking.
Probably, PFS_buffer_scalable_container's m_initialized is not affected.
Attachments
Issue Links
- relates to
-
MDEV-28162 clang compiler emits atomic library calls on x86/32bit
- Closed