Fix galera.galera_kill_ddl test errors in debug mode.
Marko reported DBUG_ASSERT from dict_stats_shutdown(). destroy_background_thd() does not like when current_thd is set. In galera, it can be the case, dict_stats_shutdown() can be called from user thread, to stop and later restart stats recalculations.
This commit is contained in:
parent
bdaa6bac05
commit
9f40f02a8d
@ -69,6 +69,8 @@ static recalc_pool_t recalc_pool;
|
|||||||
/** Whether the global data structures have been initialized */
|
/** Whether the global data structures have been initialized */
|
||||||
static bool stats_initialised;
|
static bool stats_initialised;
|
||||||
|
|
||||||
|
static THD *dict_stats_thd;
|
||||||
|
|
||||||
/*****************************************************************//**
|
/*****************************************************************//**
|
||||||
Free the resources occupied by the recalc pool, called once during
|
Free the resources occupied by the recalc pool, called once during
|
||||||
thread de-initialization. */
|
thread de-initialization. */
|
||||||
@ -90,6 +92,9 @@ static void dict_stats_recalc_pool_deinit()
|
|||||||
defrag_pool_t defrag_empty_pool;
|
defrag_pool_t defrag_empty_pool;
|
||||||
recalc_pool.swap(recalc_empty_pool);
|
recalc_pool.swap(recalc_empty_pool);
|
||||||
defrag_pool.swap(defrag_empty_pool);
|
defrag_pool.swap(defrag_empty_pool);
|
||||||
|
|
||||||
|
if (dict_stats_thd)
|
||||||
|
destroy_background_thd(dict_stats_thd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************//**
|
/*****************************************************************//**
|
||||||
@ -379,7 +384,6 @@ static bool is_recalc_pool_empty()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static tpool::timer* dict_stats_timer;
|
static tpool::timer* dict_stats_timer;
|
||||||
static THD *dict_stats_thd;
|
|
||||||
static void dict_stats_func(void*)
|
static void dict_stats_func(void*)
|
||||||
{
|
{
|
||||||
if (!dict_stats_thd)
|
if (!dict_stats_thd)
|
||||||
@ -419,10 +423,4 @@ void dict_stats_shutdown()
|
|||||||
{
|
{
|
||||||
delete dict_stats_timer;
|
delete dict_stats_timer;
|
||||||
dict_stats_timer= 0;
|
dict_stats_timer= 0;
|
||||||
|
|
||||||
if (dict_stats_thd)
|
|
||||||
{
|
|
||||||
destroy_background_thd(dict_stats_thd);
|
|
||||||
dict_stats_thd= 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user