• Sergey Vojtovich's avatar
    MDEV-6083 - Assertion `! (&(&LOCK_open)->m_mutex)->count || · 5506768c
    Sergey Vojtovich authored
                ! pthread_equal(pth read_self(), (&(&LOCK_open)->m_mutex)->thread)'
                fails in intern_sys_var_ptr on server shutdown after uninstalling
                TokuDB plugin at runtime
    
    This assertion was introduced by patch for MDEV-5089 to ensure proper lock order
    among LOCK_open and LOCK_global_system_variables: LOCK_open must not be held
    while acquiring LOCK_global_system_variables.
    
    intern_sys_var_ptr() may be called while freeing storage engine variables with
    PLUGIN_VAR_MEMALLOC flag (when destroying table share after storage engine was
    uninstalled). In this case LOCK_open is held, which is harmless because we need
    global value pointer and thus won't acquire LOCK_global_system_variables.
    
    Relaxed assertion so it is valid only for session variables.
    5506768c
sql_plugin.cc 118 KB